From 243da555f7f2cc7d97edcb020ebbadb2c6798333 Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Wed, 28 Jun 2023 14:49:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AE=9E=E7=8E=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/offline/JSON/config.json | 17 ++++++++++++++++- src/composables/useInitConfigAndMallInfo.js | 8 +++++--- 2 files changed, 21 insertions(+), 4 deletions(-) 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)