|
|
@ -7,7 +7,7 @@ Page({ |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
userName: '',//13000000001
|
|
|
|
mobile: '',//17637262085
|
|
|
|
password: ''//123456
|
|
|
|
}, |
|
|
|
|
|
|
@ -68,7 +68,7 @@ Page({ |
|
|
|
}, |
|
|
|
handleLogin () { |
|
|
|
var that = this; |
|
|
|
if (that.data.userName == '') { |
|
|
|
if (that.data.mobile == '') { |
|
|
|
wx.showToast({ |
|
|
|
title: '请输入用户名', |
|
|
|
icon: 'none', |
|
|
@ -92,11 +92,11 @@ Page({ |
|
|
|
var code = res.code; |
|
|
|
if (code) { |
|
|
|
var params = { |
|
|
|
username: that.data.userName, |
|
|
|
mobile: that.data.mobile, |
|
|
|
password: that.data.password, |
|
|
|
wxCode: code |
|
|
|
}; |
|
|
|
api.userLogin(params).then( (res) =>{ |
|
|
|
api.getToken(params).then( (res) =>{ |
|
|
|
if (res.code == 0) { |
|
|
|
wx.setStorageSync('token', res.data.token); |
|
|
|
wx.setStorageSync('userTagKey', res.data.userTagKey); |
|
|
@ -122,9 +122,9 @@ Page({ |
|
|
|
// getToken(){
|
|
|
|
|
|
|
|
// },
|
|
|
|
getUserName(e) { |
|
|
|
getmobile(e) { |
|
|
|
this.setData({ |
|
|
|
userName: e.detail.value |
|
|
|
mobile: e.detail.value |
|
|
|
}); |
|
|
|
}, |
|
|
|
getPassword (e) { |
|
|
|