| | |
| | | } |
| | | }, |
| | | onLogin: function (){ |
| | | console.log(this.baseHttp + this.baseIP + ':' +this.basePORT + this.baseUrl + '/login.action'); |
| | | if(!this.userName || this.userName.length==0){ |
| | | uni.showToast({title: '请填写账号',icon: "none"}) |
| | | return; |
| | |
| | | return; |
| | | } |
| | | uni.showLoading(); |
| | | |
| | | uni.request({ |
| | | url: this.baseHttp + this.baseIP + ':' +this.basePORT + this.baseUrl + '/login.action', |
| | | data: { |
| | | mobile:this.userName, |
| | | username:this.userName, |
| | | password:md5.hex_md5(this.password) |
| | | }, |
| | | header: { |
| | |
| | | } |
| | | uni.setStorageSync('token', res.data.token); |
| | | setTimeout(() => { |
| | | uni.navigateBack(); // 小程序用这个 把首页路由放第一个 |
| | | // uni.navigateBack(); // 小程序用这个 把首页路由放第一个 |
| | | uni.reLaunch({ |
| | | url: '../index/index' |
| | | }); |