diff --git a/frontend/src/views/userLoginReg/Login.vue b/frontend/src/views/userLoginReg/Login.vue index 2131eaebeb2d30168cd1a21e9171c38338bbcc5a..06ffed8bcd294df71341c380fd55a4d4160b89d5 100644 --- a/frontend/src/views/userLoginReg/Login.vue +++ b/frontend/src/views/userLoginReg/Login.vue @@ -102,6 +102,28 @@ >确定 + + 快速选择用户(测试功能) + + + +

快速选择用户

+ + + + + +
+
其他登录方式 @@ -132,6 +154,7 @@ import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha' import { mapActions } from 'vuex' import { getSmsCaptcha, getCaptchaOpen } from '@/api/modular/system/loginManage' import Verify from '@/components/verifition/Verify' +import config from '@/config/defaultSettings' export default { components: { @@ -140,6 +163,20 @@ export default { }, data () { return { + users: [ + { + name: '超级管理员', + username: 'superAdmin', + password: '123456' + }, + { + name: '超级租户1', + username: 'zuohuaijun', + password: '123456' + } + ], + production: config.production, + QuickLoginVisible: false, customActiveKey: 'tab1', loginBtn: false, // login type: 0 email, 1 username, 2 telephone @@ -170,6 +207,26 @@ export default { this.getLocalStorageData() }, methods: { + handleUserBtnClick(user) { + const loginParams = { + account: user.username, + password: user.password + } + + this.Login(loginParams) + .then(res => this.loginSuccess(res)) + .catch(err => this.requestFailed(JSON.stringify(err))) + .finally(() => {}) + }, + QuickLogin() { + this.QuickLoginVisible = true + }, + handleOk() { + this.QuickLoginVisible = false + }, + handleCancel() { + this.QuickLoginVisible = false + }, ...mapActions(['Login', 'Logout', 'dictTypeData']), /** * 获取验证码开关 @@ -334,6 +391,36 @@ export default {