lsc vor 6 Monaten
Ursprung
Commit
36ae7ea3ca

+ 0 - 1
dist/css/220.f9f90f2a.css

@@ -1 +0,0 @@
-.loginBox[data-v-445d70f8]{position:relative;width:100vw;height:100vh;overflow:hidden}.loginBox>iframe[data-v-445d70f8]{width:100%;height:100%;border:0}

+ 1 - 0
dist/css/976.87799d5f.css

@@ -0,0 +1 @@
+.loginBox[data-v-0e09c68a]{position:relative;width:100vw;height:100vh;overflow:hidden}.loginBox>iframe[data-v-0e09c68a]{width:100%;height:100%;border:0}

+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.54a29291.js"></script><script defer="defer" src="/js/app.fd75127b.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.b5b59d6e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.54a29291.js"></script><script defer="defer" src="/js/app.9cd4eae9.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.b5b59d6e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

+ 0 - 2
dist/js/220.56599a77.js

@@ -1,2 +0,0 @@
-"use strict";(self["webpackChunkuserManage"]=self["webpackChunkuserManage"]||[]).push([[220],{220:function(e,t,r){r.r(t),r.d(t,{default:function(){return h}});var i=function(){var e=this;e._self._c;return e._m(0)},n=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"loginBox"},[t("iframe",{attrs:{src:"//edu.cocorobo.cn/course/login?type=2",frameborder:"0"}})])}],s=(r(4114),r(3518)),o={name:"LoginPage",data(){return{redirect:void 0,timer:null}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{...(0,s.i0)({login:"user/login"}),handleLogin(){this.$router.push({path:this.redirect||"/"})},async getLogin(){const e=await this.login();e&&this.$router.push({path:this.redirect||"/"})}},beforeDestroy(){clearInterval(this.timer),this.timer=null},mounted(){this.getLogin(),this.timer=setInterval((()=>{this.getLogin()}),2e3)}},a=o,u=r(1656),c=(0,u.A)(a,i,n,!1,null,"445d70f8",null),h=c.exports}}]);
-//# sourceMappingURL=220.56599a77.js.map

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
dist/js/220.56599a77.js.map


+ 2 - 0
dist/js/976.6ff2b0f3.js

@@ -0,0 +1,2 @@
+"use strict";(self["webpackChunkuserManage"]=self["webpackChunkuserManage"]||[]).push([[976],{1976:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var i=function(){var e=this;e._self._c;return e._m(0)},n=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"loginBox"},[t("iframe",{attrs:{src:"//edu.cocorobo.cn/course/login?type=2",frameborder:"0"}})])}],s=(r(4114),r(3518)),o={name:"LoginPage",data(){return{redirect:void 0,timer:null}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{...(0,s.i0)({login:"user/login"}),handleLogin(){this.$router.push({path:this.redirect||"/"})},async getLogin(){const e=this.$store.getters.token;if(e)return void this.$router.push({path:this.redirect||"/"});const t=await this.login();t&&this.$router.push({path:this.redirect||"/"})}},beforeDestroy(){clearInterval(this.timer),this.timer=null},mounted(){this.getLogin(),this.timer=setInterval((()=>{this.getLogin()}),2e3)}},u=o,a=r(1656),h=(0,a.A)(u,i,n,!1,null,"0e09c68a",null),c=h.exports}}]);
+//# sourceMappingURL=976.6ff2b0f3.js.map

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
dist/js/976.6ff2b0f3.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
dist/js/app.9cd4eae9.js


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
dist/js/app.9cd4eae9.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
dist/js/app.fd75127b.js.map


+ 1 - 1
src/permission.js

@@ -12,7 +12,7 @@ router.beforeEach(async (to, from, next) => {
   NProgress.start()
 
   const hasToken = store.getters.token
-
+  debugger
   if (hasToken) {
     if (to.path === '/login') {
       // 如果已登录,重定向到主页

+ 2 - 0
src/store/modules/user.js

@@ -53,6 +53,7 @@ const actions = {
           console.log(response);
           var _user = response.data[0][0];
           commit("SET_ID", _user.userid);
+          commit("SET_TOKEN", _user.userid);
           setToken(_user.userid);
           // dispatch('getInfo')
           resolve(_user.userid);
@@ -60,6 +61,7 @@ const actions = {
         .catch((error) => {
           // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" };
           // commit("SET_ID", _user.userid);
+          // commit("SET_TOKEN", _user.userid);
           // setToken(_user.userid);
           // resolve(_user.userid);
           reject(error);

+ 12 - 6
src/views/login/index.vue

@@ -31,12 +31,18 @@ export default {
       this.$router.push({ path: this.redirect || '/' })
     },
     async getLogin() {
+      // 检查用户是否已登录
+      const hasToken = this.$store.getters.token;
+      if (hasToken) {
+        // 如果已登录,直接重定向
+        this.$router.push({ path: this.redirect || '/' });
+        return;
+      }
 
-      const userid = await this.login()
+      const userid = await this.login();
       if (userid) {
-        this.$router.push({ path: this.redirect || '/' })
+        this.$router.push({ path: this.redirect || '/' });
       }
-      // eduGet().then(res => {})
     }
   },
   beforeDestroy() {
@@ -44,10 +50,10 @@ export default {
     this.timer = null
   },
   mounted() {
-    this.getLogin()
+    this.getLogin();
     this.timer = setInterval(() => {
-      this.getLogin()
-    }, 2000)
+      this.getLogin();
+    }, 2000);
   }
 }
 </script>

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.