guoxiaohuan 4 anos atrás
pai
commit
3503c819c3
3 arquivos alterados com 37 adições e 37 exclusões
  1. 4 4
      public/systemConf.js
  2. 31 31
      src/router/index.js
  3. 2 2
      src/store/index.js

+ 4 - 4
public/systemConf.js

@@ -24,11 +24,11 @@ var __systemConf = {
     systemCode: 'wandaBmGuide',
     conf: {
         // 阿里云
-        editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        // editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
+        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
         // http://glsms.wanda-dev.cn/ 测试服
-        // editerUrl: "http://glsms.wanda-dev.cn/wandaEditer/", // 编辑器地址
-        // wandaBmGuideUrl: "http://glsms.wanda-dev.cn/wandaBmGuide/", //管理书地址
+        editerUrl: 'http://glsms.wanda-dev.cn/wandaEditer/', // 编辑器地址
+        wandaBmGuideUrl: 'http://glsms.wanda-dev.cn/wandaBmGuide/', //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 31 - 31
src/router/index.js

@@ -74,37 +74,37 @@ const router = new VueRouter({
 //不需要token的路由
 const ignore = ['/404']
 router.beforeEach(async (to, from, next) => {
-    if (!ignore.includes(to.path)) {
-        const token = query().token
-        const ssoToken = store.getters['ssoToken']
-        if (ssoToken) {
-            store.commit('SETSSOTOKEN', ssoToken)
-            await store.dispatch('getUserInfo', router)
-            await store.dispatch('getFloors')
-            await store.dispatch('getBrand')
-            next()
-        } else if (token) {
-            store.commit('SETSSOTOKEN', token)
-            await store.dispatch('getUserInfo', router)
-            next()
-        } else {
-            let lastRoute = {
-                path: to.path,
-                params: to.params,
-                query: to.query,
-            }
-            store.commit('SETLASTROUTER', lastRoute)
-            let ssoServer = 'http://oauth.wanda-dev.cn'
-            let systemcode = 'CAD156',
-                signal = new Date().getTime(),
-                version = '1.0.0',
-                returnUrl = window.location.protocol + '//' + window.location.host
+    // if (!ignore.includes(to.path)) {
+    //     const token = query().token
+    //     const ssoToken = store.getters['ssoToken']
+    //     if (ssoToken) {
+    //         store.commit('SETSSOTOKEN', ssoToken)
+    //         await store.dispatch('getUserInfo', router)
+    await store.dispatch('getFloors')
+    await store.dispatch('getBrand')
+    //         next()
+    //     } else if (token) {
+    //         store.commit('SETSSOTOKEN', token)
+    //         await store.dispatch('getUserInfo', router)
+    //         next()
+    //     } else {
+    //         let lastRoute = {
+    //             path: to.path,
+    //             params: to.params,
+    //             query: to.query,
+    //         }
+    //         store.commit('SETLASTROUTER', lastRoute)
+    //         let ssoServer = 'http://oauth.wanda-dev.cn'
+    //         let systemcode = 'CAD156',
+    //             signal = new Date().getTime(),
+    //             version = '1.0.0',
+    //             returnUrl = window.location.protocol + '//' + window.location.host
 
-            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-        }
-    } else {
-        next()
-        return
-    }
+    //         window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
+    //     }
+    // } else {
+    next()
+    //     return
+    // }
 })
 export default router

+ 2 - 2
src/store/index.js

@@ -8,8 +8,8 @@ import router from '../router'
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: 'admin:lengqiang',
-        // ssoToken: null,
+        // ssoToken: 'admin:lengqiang',
+        ssoToken: null,
         isPreview: false,
         lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口