企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
## 登录 ### 1.接口地址 +++ post:http://www.dakaifa.net/index.php?g=App&m=Login&a=index *int:name=13834626385#手机号 *int:password=123#密码 <<< success { "id": "111", "user_login": "张天", "user_pass": "###324029ce02bf4cf80bb06c95e2c5326a", "user_nicename": "张天", "user_email": "", "user_url": "", "avatar": "http://dakaifa.net/data/upload/avatar/57b683b09d109.jpg", "sex": "0", "birthday": "1989-01-01", "signature": "擅长发热,头痛,咳嗽等", "last_login_ip": "221.205.231.136", "last_login_time": "2016-08-02 15:26:46", "create_time": "2016-07-22 14:34:39", "user_activation_key": "", "user_status": "1", "score": "0", "user_type": "3", "coin": "0", "mobile": "13834626385", "address": "理工大社区", "region": "安庆", "stature": "178", "weight": "60", "user_token": "kz2k2d7j4VKKVfw1U3yki7b68JCj0dfkGOlXu2QVJ4d4/ec8X1zexk+3kPt7LDSlPckOc2bsEv4=", "ap_avatar": "57b683e2d2b6b.jpg", "identity": null, "msg": 1 } <<< error { "msg": "0" } +++ ### 2.接口代码 ``` public function index() { $name = json_decode($_POST['name']); $password = json_decode($_POST['password']); $map['mobile'] = $name; $map['user_pass'] = sp_password($password); $users = M("Users"); $model = $users->where($map)->find(); if (!$model) { $json = '{"msg":"0"}'; echo $json; }else{ $model['avatar']= "http://".$_SERVER['SERVER_NAME'] . "/data/upload/avatar/". $model['avatar']; $model['msg']=1; $json = json_encode($model); echo $json; } } ```