| | |
| | | <view> |
| | | <u-form :model="form" ref="uForm" class="form" > |
| | | <u-form-item style="width: 75%;"><u-input color="#fff" v-model="form.name" placeholder="请输入用户名" /></u-form-item> |
| | | <u-form-item style="margin-top: 10px;width: 75%;" ><u-input color="#fff" v-model="form.pwd" type="password" placeholder="请输入密码" /></u-form-item> |
| | | <u-form-item style="margin-top: 10px;width: 75%;" ><u-input color="#fff" v-model="form.pwd" placeholder="请输入密码" /></u-form-item> |
| | | <!-- <view class="loginPsw"> |
| | | <u-checkbox-group > |
| | | <u-checkbox disabled="true"></u-checkbox><text style="color: #fff;">自动登录</text> |
| | |
| | | connectStatus: '未连接', |
| | | registrationID: '未获得', |
| | | isLogining: false, |
| | | psw: true |
| | | } |
| | | }, |
| | | onShow() { |
| | | console.log(this.$u.config.v) |
| | | console.log("数据",uni.getStorageSync('name')) |
| | | if(uni.getStorageSync('name') && uni.getStorageSync('pwd')){ |
| | | // this.form.name = uni.getStorageSync('name'); |
| | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.connect() |
| | | // this.connect() |
| | | }, |
| | | methods: { |
| | | Login(){ |
| | |
| | | login(this.form).then(res => { |
| | | if (res.code === 100) { |
| | | this.isLogining = false; |
| | | //登录成功后 |
| | | //设置别名 |
| | | jpushModule.setAlias({ |
| | | 'alias': this.phone, |
| | | 'sequence': 1 |
| | | }) |
| | | // //登录成功后 |
| | | // //设置别名 |
| | | // jpushModule.setAlias({ |
| | | // 'alias': this.phone, |
| | | // 'sequence': 1 |
| | | // }) |
| | | uni.setStorageSync("name", this.form.name); |
| | | uni.setStorageSync("pwd", this.form.pwd); |
| | | uni.setStorageSync("tk", res.data.tk); |