Bladeren bron

修改登录问题

zengyicheng 1 jaar geleden
bovenliggende
commit
292b87d829

+ 1 - 1
dist/index.html

@@ -24,4 +24,4 @@
             height: 100%;
             height: 100%;
             width: 100%;
             width: 100%;
             background: #e6eaf0;
             background: #e6eaf0;
-        }</style><link href=./static/css/app.0a45dc14a8f5001be66c7b6fa82dd12d.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.ecc36c9873dca1dee44b.js></script><script type=text/javascript src=./static/js/app.3b26b548504ed229c811.js></script></body></html><script>document.domain = document.domain.split(".").slice(-2).join(".");</script>
+        }</style><link href=./static/css/app.3ab4d244911edd5f7827c68c80d3cc9b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.ecc36c9873dca1dee44b.js></script><script type=text/javascript src=./static/js/app.fbcd11838698f8d410be.js></script></body></html><script>document.domain = document.domain.split(".").slice(-2).join(".");</script>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.3ab4d244911edd5f7827c68c80d3cc9b.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.3ab4d244911edd5f7827c68c80d3cc9b.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3b26b548504ed229c811.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3b26b548504ed229c811.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fbcd11838698f8d410be.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fbcd11838698f8d410be.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 17 - 17
src/App.vue

@@ -121,29 +121,29 @@ export default {
         this.$store.commit("update", ["isLogin", true]);
         this.$store.commit("update", ["isLogin", true]);
         // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
         // var info = JSON.parse(window.sessionStorage.getItem("userInfo"));
         this.$store.commit("update", ["userInfo", userInfo]);
         this.$store.commit("update", ["userInfo", userInfo]);
-        if (this.$route.path == "/login") {
-          if (userInfo.type == "1") {
+        // if (this.$route.path == "/login") {
+        //   if (userInfo.type == "1") {
             this.$router.push("/eventCenter?steps=" + "2");
             this.$router.push("/eventCenter?steps=" + "2");
-          } else if (userInfo.type == "2" || userInfo.type == "4") {
-            this.$router.push("/anliList");
-          } else if (userInfo.type == "5" || userInfo.type == "6") {
-            this.$router.push("/anliList1");
-          } else if (userInfo.type == "3") {
-            this.$router.push("/anliList2");
-          }
-        }
+        //   } else if (userInfo.type == "2" || userInfo.type == "4") {
+        //     this.$router.push("/anliList");
+        //   } else if (userInfo.type == "5" || userInfo.type == "6") {
+        //     this.$router.push("/anliList1");
+        //   } else if (userInfo.type == "3") {
+        //     this.$router.push("/anliList2");
+        //   }
+        // }
         this.routerP();
         this.routerP();
       } else {
       } else {
         this.$store.commit("update", ["isLogin", false]);
         this.$store.commit("update", ["isLogin", false]);
-        Message({
-          message: "未登录,请登录",
-          type: "warning",
-        });
+        // Message({
+        //   message: "未登录,请登录",
+        //   type: "warning",
+        // });
         setTimeout(() => {
         setTimeout(() => {
           loading.close();
           loading.close();
-          if (this.$route.path != "/login") {
-            this.$router.push("/login");
-          }
+          // if (this.$route.path != "/login") {
+          //   this.$router.push("/login");
+          // }
         }, 2000);
         }, 2000);
       }
       }
     },
     },

+ 9 - 9
src/components/login.vue

@@ -16,7 +16,6 @@ export default {
   },
   },
   methods: {
   methods: {
     login() {
     login() {
-      var _this = this;
       let params = [
       let params = [
         {
         {
           uid: this.userid,
           uid: this.userid,
@@ -24,13 +23,14 @@ export default {
           // sqlpassword: this.sqlPassword,
           // sqlpassword: this.sqlPassword,
         },
         },
       ];
       ];
-      _this.ajax
-        .post(_this.$store.state.api + "loginNewEvenManage", params)
+      this.ajax
+        .post(this.$store.state.api + "loginNewEvenManage", params)
         .then((res) => {
         .then((res) => {
-            _this.$message({
-              message: "登录成功",
-              type: "success",
-            });
+            var _this = this;
+            // _this.$message({
+            //   message: "登录成功",
+            //   type: "success",
+            // });
 
 
             _this.userInfo = res.data[0][0];
             _this.userInfo = res.data[0][0];
             _this.$cookies.set("tlogin", "1", -1);
             _this.$cookies.set("tlogin", "1", -1);
@@ -41,7 +41,7 @@ export default {
             // window.sessionStorage.setItem("userInfo", JSON.stringify(this.userInfo));
             // window.sessionStorage.setItem("userInfo", JSON.stringify(this.userInfo));
             _this.$store.commit("update", ["isLogin", true]);
             _this.$store.commit("update", ["isLogin", true]);
             _this.$store.commit("update", ["userInfo", _this.userInfo]);
             _this.$store.commit("update", ["userInfo", _this.userInfo]);
-            this.$router.push("/eventCenter?steps=" + "1");
+            _this.$router.push("/eventCenter?steps=" + "1");
             // if (res.data[0][0].type == 1 || res.data[0][0].type == 2) {
             // if (res.data[0][0].type == 1 || res.data[0][0].type == 2) {
             //   this.$router.push("/eventCenter?steps=" + "1");
             //   this.$router.push("/eventCenter?steps=" + "1");
             // }
             // }
@@ -61,7 +61,7 @@ export default {
             // console.log(_this.$store.state);
             // console.log(_this.$store.state);
         })
         })
         .catch((err) => {
         .catch((err) => {
-          this.$message.error("登录失败");
+          // this.$message.error("登录失败");
           console.error(err);
           console.error(err);
         });
         });
 
 

+ 40 - 40
src/main.js

@@ -65,44 +65,44 @@ new Vue({
 VueCookies.config('30d')
 VueCookies.config('30d')
 
 
 
 
-router.beforeEach((to, from, next) => {
-    if (to.matched.length === 0) {
-        from.name ? next({
-            name: from.name
-        }) : next('/login');
-    }
-    if (to.meta.title) {
-        document.title = to.meta.title
-    }
-    const requireAuth = to.meta.requireAuth
-        // 判断该路由是否需要登录权限
-    if (requireAuth) {
-        var isLogin = VueCookies.get('tlogin')
-        if (isLogin == "1") {
-            var userinfo = VueCookies.get('teacherInfo')
-            store.commit("update", ["isLogin", true]);
+// router.beforeEach((to, from, next) => {
+//     if (to.matched.length === 0) {
+//         from.name ? next({
+//             name: from.name
+//         }) : next('/login');
+//     }
+//     if (to.meta.title) {
+//         document.title = to.meta.title
+//     }
+//     const requireAuth = to.meta.requireAuth
+//         // 判断该路由是否需要登录权限
+//     if (requireAuth) {
+//         var isLogin = VueCookies.get('tlogin')
+//         if (isLogin == "1") {
+//             var userinfo = VueCookies.get('teacherInfo')
+//             store.commit("update", ["isLogin", true]);
 
 
-            // var info = JSON.parse(window.sessionStorage.getItem("userInfo"))
-            store.commit("update", ["userInfo", userinfo]);
-            store.state.luyou = store.state.luyou + 1
-            store.commit("update", ["luyou", store.state.luyou]);
-            next()
-        } else {
-            const loading = Loading.service({
-                background: "rgba(255, 255, 255)",
-                target: document.querySelector("body"),
-            });
-            store.commit("update", ["isLogin", false]);
-            Message({
-                message: '未登录,请登录',
-                type: 'warning'
-            });
-            setTimeout(() => {
-                loading.close();
-                next('/login')
-            }, 2000);
-        }
-    } else {
-        next() // 确保一定要有next()被调用
-    }
-})
+//             // var info = JSON.parse(window.sessionStorage.getItem("userInfo"))
+//             store.commit("update", ["userInfo", userinfo]);
+//             store.state.luyou = store.state.luyou + 1
+//             store.commit("update", ["luyou", store.state.luyou]);
+//             next()
+//         } else {
+//             const loading = Loading.service({
+//                 background: "rgba(255, 255, 255)",
+//                 target: document.querySelector("body"),
+//             });
+//             store.commit("update", ["isLogin", false]);
+//             // Message({
+//             //     message: '未登录,请登录',
+//             //     type: 'warning'
+//             // });
+//             setTimeout(() => {
+//                 loading.close();
+//                 // next('/login')
+//             }, 2000);
+//         }
+//     } else {
+//         next() // 确保一定要有next()被调用
+//     }
+// })

Some files were not shown because too many files changed in this diff