Browse Source

feat: 使用模型内容实现配置

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
243da555f7
  1. 17
      public/static/offline/JSON/config.json
  2. 8
      src/composables/useInitConfigAndMallInfo.js

17
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"}}
{
"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"
}
}
]
}

8
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)

Loading…
Cancel
Save