更新
This commit is contained in:
parent
f3e72ea43c
commit
e5c6e235ae
@ -150,8 +150,10 @@ export class socialBindLogin {
|
|||||||
|
|
||||||
export function getUserTenant(data) {
|
export function getUserTenant(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/auth/getTenant',
|
url: '/system/auth/getListByPhone',
|
||||||
method: 'post',
|
method: 'get',
|
||||||
data: data
|
params: {
|
||||||
|
phone: data
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="showTenantList"
|
||||||
|
width="30%">
|
||||||
|
<el-radio-group v-model="tenant">
|
||||||
|
<el-radio-button :label="item" v-for="item in tenantList">{{item.name}}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="showTenantList = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="selectTenant">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 图形验证码 -->
|
<!-- 图形验证码 -->
|
||||||
<Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{width:'400px',height:'200px'}"
|
<Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{width:'400px',height:'200px'}"
|
||||||
@ -136,6 +148,8 @@ export default {
|
|||||||
// tenantCode:"lighting",
|
// tenantCode:"lighting",
|
||||||
tenantCode:"lanan",
|
tenantCode:"lanan",
|
||||||
codeUrl: "",
|
codeUrl: "",
|
||||||
|
showTenantList:false,
|
||||||
|
tenant:undefined,
|
||||||
//是否开启图形验证码
|
//是否开启图形验证码
|
||||||
captchaEnable: false,
|
captchaEnable: false,
|
||||||
tenantEnable: true,
|
tenantEnable: true,
|
||||||
@ -150,6 +164,7 @@ export default {
|
|||||||
rememberMe: false,
|
rememberMe: false,
|
||||||
tenantName: "租户管理员",
|
tenantName: "租户管理员",
|
||||||
},
|
},
|
||||||
|
tenantList:[],
|
||||||
scene: 21,
|
scene: 21,
|
||||||
|
|
||||||
LoginRules: {
|
LoginRules: {
|
||||||
@ -221,7 +236,8 @@ export default {
|
|||||||
getCode() {
|
getCode() {
|
||||||
// 情况一,未开启:则直接登录
|
// 情况一,未开启:则直接登录
|
||||||
if (!this.captchaEnable) {
|
if (!this.captchaEnable) {
|
||||||
this.handleLogin({})
|
// this.handleLogin({})
|
||||||
|
this.getTenantList()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,6 +258,14 @@ export default {
|
|||||||
tenantName: tenantName ? tenantName : this.loginForm.tenantName,
|
tenantName: tenantName ? tenantName : this.loginForm.tenantName,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
selectTenant(){
|
||||||
|
if (!this.tenant) {
|
||||||
|
this.$message.error("请选择租户")
|
||||||
|
}
|
||||||
|
console.log('当前租户',this.tenant)
|
||||||
|
setTenantId(this.tenant.id)
|
||||||
|
this.handleLogin()
|
||||||
|
},
|
||||||
handleLogin(captchaParams) {
|
handleLogin(captchaParams) {
|
||||||
this.$refs.loginForm.validate(async valid => {
|
this.$refs.loginForm.validate(async valid => {
|
||||||
console.log("登录", this.loginForm)
|
console.log("登录", this.loginForm)
|
||||||
@ -259,12 +283,11 @@ export default {
|
|||||||
removeRememberMe()
|
removeRememberMe()
|
||||||
removeTenantName()
|
removeTenantName()
|
||||||
}
|
}
|
||||||
this.loginForm.captchaVerification = captchaParams.captchaVerification
|
if (captchaParams){
|
||||||
|
this.loginForm.captchaVerification = captchaParams.captchaVerification
|
||||||
|
}
|
||||||
//获取当前登陆人的租户
|
//获取当前登陆人的租户
|
||||||
await getUserTenant(this.loginForm).then(res => {
|
|
||||||
console.log('当前登陆人信息', res)
|
|
||||||
setTenantId(res.data.tenant_id)
|
|
||||||
});
|
|
||||||
// 发起登陆
|
// 发起登陆
|
||||||
// console.log("发起登录", this.loginForm);
|
// console.log("发起登录", this.loginForm);
|
||||||
this.$store.dispatch(this.loginForm.loginType === "sms" ? "SmsLogin" : "Login", this.loginForm).then(() => {
|
this.$store.dispatch(this.loginForm.loginType === "sms" ? "SmsLogin" : "Login", this.loginForm).then(() => {
|
||||||
@ -276,6 +299,14 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async getTenantList(){
|
||||||
|
await getUserTenant(this.loginForm.username).then(res => {
|
||||||
|
console.log('当前登陆人信息', res)
|
||||||
|
// setTenantId(res.data.tenant_id)
|
||||||
|
this.tenantList = res.data
|
||||||
|
});
|
||||||
|
this.showTenantList = true
|
||||||
|
},
|
||||||
async doSocialLogin(socialTypeEnum) {
|
async doSocialLogin(socialTypeEnum) {
|
||||||
// 设置登录中
|
// 设置登录中
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user