yuanyiming 1 year ago
parent
commit
a33fa67999
2 changed files with 27 additions and 27 deletions
  1. 2 2
      src/config/config.js
  2. 25 25
      src/permission.js

+ 2 - 2
src/config/config.js

@@ -23,8 +23,8 @@ const store = new Vuex.Store({
         // socket: "https://poll.cocorobo.cn",
         // socket: "http://localhost:1473",
         // api: 'http://10.3.16.226:7003/api',//qgt后端
-        // api:'http://10.16.30.130:7003/api',//服务器
-        api: 'http://127.0.0.1:7003/api',
+        api:'http://10.16.30.130:7003/api',//服务器
+        // api: 'http://127.0.0.1:7003/api',
         // api: 'http://10.3.13.84:7003/api',
 
     },

+ 25 - 25
src/permission.js

@@ -41,7 +41,7 @@ router.beforeEach(async(to, from, next) => {
     // set page title
 
     try {
-      throw Error('测试')
+      // throw Error('测试')
         const response = await ajax.get('http://10.16.30.130/sso/api');
         console.log(response);
         let data = response.data.replaceAll("\'", "\"")
@@ -58,33 +58,33 @@ router.beforeEach(async(to, from, next) => {
 
         } else {
             // setToken('2021400203')//yym
-            setToken("201901766");//qgt
-            // setToken("201901763");
-            // setToken('1270')
-            userLogin((isLogin)=>{
-              getSystemState(to,()=>{
-                if(!isLogin&&to.name!='resultShowDetail'){
-                  store.commit('getPlanEndProjectData');
-                }
-                next()
-              })
-            });
-            // window.location.href = "http://10.16.30.130/sso/caslogin.jsp";
+            // setToken("201901766");//qgt
+            // // setToken("201901763");
+            // // setToken('1270')
+            // userLogin((isLogin)=>{
+            //   getSystemState(to,()=>{
+            //     if(!isLogin&&to.name!='resultShowDetail'){
+            //       store.commit('getPlanEndProjectData');
+            //     }
+            //     next()
+            //   })
+            // });
+            window.location.href = "http://10.16.30.130/sso/caslogin.jsp";
         }
     } catch {
         // setToken('2021400203')//yym
-        setToken("201901766");//qgt
-        // setToken("201901763");
-        // setToken('1270')
-        userLogin((isLogin)=>{
-          getSystemState(to,()=>{
-            if(!isLogin&&to.name!='resultShowDetail'){
-              store.commit('getPlanEndProjectData');
-            }
-            next()
-          })
-        });
-        // window.location.href = "http://10.16.30.130/sso/caslogin.jsp";
+        // setToken("201901766");//qgt
+        // // setToken("201901763");
+        // // setToken('1270')
+        // userLogin((isLogin)=>{
+        //   getSystemState(to,()=>{
+        //     if(!isLogin&&to.name!='resultShowDetail'){
+        //       store.commit('getPlanEndProjectData');
+        //     }
+        //     next()
+        //   })
+        // });
+        window.location.href = "http://10.16.30.130/sso/caslogin.jsp";
     }
     // determine whether the user has logged in