~~~[api]
post:http://thinkcmf/api/user/public/login
*string:username=18903467858#用户名(手机或邮箱)
string:password=hw0203516633#密码
string:device_type=pc#设备类型;可选值:mobile,android,iphone,ipad,web,pc,mac,wxapp
<<<
success
{
"code":1,
"msg":"登录成功!",
"data":{
"token":"3588d613a61a1bf6f208173f980741c0"
}
}
<<<
error
{
"code":0,
"msg":"密码不正确!",
"data":""
}
~~~
# 小程序代码
```
api.post({
url: 'user/public/login',
data: {
username: '15121002429',
password:'123456',
device_type:'wxapp'
},
success: data => {
if (data.code == 1) {
// 成功
}
if (data.code == 0) {
// 失败
}
console.log(data);
}
});
```
