瀏覽代碼

登录 超时

natasha 2 年之前
父節點
當前提交
b6549d1d39
共有 2 個文件被更改,包括 22 次插入20 次删除
  1. 17 15
      src/App.vue
  2. 5 5
      src/views/login.vue

+ 17 - 15
src/App.vue

@@ -61,21 +61,23 @@ export default {
       // 是否超时
       isTimeOut(){
         clearInterval(this.timeOut)
-        this.timeOut = setInterval(()=>{
-            let lastClickTime = sessionStorage.getItem('lastClickTime')*1
-            let nowTime = new Date().getTime()
-            let dataConfig = JSON.parse(getConfig());
-            if(nowTime - lastClickTime > 1000 * dataConfig.user_connection_timeout_duration){
-                clearInterval(this.timeOut)
-                removeSession("SysList");
-                removeToken();
-                Cookies.remove("JSESSIONID");
-                this.userShow = false;
-                this.userMessage = null;
-                sessionStorage.removeItem("useragent_root_close");
-                window.location.href = dataConfig.sys_home_url
-            }
-        })
+        let dataConfig = JSON.parse(getConfig());
+        if(dataConfig.user_connection_timeout_duration){
+            this.timeOut = setInterval(()=>{
+                let lastClickTime = sessionStorage.getItem('lastClickTime')*1
+                let nowTime = new Date().getTime()
+                if(nowTime - lastClickTime > 1000 * dataConfig.user_connection_timeout_duration){
+                    clearInterval(this.timeOut)
+                    removeSession("SysList");
+                    removeToken();
+                    Cookies.remove("JSESSIONID");
+                    this.userShow = false;
+                    this.userMessage = null;
+                    sessionStorage.removeItem("useragent_root_close");
+                    window.location.href = dataConfig.sys_home_url
+                }
+            })
+        }
       }
   },
   mounted(){

+ 5 - 5
src/views/login.vue

@@ -65,7 +65,7 @@
                 <img v-if="verificationCodeimg&&verificationCodeLoading" :src="verificationCodeimg" alt="图形验证码" @click="getVerificationCodeimg"/>
             </div>
           </div>
-          <p class="input-title">邮箱验证码</p>
+          <!-- <p class="input-title">邮箱验证码</p>
           <div class="verificationCode-box">
             <el-form-item prop="emailCode">
               <el-input
@@ -81,7 +81,7 @@
                 :class="VerificationCodeShow ? 'waitTime' : 'getVerification'">
                 {{ VerificationCodeShow ? time+'s' : '获取' }}
             </div>
-          </div>
+          </div> -->
           <p class="input-title">用户类型</p>
           <el-form-item class="el-form-item-type" prop="type">
             <el-radio label="TEACHER" v-model="loginForm.type">教师</el-radio>
@@ -214,9 +214,9 @@ export default {
             password: md5(this.loginForm.password).toUpperCase(),
             verification_code_image_text: this.loginForm.verificationCode,
             verification_code_image_id: this.verificationCodeimgID,
-            dynamic_verification_type:'EMAIL',
-            phone_or_email: this.loginForm.username,
-            dynamic_verification_code: this.loginForm.emailCode
+            // dynamic_verification_type:'EMAIL',
+            // phone_or_email: this.loginForm.username,
+            // dynamic_verification_code: this.loginForm.emailCode
           };
           getStaticContent(MethodName, data)
             .then((res) => {