Browse Source

feat: 增加debug调试能力

dev
jiannibang 3 years ago
parent
commit
ba3c3b715f
  1. 1
      package.json
  2. 5
      public/static/offline/JSON/config.json
  3. 3
      src/composables/useInitConfigAndMallInfo.js

1
package.json

@ -19,6 +19,7 @@
"pinia": "^2.0.11", "pinia": "^2.0.11",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"swiper": "^8.0.7", "swiper": "^8.0.7",
"vconsole": "^3.15.0",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"vue-router": "^4.0.3" "vue-router": "^4.0.3"

5
public/static/offline/JSON/config.json

@ -2,9 +2,10 @@
"code": "200", "code": "200",
"msg": "", "msg": "",
"data": { "data": {
"interfaceUrl": "https://test.iot.1000my.com/api",
"interfaceUrl": "https://project-iot.test.1000my.com/api",
"sourceUrl": "/static/offline", "sourceUrl": "/static/offline",
"backSocket": "ws://127.0.0.1:7181", "backSocket": "ws://127.0.0.1:7181",
"mobileNav": "https://1000my.obs.cn-east-2.myhuaweicloud.com/mobileqmgo/index.html#/"
"mobileNav": "https://1000my.obs.cn-east-2.myhuaweicloud.com/mobileqmgo/index.html#/",
"debug": true
} }
} }

3
src/composables/useInitConfigAndMallInfo.js

@ -1,10 +1,11 @@
import { getConfig, getCurrentFloor, getGuideList, getTheme } from '@/http/api' import { getConfig, getCurrentFloor, getGuideList, getTheme } from '@/http/api'
import { useStore } from '@/store/root' import { useStore } from '@/store/root'
import VConsole from 'vconsole'
export const useInitConfigAndMallInfo = async () => { export const useInitConfigAndMallInfo = async () => {
const _config = await getConfig() const _config = await getConfig()
const store = useStore() const store = useStore()
if (_config.data.debug) new VConsole()
{ {
const { data: theme } = await getTheme() const { data: theme } = await getTheme()
const r = document.querySelector(':root') const r = document.querySelector(':root')

Loading…
Cancel
Save