diff --git a/public/static/offline/JSON/config.json b/public/static/offline/JSON/config.json index 4423e31..bde98f4 100644 --- a/public/static/offline/JSON/config.json +++ b/public/static/offline/JSON/config.json @@ -1 +1,16 @@ -{"code":200,"msg":"操作成功","data":{"sourceUrl":"/static/offline","debug":false,"interfaceUrl":"https://project-iot.test.1000my.com/api","mobileNav":"https://1000my.obs.cn-east-2.myhuaweicloud.com/mobileqmgo/index.html#/","handWriteUrl":"http://saas.1000my.com:8014/words","fileUrl":"https://test-598d.obs.cn-east-2.myhuaweicloud.com","backSocket":"ws://127.0.0.1:7181","clickUploadUrl":"/analysis/v1/web/deviceUseClickDataUpload"}} \ No newline at end of file +{ + "code": 200, + "msg": "操作成功", + "data": [ + { + "id": 80, + "title": "默认配置", + "content": { + "interfaceUrl": "https://project-iot.test.1000my.com/api", + "handWriteUrl": "http://saas.1000my.com:8014/words", + "mobileNav": "https://qianmu-iot.1000my.com/base_qmgo_react-test/index.html#/", + "clickUploadUrl": "/analysis/v1/web/deviceUseClickDataUpload" + } + } + ] +} diff --git a/src/composables/useInitConfigAndMallInfo.js b/src/composables/useInitConfigAndMallInfo.js index 23e4200..49c46ad 100644 --- a/src/composables/useInitConfigAndMallInfo.js +++ b/src/composables/useInitConfigAndMallInfo.js @@ -3,9 +3,11 @@ import { useStore } from '@/store/root' import VConsole from 'vconsole' export const useInitConfigAndMallInfo = async () => { - const _config = await getConfig() + const { + data: [{ content: config }] + } = await getConfig() const store = useStore() - if (_config.data.debug) new VConsole() + if (config.debug) new VConsole() { const { data: theme } = await getTheme() @@ -30,7 +32,7 @@ export const useInitConfigAndMallInfo = async () => { console.log(error) } - store.SET_CONFIG(_config.data) + store.SET_CONFIG(config) const _currentFloor = await getCurrentFloor() store.SET_CURRENT_FLOOR(_currentFloor.data)