调整登录界面
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="login">
|
<section class="login">
|
||||||
<u-form :model="form" ref="loginForm" label-width="140">
|
<u-form :model="form" ref="loginForm" label-width="140" :rules="rules">
|
||||||
<u-form-item label="账号" prop="username">
|
<u-form-item label="账号" prop="username">
|
||||||
<u-input v-model="form.username" placeholder="请输入手机号"/>
|
<u-input v-model="form.username" placeholder="请输入手机号"/>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -37,17 +37,14 @@ export default {
|
|||||||
...mapActions(['getToken']),
|
...mapActions(['getToken']),
|
||||||
...mapMutations(['login']),
|
...mapMutations(['login']),
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.loginForm.validate(v => {
|
this.$refs.loginForm.validate().then(v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
this.getToken(this.form).then(() => {
|
this.getToken(this.form).then(() => {
|
||||||
uni.navigateBack({})
|
uni.navigateBack({})
|
||||||
})
|
}).catch(() => 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => this.$refs.loginForm?.setRules(this.rules))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user