panhui 3 years ago
parent
commit
02d32aa99d
2 changed files with 8 additions and 2 deletions
  1. 1 1
      src/main.js
  2. 7 1
      src/store/index.js

+ 1 - 1
src/main.js

@@ -119,7 +119,7 @@ if (query.code) {
     }
 }
 if (query.companyId) {
-    store.commit('setCompanyId', query.companyId);
+    store.dispatch('getCompanyInfo', query.companyId);
 }
 store.dispatch('getTime');
 if (location.pathname === '/hall') {

+ 7 - 1
src/store/index.js

@@ -21,7 +21,7 @@ export default createStore({
         bankCard: null,
         showRoomId: null,
         platform: '',
-        theme: 'theme3',
+        theme: 'theme1',
         companyId: ''
     },
     mutations: {
@@ -87,6 +87,12 @@ export default createStore({
         }
     },
     actions: {
+        getCompanyInfo(context, companyId) {
+            context.commit('setCompanyId', companyId);
+            return http.http.get('/company/get/' + companyId).then(res => {
+                context.commit('setTheme', res.theme);
+            });
+        },
         getUserInfo(context, refresh) {
             context.dispatch('getBankCard');
             return http.http