| | |
| | | userType: 'admin', |
| | | form: { |
| | | user: "admin", |
| | | password: "admin", |
| | | password: "123456", |
| | | autologin: false |
| | | }, |
| | | rules: { |
| | |
| | | |
| | | |
| | | |
| | | 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, { |
| | |
| | | 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("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", { |
| | |
| | | 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' |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |