This commit is contained in:
xd 2024-05-16 16:34:43 +08:00
parent 17720a24bc
commit 447880ef21
1 changed files with 18 additions and 8 deletions

View File

@ -27,8 +27,8 @@
<el-dialog :title="switchAccountTitle" :visible.sync="switchAccountOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="账号" prop="Name">
<el-form ref="form" :model="form":rules="rules" label-width="100px">
<el-form-item label="账号" prop="account">
<el-input v-model="form.account" placeholder="请输入账号" clearable/>
</el-form-item>
</el-form>
@ -85,7 +85,13 @@ export default {
switchAccountTitle: "",
//
switchAccountOpen: false,
form: {}
form: {},
//
rules: {
account: [
{required: true, message: "账号不能为空", trigger: "blur"}
]
}
}
},
components: {
@ -128,11 +134,15 @@ export default {
this.switchAccountTitle = "账号切换";
this.switchAccountOpen = true;
},
switchAccountConfirm(account){
// OA-token
getSwitchAccountToken(account).then(response => {
this.switchAccountOpen = false;
window.open('http://localhost:3335/ssoLogin?loginid='+account+'&token='+response.token, '_self');
switchAccountConfirm(account) {
this.$refs["form"].validate(valid => {
if (valid) {
// OA-token
getSwitchAccountToken(account).then(response => {
this.switchAccountOpen = false;
window.open('http://localhost:3335/ssoLogin?loginid=' + account + '&token=' + response.token, '_self');
})
}
})
},
toggleSideBar() {