This commit is contained in:
张成
2026-04-13 11:54:27 +08:00
parent 992238f352
commit 51ff5d5d65
2 changed files with 6 additions and 17 deletions

View File

@@ -14,13 +14,6 @@
</span> </span>
</Input> </Input>
</FormItem> </FormItem>
<FormItem prop="tenantCode">
<Input v-model="form.tenantCode" placeholder="租户编码,默认 default">
<span slot="prepend">
<Icon :size="14" type="ios-briefcase"></Icon>
</span>
</Input>
</FormItem>
<FormItem> <FormItem>
<Button style="margin-top:20px;" size="large" @click="handleSubmit" type="primary" long>登录</Button> <Button style="margin-top:20px;" size="large" @click="handleSubmit" type="primary" long>登录</Button>
</FormItem> </FormItem>
@@ -47,8 +40,7 @@ export default {
return { return {
form: { form: {
userName: '', userName: '',
password: '', password: ''
tenantCode: 'default'
} }
} }
}, },
@@ -56,8 +48,7 @@ export default {
rules() { rules() {
return { return {
userName: this.userNameRules, userName: this.userNameRules,
password: this.passwordRules, password: this.passwordRules
tenantCode: [{ required: false }]
} }
} }
}, },
@@ -67,8 +58,7 @@ export default {
if (valid) { if (valid) {
this.$emit('on-success-valid', { this.$emit('on-success-valid', {
userName: this.form.userName, userName: this.form.userName,
password: this.form.password, password: this.form.password
tenantCode: (this.form.tenantCode || '').trim() || 'default'
}) })
} }
}) })

View File

@@ -9,7 +9,7 @@
</div> </div>
<div class="login-con"> <div class="login-con">
<Card icon="log-in" title="欢迎登录" style="width:350px;height:300px;" :bordered="false"> <Card icon="log-in" title="欢迎登录" style="width:350px;height:260px;" :bordered="false">
<div class="form-con"> <div class="form-con">
<login-form @on-success-valid="handleSubmit"></login-form> <login-form @on-success-valid="handleSubmit"></login-form>
</div> </div>
@@ -43,12 +43,11 @@ export default {
}, },
methods: { methods: {
...mapActions('user', ['handleLogin']), ...mapActions('user', ['handleLogin']),
async handleSubmit({ userName, password, tenantCode }) { async handleSubmit({ userName, password }) {
try { try {
let userFrom = { let userFrom = {
name: userName, name: userName,
password: password, password: password
tenant_code: tenantCode || 'default'
} }
await this.handleLogin({ await this.handleLogin({
userFrom, userFrom,