From 1cc03d03d9085f59492967a7a3160d95a30bd4e5 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 24 三月 2024 10:47:08 +0800
Subject: [PATCH] update
---
src/views/login/components/passwordForm.vue | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue
index 924bd4b..b0eb9cb 100644
--- a/src/views/login/components/passwordForm.vue
+++ b/src/views/login/components/passwordForm.vue
@@ -20,7 +20,7 @@
userType: 'admin',
form: {
user: "admin",
- password: "admin",
+ password: "123456",
autologin: false
},
rules: {
@@ -94,7 +94,7 @@
- this.$HTTP.postJ("/api/blade-auth/oauth/token",data).then(res=> {
+ await this.$HTTP.postJ("/api/blade-auth/oauth/token",data).then(res=> {
if(res.user_id) {
//鑾峰彇token
this.$TOOL.cookie.set("TOKEN", res.access_token, {
@@ -106,7 +106,19 @@
res.userId = "1";
this.$TOOL.data.set("USER_INFO", res);
//鑾峰彇鑿滃崟
- this.$API.system.menu.myMenus.get().then(resp=> {
+
+
+ }else {
+ this.islogin = false;
+ this.$message({
+ showClose: true,
+ message: res.error_description,
+ type: 'error'
+ });
+ }
+ })
+ await this.$API.system.menu.myMenus.get().then(resp=> {
+ console.log('>>>>>>')
if(resp.data.menu.length==0){
this.islogin = false
this.$alert("褰撳墠鐢ㄦ埛鏃犱换浣曡彍鍗曟潈闄愶紝璇疯仈绯荤郴缁熺鐞嗗憳", "鏃犳潈闄愯闂�", {
@@ -118,21 +130,13 @@
this.$TOOL.data.set("MENU", resp.data.menu)
this.$TOOL.data.set("PERMISSIONS", resp.data.permissions)
this.$TOOL.data.set("DASHBOARDGRID", resp.data.dashboardGrid)
+
});
this.$router.replace({
path: '/'
})
this.$message.success("Login Success 鐧诲綍鎴愬姛")
this.islogin = false
- }else {
- this.islogin = false;
- this.$message({
- showClose: true,
- message: res.error_description,
- type: 'error'
- });
- }
- })
},
}
}
--
Gitblit v1.9.3