From c7ec9e17f6e48335912bad1c07df56ba8eb8f662 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期四, 05 五月 2022 13:35:21 +0800 Subject: [PATCH] page subuser --- src/views/login/components/loginForm.vue | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/views/login/components/loginForm.vue b/src/views/login/components/loginForm.vue index 4d36a4e..b1ac15a 100644 --- a/src/views/login/components/loginForm.vue +++ b/src/views/login/components/loginForm.vue @@ -104,7 +104,12 @@ </template> <script> -import { tologin, getLoginUserData, getVerifyCode } from "@/api/login"; +import { + tologin, + getLoginUserData, + makeVerifyCode, + getMenuPermission, +} from "@/api/login"; import { isPhone } from "@/scripts/validate"; export default { @@ -234,7 +239,7 @@ this.codeDisabled = true; this.getValidStr(); this.timer = setInterval(this.getValidStr, 1000); - getVerifyCode({ phoneNum: this.phone.phoneNum }) + makeVerifyCode({ phoneNum: this.phone.phoneNum, type:0 }) .then(() => { this.gotCode = true; }) @@ -263,7 +268,6 @@ async testLogin(param) { tologin(param) .then((res) => { - console.log("--------"); const data = res.data; const loginedInfo = { access_token: data.token_type + " " + data.access_token, @@ -271,10 +275,13 @@ }; sessionStorage.setItem("expires_in", data.expires_in); sessionStorage.setItem("loginedInfo", JSON.stringify(loginedInfo)); - sessionStorage.setItem("userInfo", JSON.stringify(data.userInfo)); - this.loading.close(); - this.$router.push("/"); + getMenuPermission().then((rep) => { + data.userInfo.permissions = rep.data.permissions; + sessionStorage.setItem("userInfo", JSON.stringify(data.userInfo)); + this.$router.push("/"); + }); + this.loading.close(); }) .catch((err) => { this.loading.close(); -- Gitblit v1.8.0