From fae941098d1cb83ee48b94c7af403244bbd76a6b Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期五, 17 五月 2024 16:42:04 +0800
Subject: [PATCH] 1

---
 src/views/login/components/passwordForm.vue |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue
index 380479c..4bd9d3a 100644
--- a/src/views/login/components/passwordForm.vue
+++ b/src/views/login/components/passwordForm.vue
@@ -65,8 +65,11 @@
 				grant_type: "password",
 				scope: "all"
 			}
+			var isToken = false;
 			await this.$HTTP.postJ("/api/blade-auth/oauth/token?" + this.$TOOL.qsStringify(data)).then(res => {
+				this.islogin = false;
 				if (res.user_id) {
+					isToken = true;
 					//鑾峰彇token
 					this.$TOOL.cookie.set("TOKEN", res.access_token, {
 						expires: this.form.autologin ? 24 * 60 * 60 : 0
@@ -76,15 +79,15 @@
 					res.dashboard = "0";
 					res.userId = "1";
 					this.$TOOL.data.set("USER_INFO", res);
-					this.islogin = false;
 				} else {
 					this.$message({
 						showClose: true,
-						message: res.error_description,
+						message: res.msg || res.error_description,
 						type: 'error'
 					});
 				}
 			})
+			if(!isToken) return;
 			//鑾峰彇鑿滃崟
 			await this.$HTTP.get("/api/blade-system/menu/routes?" + this.$TOOL.qsStringify({ "appCode": "CPS" })).then(res => {
 				if (res.data.length == 0) {
@@ -141,7 +144,7 @@
 							permissions: ["list.add", "list.edit", "list.delete", "user.add", "user.edit", "user.delete"]
 						}
 						this.$TOOL.data.set("MENU", obj.menu);
-						console.log(obj.menu,289)
+						console.log(obj.menu,'menu')
 						this.$TOOL.data.set("PERMISSIONS", obj.permissions)
 						this.$TOOL.data.set("DASHBOARDGRID", obj.dashboardGrid)
 

--
Gitblit v1.9.3