fix 修复 用户注册页面与登录页面格式不符问题

feature/model
疯狂的狮子li 2 years ago
parent f55fa60f4d
commit 183af84117

@ -82,8 +82,7 @@ export default {
userId: this.$store.getters.userId, userId: this.$store.getters.userId,
tenantId: undefined, tenantId: undefined,
companyName: undefined, companyName: undefined,
tenantList: [], tenantList: []
userList: []
} }
}, },
components: { components: {

@ -3,14 +3,15 @@
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"> <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">RuoYi-Vue-Plus后台管理系统</h3> <h3 class="title">RuoYi-Vue-Plus后台管理系统</h3>
<el-form-item prop="tenantId"> <el-form-item prop="tenantId">
<el-input <el-select v-model="registerForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%">
v-model="loginForm.tenantId" <el-option
type="text" v-for="item in tenantList"
auto-complete="off" :key="item.tenantId"
placeholder="租户编号" :label="item.companyName"
> :value="item.tenantId">
<svg-icon slot="prefix" icon-class="input" class="el-input__icon input-icon" /> </el-option>
</el-input> <svg-icon slot="prefix" icon-class="company" class="el-input__icon input-icon" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
@ -77,7 +78,7 @@
</template> </template>
<script> <script>
import { getCodeImg, register } from "@/api/login"; import {getCodeImg, register, tenantList} from "@/api/login";
export default { export default {
name: "Register", name: "Register",
@ -119,11 +120,14 @@ export default {
code: [{ required: true, trigger: "change", message: "请输入验证码" }] code: [{ required: true, trigger: "change", message: "请输入验证码" }]
}, },
loading: false, loading: false,
captchaEnabled: true captchaEnabled: true,
//
tenantList:[]
}; };
}, },
created() { created() {
this.getCode(); this.getCode();
this.getTenantList();
}, },
methods: { methods: {
getCode() { getCode() {
@ -135,6 +139,14 @@ export default {
} }
}); });
}, },
getTenantList() {
tenantList().then(res => {
this.tenantList = res.data;
if (this.tenantList != null && this.tenantList.length !== 0) {
this.loginForm.tenantId = this.tenantList[0].tenantId;
}
});
},
handleRegister() { handleRegister() {
this.$refs.registerForm.validate(valid => { this.$refs.registerForm.validate(valid => {
if (valid) { if (valid) {

Loading…
Cancel
Save