|
signIn: function() {
if (this.phone == '') {
api.toast({
msg: '请输入手机号码',
duration: 2000,
location: 'middle'
});
return;
}
if (this.password == '') {
api.toast({
msg: '请输入登录密码',
duration: 2000,
location: 'middle'
});
return;
}
let timestamp = (new Date()).getTime();
$.ajax({
type: "post",
url: requestPath + '/technician/Login',
dataType: "json",
data: {
mobile: this.phone,
password: this.password,
time:timestamp
},
success: function(res) {
// console.log(JSON.stringify(res));
if(res.code==10000){
$api.setStorage('token',res.data);
api.openWin({
name: '../index/index_win',
url: './../index/index_win.html',
slidBackEnabled:false
});
api.toast({
msg: res.msg,
duration: 2000,
location: 'middle'
});
} else{
api.toast({
msg: res.msg,
duration: 2000,
location: 'middle'
});
}
},
error: function(res) {
console.log(res);
}
});
}, |
|