| | |
| | | <u-form-item label="用户名" labelWidth=65 prop="userInfo.account" borderBottom> |
| | | <u--input v-model="userInfo.account" border="none" placeholder="请输入用户名"></u--input> |
| | | </u-form-item> |
| | | <u-form-item label="密码" labelWidth=65 prop="userInfo.passward"> |
| | | <u--input v-model="userInfo.passward" placeholder="请输入用户密码" border="none" :password="showPassward" |
| | | <u-form-item label="密码" labelWidth=65 prop="userInfo.password"> |
| | | <u--input v-model="userInfo.password" placeholder="请输入用户密码" border="none" :password="showPassward" |
| | | @click="this.showPassward = !this.showPassward " suffixIcon="eye-fill" |
| | | suffixIconStyle="color: #909399"></u--input> |
| | | </u-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | login |
| | | } from '../../api/login' |
| | | export default { |
| | | data() { |
| | | return { |
| | | showPassward: true, |
| | | userInfo: { |
| | | account: '', |
| | | passward: '' |
| | | password: '' |
| | | } |
| | | } |
| | | }, |
| | |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (this.userInfo.passward == null || this.userInfo.passward == '') { |
| | | |
| | | if (this.userInfo.password == null || this.userInfo.password == '') { |
| | | this.$refs.uToast.show({ |
| | | message: '密码为空', |
| | | type: 'error' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | |
| | | |
| | | console.log(this.userInfo) |
| | | |
| | | uni.navigateTo({ |
| | | url:'/pages/index/index' |
| | | login(this.userInfo.account, this.userInfo.password).then(response => { |
| | | console.log(response) |
| | | if (!response.result) { |
| | | this.$refs.uToast.show({ |
| | | message: response.msg, |
| | | type: 'error' |
| | | }) |
| | | return |
| | | } |
| | | uni.navigateTo({ |
| | | url:'/pages/index/index' |
| | | }) |
| | | }) |
| | | |
| | | |
| | | } |
| | | } |
| | | } |