|
@@ -10,7 +10,7 @@ use think\Cache;
|
|
use app\common\library\UUIDs;
|
|
use app\common\library\UUIDs;
|
|
use app\common\library\Verify;
|
|
use app\common\library\Verify;
|
|
use think\Validate;
|
|
use think\Validate;
|
|
-use app\common\library\AliyunSms;
|
|
|
|
|
|
+use app\common\library\send_message;
|
|
|
|
|
|
class Login extends Controller
|
|
class Login extends Controller
|
|
{
|
|
{
|
|
@@ -74,7 +74,7 @@ class Login extends Controller
|
|
return json_encode(['status'=>'fail','code'=>'1101','msg'=>'密码不能为空']);
|
|
return json_encode(['status'=>'fail','code'=>'1101','msg'=>'密码不能为空']);
|
|
}
|
|
}
|
|
//医生信息
|
|
//医生信息
|
|
- $info = DB::table('doctors')->where('username',$param['userName'])->field('message_push,id,exam_class,attachment,username,password,login_time,login_failure,realname,email,phone,doctor_title,institution_id,department_id,doctor_role,is_report')->find();
|
|
|
|
|
|
+ $info = DB::table('doctors')->where('username',$param['userName'])->field('is_send_message,is_admin,message_push,id,exam_class,attachment,username,password,login_time,login_failure,realname,email,phone,doctor_title,institution_id,department_id,doctor_role,is_report')->find();
|
|
log::record($info);
|
|
log::record($info);
|
|
if(!$info){
|
|
if(!$info){
|
|
return json_encode(['status'=>'fail','code'=>'1004','msg'=>'用户名'.$param['userName'].'或密码错误']);
|
|
return json_encode(['status'=>'fail','code'=>'1004','msg'=>'用户名'.$param['userName'].'或密码错误']);
|
|
@@ -113,7 +113,41 @@ class Login extends Controller
|
|
}catch(\Exception $e){
|
|
}catch(\Exception $e){
|
|
return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //发送短信
|
|
|
|
+ public function send_message()
|
|
|
|
+ {
|
|
|
|
+ try{
|
|
|
|
+ $sessionid = $_REQUEST['sessionid'];
|
|
|
|
+ $doctor = Cache::get($sessionid);
|
|
|
|
+ $phone = $doctor['phone'];
|
|
|
|
+ $code = rand('1000','9999');
|
|
|
|
+ Cache::set($phone,$code,600);
|
|
|
|
+ $info = send_message::sendSms2UpDate($phone,$code);
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid]);
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
+ return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function check_code()
|
|
|
|
+ {
|
|
|
|
+ try{
|
|
|
|
+ $sessionid = $_REQUEST['sessionid'];
|
|
|
|
+ $doctor = Cache::get($sessionid);
|
|
|
|
+ $check_phone = $doctor['phone'];
|
|
|
|
+ $code = Cache::get($check_phone);
|
|
|
|
+ $number =$_REQUEST['code'];
|
|
|
|
+ if($code == $number){
|
|
|
|
+ return json_encode(['status'=>'ok','code'=>'0000','msg'=>'验证成功','sessionid'=>$sessionid]);
|
|
|
|
+ }else{
|
|
|
|
+ return json_encode(['status'=>'fail','code'=>'0090','msg'=>' 错误的验证码','sessionid'=>$sessionid]);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }catch(\Exception $e){
|
|
|
|
+ return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//注册功能
|
|
//注册功能
|
|
@@ -157,42 +191,4 @@ class Login extends Controller
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public function send_message(){
|
|
|
|
- // $response = AliyunSms::sendSms('18246195584', '中世康恺','SMS_153325044',array("name" => "", "time" => "12:00"));
|
|
|
|
- // var_dump($response);
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * 向上级医师发送[远程诊断申请]短信
|
|
|
|
- * 亲爱的${name}医生您好!收到新的${type},请您及时于${time}前登录系统处理
|
|
|
|
- * @param {string} phone 手机号码
|
|
|
|
- * @param {string} time 时间
|
|
|
|
- * @param {string} name 姓名(姓)
|
|
|
|
- */
|
|
|
|
- // AliyunSms::sendSms2Apply($phone, $time=, $name=);
|
|
|
|
- liyunSms::sendSms2Apply("13763459789", '12:00', '刘');
|
|
|
|
- /*
|
|
|
|
- * 向下级医师发送[远程诊断申请被驳回]短信
|
|
|
|
- * 很抱歉,您发起的远程诊断申请被驳回,请您及时处理后重新发起申请。驳回原因:${description}
|
|
|
|
- * @param {string} description 驳回理由
|
|
|
|
- */
|
|
|
|
- // AliyunSms::sendSms2RejectApply($phone, $description);
|
|
|
|
- liyunSms::sendSms2RejectApply("13763459789", '申请单描述信息不全');
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * 向下级医院发送[远程诊断报告已经被写完]短信
|
|
|
|
- * 您发起的远程诊断申请已由${doctor}医师完成,请您登录系统查看
|
|
|
|
- * @param {string} doctor 医生
|
|
|
|
- */
|
|
|
|
- // AliyunSms::sendSms2CompleteReport($phone, $doctor);
|
|
|
|
- AliyunSms::sendSms2CompleteReport("13763459789", "301医师集团刘桂岩");
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * 发送[内部通知]短信
|
|
|
|
- * 通知: 类型:${type} 内容:${content}
|
|
|
|
- * @param {string} type 通知类型
|
|
|
|
- * @param {string} content 通知内容
|
|
|
|
- */
|
|
|
|
- // AliyunSms::sendSms2Self($phone, $type, $content);
|
|
|
|
- AliyunSms::sendSms2Self("13763459789", "发起申请", "魏庙xx医院xx医师向301医师集团刘xx医师发起了远程诊断申请,申请单idxxx");
|
|
|
|
- }
|
|
|
|
}
|
|
}
|