/**
* 登录
* tel 手机号
*/
public function login(){
$param=input('param.');
if(!empty($param['tel'])){
if(preg_match("/^1[34578]{1}\d{9}$/",$param['tel'])){
$data=db('people')->where('tel',$param['tel'])->find();
if($data){
session('tid',$data['id']);
return json(['code'=>1,'message'=>'登陆成功']);
}else{
$tel=db('people')->insertGetId(['tel'=>$param['tel']]);
session('tid',$tel);
return json(['code'=>1,'message'=>'登陆成功']);
}
}else{
return json(['code'=>2,'message'=>'手机格式不正确']);
}
}else{
return json(['code'=>3,'message'=>'手机号不能为空']);
}
}
相关文章
- 08-24[转]EasyUI 搭建后台登录界面和管理系统主界面
- 08-24JS逆向山东科技职业学院学生平台登录接口
- 08-24接口测试平台代码实现14:注册功能和后台管理
- 08-24http以及https适配网址接口 后台管理系统
- 08-24[转]vue-element-admin(一)配置后台api接口baseUrl
- 08-24SSO 系统分析、SSO工程搭建、单点登录接口文档分析及Service层接口开发并发布、单点登录检查数据是否可用-Controller层及测试
- 08-24通过DevTools查看后台接口
- 08-24.net后台调用API接口
- 08-24更改joomla后台登录地址增加joomla安全性
- 08-24Vue-element-UI中实现自己接口的登录步骤