request->params([['code', '']]); $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->login($data['code'])); } /** * 注册 * @return Response */ public function register(){ $data = $this->request->params([ ['openid', ''], [ 'unionid', '' ], ['mobile_code', ''], ['mobile', ''], ]); $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->register($data['openid'], $data['mobile'], $data['mobile_code'], $data[ 'unionid' ])); } public function subscribeMessage(){ $data = $this->request->params([ ['keys', ''] ]); return success((new NoticeService())->getWeappNoticeTemplateId($data['keys'])); } /** * 更新openid * @return Response */ public function updateOpenid() { $data = $this->request->params([ [ 'code', '' ] ]); $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->updateOpenid($data[ 'code' ])); } }