Bladeren bron

开屏页

panhui 3 jaren geleden
bovenliggende
commit
acd0ba722e
2 gewijzigde bestanden met toevoegingen van 21 en 7 verwijderingen
  1. 20 7
      src/main.js
  2. 1 0
      src/store/index.js

+ 20 - 7
src/main.js

@@ -118,9 +118,7 @@ if (query.code) {
         // document.location.replace(location.origin + '/wx/redirect?redirectUrl=' + location.href);
     }
 }
-if (query.companyId || sessionStorage.getItem('companyId')) {
-    store.dispatch('getCompanyInfo', query.companyId || sessionStorage.getItem('companyId'));
-}
+
 store.dispatch('getTime');
 if (location.pathname === '/hall') {
     if (query.id) {
@@ -184,7 +182,10 @@ const loadSplash = (onload, onerror) =>
         setTimeout(() => {
             hideSplash();
         }, 5000);
-        splash.src = 'https://cdn.raex.vip/image/2022-09-26-17-27-00KbwDKZBu.png';
+        if (store.state.companyInfo.bgColor) {
+            splash.src = store.state.companyInfo.bgColor;
+        }
+
         document.body.append(splash);
     });
 if (navigator.userAgent.includes('#review#')) {
@@ -342,9 +343,21 @@ if (navigator.userAgent.includes('#cordova#')) {
         false
     );
 } else {
-    loadSplash().then(res => {
+    if (query.companyId || sessionStorage.getItem('companyId')) {
+        store.dispatch('getCompanyInfo', query.companyId || sessionStorage.getItem('companyId')).then(res => {
+            if (store.state.companyInfo.bgColor) {
+                loadSplash().then(res => {
+                    window.$vm = app.mount('#app');
+                    calcSafeArea();
+                });
+                calcSafeArea();
+            } else {
+                window.$vm = app.mount('#app');
+                calcSafeArea();
+            }
+        });
+    } else {
         window.$vm = app.mount('#app');
         calcSafeArea();
-    });
-    calcSafeArea();
+    }
 }

+ 1 - 0
src/store/index.js

@@ -98,6 +98,7 @@ export default createStore({
                 context.commit('setTheme', res.theme);
                 context.commit('setCompanyInfo', res);
                 document.title = res.name;
+                return Promise.resolve(res);
             });
         },
         getUserInfo(context, refresh) {