gaoshp
2024-03-25 b8694d86aea1a9154af99ee3e67ce4e6114aa091
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'
                    });
               }
            })
         },
      }
   }