12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace App\Http\Controllers;
- use Dingo\Api\Routing\Helpers;
- use Illuminate\Support\Facades\Log;
- use Laravel\Lumen\Routing\Controller as BaseController;
- class Controller extends BaseController
- {
- use Helpers;
- // 返回错误的请求
- protected function errorBadRequest($msg)
- {
- $this->response->errorBadRequest($msg);
- }
- /**
- * 验证错误
- * @param $msg
- * User: Mead
- */
- protected function errorNoValidation($msg, $code = 422)
- {
- Log::error($msg);
- $this->response->error($msg, $code);
- }
- /**
- * 验证错误
- * @param $msg
- * User: Mead
- */
- protected function errorNoYundong($msg)
- {
- $this->response->error($msg, 450);
- }
- /**
- * 异常错误
- * @param $msg
- * User: Mead
- */
- protected function errorException($msg)
- {
- Log::error($msg);
- $this->response->error($msg, 423);
- }
- /**
- * 获取当前登录的用户的openid
- * @return mixed
- * User: Mead
- */
- protected function getOpenId()
- {
- return $this->user->auth->credential;
- }
- }
|