1
lzhe
2024-05-17 c7705bbca5b55d25f7862bf9ecee02ce991a983d
1
已修改2个文件
8 ■■■■ 文件已修改
src/utils/request.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/components/passwordForm.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js
@@ -166,6 +166,7 @@
            }).then((response) => {
                resolve(response.data);
            }).catch((error) => {
                resolve(error.data);
                reject(error);
            })
        })
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,
                        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) {