|
|
|
|
@ -9,7 +9,8 @@ |
|
|
|
|
<el-form :model="form" |
|
|
|
|
ref="form" |
|
|
|
|
label-width="80px"> |
|
|
|
|
<el-form-item label="租户编号"> |
|
|
|
|
<el-form-item v-if="tenantMode" |
|
|
|
|
label="租户编号"> |
|
|
|
|
<el-input v-model="form.tenantId" |
|
|
|
|
placeholder="请输入租户编号"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -30,20 +31,22 @@ |
|
|
|
|
placeholder="请输入确认密码"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:loading="loading" |
|
|
|
|
@click="handleRegister">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
import { validatenull } from "@/utils/validate"; |
|
|
|
|
import { validatenull } from "utils/validate"; |
|
|
|
|
import { registerGuest } from "@/api/user"; |
|
|
|
|
import { getTopUrl } from "utils/util"; |
|
|
|
|
import { info } from "@/api/system/tenant"; |
|
|
|
|
import { resetRouter } from "@/router/index"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "thirdRegister", |
|
|
|
|
@ -57,6 +60,7 @@ export default { |
|
|
|
|
password2: '', |
|
|
|
|
}, |
|
|
|
|
loading: false, |
|
|
|
|
tenantMode: true, |
|
|
|
|
accountBox: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
@ -64,14 +68,13 @@ export default { |
|
|
|
|
...mapGetters(["userInfo"]), |
|
|
|
|
}, |
|
|
|
|
created () { |
|
|
|
|
|
|
|
|
|
this.getTenant(); |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
console.log(this.userInfo) |
|
|
|
|
// 若未登录则弹出框进行绑定 |
|
|
|
|
if (validatenull(this.userInfo.userId) || this.userInfo.userId < 0) { |
|
|
|
|
this.form.name = this.userInfo.account; |
|
|
|
|
this.form.account = this.userInfo.account; |
|
|
|
|
if (validatenull(this.userInfo.user_id) || this.userInfo.user_id < 0) { |
|
|
|
|
this.form.name = this.userInfo.user_name; |
|
|
|
|
this.form.account = this.userInfo.user_name; |
|
|
|
|
this.accountBox = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -94,13 +97,14 @@ export default { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.loading = true; |
|
|
|
|
registerGuest(this.form, this.userInfo.oauthId).then(res => { |
|
|
|
|
registerGuest(this.form, this.userInfo.oauth_id).then(res => { |
|
|
|
|
this.loading = false; |
|
|
|
|
const data = res.data; |
|
|
|
|
if (data.success) { |
|
|
|
|
this.accountBox = false; |
|
|
|
|
this.$alert("注册申请已提交,请耐心等待管理员通过!", '注册提示').then(() => { |
|
|
|
|
this.$store.dispatch("LogOut").then(() => { |
|
|
|
|
resetRouter(); |
|
|
|
|
this.$router.push({ path: "/login" }); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
@ -112,6 +116,18 @@ export default { |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getTenant () { |
|
|
|
|
let domain = getTopUrl(); |
|
|
|
|
// 临时指定域名,方便测试 |
|
|
|
|
//domain = "https://bladex.vip"; |
|
|
|
|
info(domain).then(res => { |
|
|
|
|
const data = res.data; |
|
|
|
|
if (data.success && data.data.tenantId) { |
|
|
|
|
this.form.tenantId = data.data.tenantId; |
|
|
|
|
this.tenantMode = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |