var _data = {
mobileTel: val,
smsCode: code
};
var data = {
_data: encodeURIComponent(base64.encode(JSON.stringify(_data)))
}
$.ajax({
data:data
})
密码
var _data = {
mobileTel: this.mobileTel,
password: hex_md5(this.password).toLowerCase()//密码在这里要进行md5加密
};
var data = {
_data: encodeURIComponent(base64.encode(JSON.stringify(_data)))
}
//加密解密
var _data = {
mobileTel: this.mobileTel,
password: hex_md5(this.password).toLowerCase()
};
var data = {
_data: encodeURIComponent(base64.encode(JSON.stringify(_data)))
}
ajax.user.post('/api/v1/web/user/login.htm', data)
.then(function (resp) {
vue.$indicator.close();
if(resp.data.returnCode == 200){
vue.toast('登陆成功', -1);
var userInfo = JSON.parse(base64.decode(resp.data.data));
sessionStorage.setItem('token', userInfo.token);
sessionStorage.setItem('userId', userInfo.oid);
sessionStorage.setItem('mobile', userInfo.mobileTel);
location.href = '../home/index.html';
}
else{
vue.toast(resp.data.msg);
}
}).catch(function (error) {
vue.$indicator.close();
});
网友评论