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