$request->param('key','') ]; $res = (new CommonService())->getDictionary($where); if(!$res){ return fail('账户信息有误'); } return success($res); } //忘记密码-通过短信验证码进行密码重置(学生/员工通用) public function forgetPassword(Request $request) { $phone = $request->param('phone', '');//手机号 $code = $request->param('code', '');//短信验证码 $code_type = $request->param('code_type', '');//短信验证码类型(发送/验证 短信验证码的类型)|修改密码=editPassword $password = $request->param('password', '');//新密码 $user_type = $request->param('user_type', '');//用户类型|customer=学生|personnel=员工(销售/教师) if (empty($phone) || empty($code) || empty($code_type) || empty($password) || empty($user_type)) { return fail('缺少必填参数'); } //@todo 验证短信验证码是否正确(等发送短信验证码接入后在写) //... //重置密码 $res = (new CommonService())->forgetPassword($phone, $password, $user_type); if(!$res['code']){ return fail($res['msg']); } return success([]); } //获取配置信息 public function getConfig(Request $request){ $config_key = $request->param('config_key', '');//配置项关键字 if (empty($config_key)) { return fail('缺少必填参数'); } $where = [ 'config_key'=>$config_key ]; $res = (new CommonService())->getConfig($where); if (!$res){ return fail('配置信息有误'); } return success($res); } public function getMiniWxOpenId(Request $request){ $code = $request->param('code', '');//微信code if (empty($code)) { return fail('缺少必填参数'); } $res = (new CommonService())->getMiniWxOpenId($code); if (!$res['code']){ return fail($res['msg']); } return success($res['data']); } //获取全部课程列表 public function getCourseAll(Request $request) { $where = []; $res = (new CommonService())->getCourseAllList($where); return success($res); } //获取全部班级列表 public function getClassAll(Request $request) { $where = [ 'status' => $request->param('status', '') ]; $res = (new CommonService())->getClassAllList($where); return success($res); } }