Commit 049550be authored by 崔佳豪's avatar 崔佳豪

fix: 宿主配置容错处理

parent 0d6ade17
Pipeline #66962 passed with stages
......@@ -188,7 +188,7 @@ class Login {
const self = this;
// eslint-disable-next-line no-undef
// 获取网站配置的同时,预先获取到mqtt配置,注册进子应用
Promise.all([
Promise.allSettled([
noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }),
getWebSiteConfig({
client: self.globalConfig.client,
......@@ -197,7 +197,9 @@ class Login {
}),
])
.then(results => {
const res = results[0] || {};
const promise = results[0];
if (promise.status === 'rejected') return results;
const res = promise.value || {};
if (res && res.code === 0) {
const mqttConfig = {
mqtt_mess: {},
......@@ -243,7 +245,7 @@ class Login {
return results;
})
.then(results => {
const response = results[1] ?? {};
const response = results[1]?.value ?? {};
const result =
response && response.code === SERVICE_INTERFACE_SUCCESS_CODE
? Array.isArray(response.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment