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