Commit 043d65fc authored by zhoujun's avatar zhoujun

调试图片

parent 2f57c012
...@@ -7,6 +7,7 @@ use Psy\Exception\ErrorException; ...@@ -7,6 +7,7 @@ use Psy\Exception\ErrorException;
use Illuminate\Database\QueryException; use Illuminate\Database\QueryException;
use Exception; use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use App\Services\UtilService;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
...@@ -39,6 +40,9 @@ class Handler extends ExceptionHandler ...@@ -39,6 +40,9 @@ class Handler extends ExceptionHandler
*/ */
public function report(Exception $exception) public function report(Exception $exception)
{ {
$message = '【'.date('Y-m-d H:i:s').'】生涯明信片项目:'.$exception->getMessage();
$submitData = ['mobile_list'=>config('sign.DINGDING_PHONE'),'message'=>$message,'api_token'=>config('sign.DINGDING_TOKEN')];
UtilService::postCurlJson(config('sign.DINGDING_URL'),$submitData,[]);
parent::report($exception); parent::report($exception);
} }
...@@ -65,7 +69,6 @@ class Handler extends ExceptionHandler ...@@ -65,7 +69,6 @@ class Handler extends ExceptionHandler
return redirect(route('index')); return redirect(route('index'));
} }
return parent::render($request, $exception); return parent::render($request, $exception);
} }
} }
...@@ -278,7 +278,6 @@ class CardController extends Controller ...@@ -278,7 +278,6 @@ class CardController extends Controller
*/ */
public function getUploadImg(Request $request) public function getUploadImg(Request $request)
{ {
Log::info("请求日志:上传图片" , []);
$userId = $request->session()->get("uid"); $userId = $request->session()->get("uid");
$roleId = $request->input('roleId'); $roleId = $request->input('roleId');
$serverId = $request->input('serverId'); $serverId = $request->input('serverId');
...@@ -334,7 +333,6 @@ class CardController extends Controller ...@@ -334,7 +333,6 @@ class CardController extends Controller
*/ */
public function getCardHtml(Request $request) public function getCardHtml(Request $request)
{ {
Log::info("请求日志:测试" , []);
$userId = $request->session()->get("uid"); $userId = $request->session()->get("uid");
$result = $this->getVerityLogin($userId); $result = $this->getVerityLogin($userId);
if($result['code'] != 200) return $this->jsonReturn($result['code'], $result['msg']); if($result['code'] != 200) return $this->jsonReturn($result['code'], $result['msg']);
......
...@@ -202,4 +202,28 @@ class UtilService ...@@ -202,4 +202,28 @@ class UtilService
} }
} }
public static function postCurlJson($url, $data,$headers = [], $timeout = 30){
try {
$requestHeader[] = "API-RemoteIP: ";
$requestHeader[] = "Content-type: application/json";
$curl = curl_init();
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_HTTPHEADER,$requestHeader);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$timeout = intval ( $timeout ) ? intval ( $timeout ) : 30;
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_HEADER, 0);
$result = curl_exec($curl);
curl_close($curl);
return $result;
} catch (exception $e) {
throw new Exception($e->getMessage());
}
}
} }
\ No newline at end of file
...@@ -135,6 +135,10 @@ return [ ...@@ -135,6 +135,10 @@ return [
'WX_APPID' => 'wx2db57391553aa064', 'WX_APPID' => 'wx2db57391553aa064',
'WX_AppSecret' => 'f6d533f6d0851c629da52cd10fab910b', 'WX_AppSecret' => 'f6d533f6d0851c629da52cd10fab910b',
'rank' => [1=>'青铜',2=>'白银',3=>'黄金',4=>'铂金',5=>'钻石',6=>'最强王者'] 'rank' => [1=>'青铜',2=>'白银',3=>'黄金',4=>'铂金',5=>'钻石',6=>'最强王者'],
'DINGDING_URL' => 'http://api.srccwl.com/dingding/send_message',
'DINGDING_TOKEN' => 'qPf99DyrCgdSSrJFbhwYHOPEv66HE02FAJy2x3KTx65BfLHbxNlue1Nbbmu5',
'DINGDING_PHONE' => '18616826027',
]; ];
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment