| | |
| | | } = res.data |
| | | if (count == 1) { |
| | | enableCollectMissingKey = true |
| | | return data |
| | | let getRemoteFile = true |
| | | if (!res.data.EnableRemoteI18n || res.data.EnableRemoteI18n == 'N') { |
| | | // 判断服务器是否启用多语言配置项,无该配置项或者不启用配置项,则不收集缺失字符串,使用本地翻译文件 |
| | | enableCollectMissingKey = false |
| | | getRemoteFile = false |
| | | } |
| | | return { |
| | | data: data, |
| | | getRemoteFile: getRemoteFile |
| | | } |
| | | } else { |
| | | enableCollectMissingKey = false |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: "[i18n]获取语言包失败: " + Message |
| | | }) |
| | | return |
| | | return { |
| | | data: [], |
| | | getRemoteFile: false |
| | | } |
| | | } |
| | | } catch (err) { |
| | | enableCollectMissingKey = false |
| | |
| | | MissingKeysMap[key] = Array.from(MissingKeysMap[key]) |
| | | } |
| | | } |
| | | CommonUtils.doRequest2Sync({ |
| | | await CommonUtils.doRequest2Sync({ |
| | | url: "/Xt_grdAlignment_WMES/syncMissingKeyToDB", |
| | | data: { |
| | | missingObj: JSON.stringify(MissingKeysMap) |
| | |
| | | }) |
| | | // 清除缺失字段缓存 |
| | | MissingKeysMap = {} |
| | | |
| | | uni.hideLoading() |
| | | // 重启应用 |
| | | const systemInfo = uni.getSystemInfoSync(); |
| | | const platform = systemInfo.platform; |
| | | |
| | | if (platform === 'ios' || platform === 'android') { |
| | | // App 端:完全重启 |
| | | plus.runtime.restart(); |
| | | } else if (platform === 'h5') { |
| | | // H5 端:刷新页面 |
| | | window.location.reload(); |
| | | } |
| | | // #ifdef APP-PLUS |
| | | // App 端:完全重启 |
| | | plus.runtime.restart(); |
| | | // #endif |
| | | // #ifdef H5 |
| | | console.log('H5回到登录页: '); |
| | | uni.reLaunch({ |
| | | url: '/pages/index/login' |
| | | }) |
| | | // #endif |
| | | } |