Commit 28f4ce5f by 杨昕

日志处理

parent 123e8136
Pipeline #9952 passed with stages
in 58 seconds
...@@ -54,7 +54,6 @@ class Handler extends ExceptionHandler ...@@ -54,7 +54,6 @@ class Handler extends ExceptionHandler
public function render($request, Exception $exception) public function render($request, Exception $exception)
{ {
$path = $request->path(); $path = $request->path();
#检测当前请求是否是api路由 #检测当前请求是否是api路由
...@@ -64,8 +63,6 @@ class Handler extends ExceptionHandler ...@@ -64,8 +63,6 @@ class Handler extends ExceptionHandler
} }
if( ( (stripos($path,'web/') === 0 && strrpos($path,'.php') !== false) || (stripos($path,'web/') === 0 && strrpos($path,'.html') !== false ) ) && ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) ) { if( ( (stripos($path,'web/') === 0 && strrpos($path,'.php') !== false) || (stripos($path,'web/') === 0 && strrpos($path,'.html') !== false ) ) && ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) ) {
echo 555;die;
if (view()->exists('errors.404')) { if (view()->exists('errors.404')) {
return response()->view('errors.404'); return response()->view('errors.404');
} }
......
...@@ -18,7 +18,6 @@ class MediaController extends Controller ...@@ -18,7 +18,6 @@ class MediaController extends Controller
* @throws \App\Exceptions\FormException * @throws \App\Exceptions\FormException
*/ */
public function index(Request $request){ public function index(Request $request){
// php 特殊字符转义,实现字符串安全存入数据库, // php 特殊字符转义,实现字符串安全存入数据库,
SrsHookValidate::srsHookCallback($request,[ SrsHookValidate::srsHookCallback($request,[
......
...@@ -163,7 +163,20 @@ class UserModel extends Eloquent ...@@ -163,7 +163,20 @@ class UserModel extends Eloquent
'user_type' => 1 'user_type' => 1
]; ];
$flag = UserModel::insertGetId($data); $idArr = UserModel::insertGetId($data);
if (empty($idArr)){
throw new \Exception("添加用户失败");
}
$_id = $idArr['$oid'];
$token = generateRandomNum();
$newtoken = encrypt($_id.'|'.$token."|1ZGHd3pCc87AsQFBLLJeMjM4t57cli6Ar78qowe7");
$data['token'] = $newtoken;
$flag = UserModel::where("_id",$_id)->update($data);
if (!$flag){ if (!$flag){
throw new \Exception("用户添加失败"); throw new \Exception("用户添加失败");
} }
......
...@@ -48,7 +48,8 @@ return [ ...@@ -48,7 +48,8 @@ return [
'daily' => [ 'daily' => [
'driver' => 'daily', 'driver' => 'daily',
'path' => storage_path('logs/laravel.log'), // 'path' => storage_path('logs/laravel.log'),
'path' => '/data/logs/media-resource.log',
'level' => 'debug', 'level' => 'debug',
'days' => 14, 'days' => 14,
], ],
......
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