|
|
@@ -95,11 +95,18 @@ export default new (class {
|
|
|
const filePath = './config/appconfig.json'
|
|
|
if (plus.hasPlus()) {
|
|
|
const res = await plus.getLocalFileContent(filePath)
|
|
|
- return JSON.parse(res)
|
|
|
+ this.systemInfo = {
|
|
|
+ ...this.systemInfo,
|
|
|
+ ...JSON.parse(res)
|
|
|
+ }
|
|
|
} else {
|
|
|
const res = await axios(filePath)
|
|
|
- return res.data
|
|
|
+ this.systemInfo = {
|
|
|
+ ...this.systemInfo,
|
|
|
+ ...res.data
|
|
|
+ }
|
|
|
}
|
|
|
+ return this.systemInfo
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -107,12 +114,7 @@ export default new (class {
|
|
|
*/
|
|
|
private async init(): Promise<typeof this.config> {
|
|
|
this.isPending = true
|
|
|
- await this.systemInfoAsync.then((res) => {
|
|
|
- this.systemInfo = {
|
|
|
- ...this.systemInfo,
|
|
|
- ...res
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
+ await this.systemInfoAsync.catch(() => {
|
|
|
this.systemInfoAsync = this.getAppConfig()
|
|
|
})
|
|
|
return new Promise((resolve, reject) => {
|