From c1bc45fe8fc898b451b52d4f9dd2fc7d01e94878 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 06 十一月 2023 15:13:58 +0800
Subject: [PATCH] 修复点播接口状态判断错误
---
web_src/src/components/Login.vue | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/web_src/src/components/Login.vue b/web_src/src/components/Login.vue
old mode 100644
new mode 100755
index 4ade744..64a3cbd
--- a/web_src/src/components/Login.vue
+++ b/web_src/src/components/Login.vue
@@ -35,6 +35,7 @@
<script>
import crypto from 'crypto'
+import userService from "./service/UserService";
export default {
name: 'Login',
data(){
@@ -66,10 +67,6 @@
//鐧诲綍璇锋眰
toLogin(){
-
- //涓�鑸璺熷悗绔簡瑙e瘑鐮佺殑鍔犲瘑瑙勫垯
- //杩欓噷渚嬪瓙鐢ㄧ殑鍝堝笇绠楁硶鏉ヨ嚜./js/sha1.min.js
-
//闇�瑕佹兂鍚庣鍙戦�佺殑鐧诲綍鍙傛暟
let loginParam = {
username: this.username,
@@ -78,15 +75,21 @@
var that = this;
//璁剧疆鍦ㄧ櫥褰曠姸鎬�
this.isLoging = true;
+ let timeoutTask = setTimeout(()=>{
+ that.$message.error("鐧诲綍瓒呮椂");
+ that.isLoging = false;
+ }, 1000)
this.$axios({
method: 'get',
url:"/api/user/login",
params: loginParam
}).then(function (res) {
- console.log(JSON.stringify(res));
- if (res.data.code == 0 && res.data.msg == "success") {
- that.$cookies.set("session", {"username": that.username,"roleId":res.data.data.role.id}) ;
+ window.clearTimeout(timeoutTask)
+ console.log(res);
+ console.log("鐧诲綍鎴愬姛");
+ if (res.data.code === 0 ) {
+ userService.setUser(res.data.data)
//鐧诲綍鎴愬姛鍚�
that.cancelEnterkeyDefaultAction();
that.$router.push('/');
@@ -99,17 +102,11 @@
});
}
}).catch(function (error) {
+ console.log(error)
+ window.clearTimeout(timeoutTask)
that.$message.error(error.response.data.msg);
that.isLoging = false;
});
- },
- setCookie: function (cname, cvalue, exdays) {
- var d = new Date();
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
- var expires = "expires=" + d.toUTCString();
- console.info(cname + "=" + cvalue + "; " + expires);
- document.cookie = cname + "=" + cvalue + "; " + expires;
- console.info(document.cookie);
},
cancelEnterkeyDefaultAction: function() {
document.onkeydown = function(e) {
--
Gitblit v1.8.0