Jelajahi Sumber

xxd 修改集团首页交互问题

fujunwen 4 tahun lalu
induk
melakukan
1369ee7fb1
2 mengubah file dengan 41 tambahan dan 41 penghapusan
  1. 1 1
      src/api/homePage.js
  2. 40 40
      src/router/index.js

+ 1 - 1
src/api/homePage.js

@@ -7,7 +7,7 @@ export function getCardList({ getParams }) {
 
  // 综合事项记录
 export function getQueryList({ getParams }) {
-    return httputils.getJson(`/data/v_glsms_zhsxjl/query`, getParams)
+    return httputils.getJson(`/data/sms_zhsxjl/query`, getParams)
 }
 
 // 说明书变更记录

+ 40 - 40
src/router/index.js

@@ -5,10 +5,10 @@ import { query } from '@/utils/query'
 
 Vue.use(VueRouter)
 const routes = [
-    {
-        path: '/',
-        redirect: '/home/overview',        // 只有区域,及区域以上用户才能进入总部首页这一套
-    },
+    // {
+    //     path: '/',
+    //     redirect: '/home/overview',        // 只有区域,及区域以上用户才能进入总部首页这一套
+    // },
     {
         path: '/404',
         component: () => import('../components/404'),
@@ -72,40 +72,40 @@ const router = new VueRouter({
     routes,
 })
 //不需要token的路由
-// const ignore = ['/404', '/home/legendLibrary', '/home/legendRules']
-// router.beforeEach(async (to, from, next) => {
-//     if (!ignore.includes(to.path)) {
-//         const token = store.getters['ssoToken'] || query().token
-//         if (token) {
-//             store.commit('SETSSOTOKEN', token)
-//             if (to.path == '/') {
-//                 next('/group')
-//             }
-//             if (to.path == '/group' || to.path == '/home/homepage') {
-//                 if (store.state.accessLevel == -1) {
-//                     await store.dispatch('getUserInfo', router)
-//                     await store.dispatch('getBrand')
-//                 }
-//             }
-//             await store.dispatch('getFloors')
-//             await store.dispatch('getBrand')
-//             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'
-//             window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-//         }
-//     } else {
-//         next()
-//         return
-//     }
-// })
+const ignore = ['/404', '/home/legendLibrary', '/home/legendRules']
+router.beforeEach(async (to, from, next) => {
+    if (!ignore.includes(to.path)) {
+        const token = store.getters['ssoToken'] || query().token
+        if (token) {
+            store.commit('SETSSOTOKEN', token)
+            if (to.path == '/') {
+                next('/group')
+            }
+            if (to.path == '/group' || to.path == '/home/homepage') {
+                if (store.state.accessLevel == -1) {
+                    await store.dispatch('getUserInfo', router)
+                    await store.dispatch('getBrand')
+                }
+            }
+            await store.dispatch('getFloors')
+            await store.dispatch('getBrand')
+            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'
+            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
+        }
+    } else {
+        next()
+        return
+    }
+})
 export default router