Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
28f4ce5f
Commit
28f4ce5f
authored
Jul 20, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志处理
parent
123e8136
Pipeline
#9952
passed with stages
in 58 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
Handler.php
app/Exceptions/Handler.php
+0
-3
MediaController.php
app/Http/Controllers/Web/MediaController.php
+0
-1
UserModel.php
app/Model/UserModel.php
+14
-1
logging.php
config/logging.php
+2
-1
No files found.
app/Exceptions/Handler.php
View file @
28f4ce5f
...
...
@@ -54,7 +54,6 @@ class Handler extends ExceptionHandler
public
function
render
(
$request
,
Exception
$exception
)
{
$path
=
$request
->
path
();
#检测当前请求是否是api路由
...
...
@@ -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
)
)
{
echo
555
;
die
;
if
(
view
()
->
exists
(
'errors.404'
))
{
return
response
()
->
view
(
'errors.404'
);
}
...
...
app/Http/Controllers/Web/MediaController.php
View file @
28f4ce5f
...
...
@@ -18,7 +18,6 @@ class MediaController extends Controller
* @throws \App\Exceptions\FormException
*/
public
function
index
(
Request
$request
){
// php 特殊字符转义,实现字符串安全存入数据库,
SrsHookValidate
::
srsHookCallback
(
$request
,[
...
...
app/Model/UserModel.php
View file @
28f4ce5f
...
...
@@ -163,7 +163,20 @@ class UserModel extends Eloquent
'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
){
throw
new
\Exception
(
"用户添加失败"
);
}
...
...
config/logging.php
View file @
28f4ce5f
...
...
@@ -48,7 +48,8 @@ return [
'daily'
=>
[
'driver'
=>
'daily'
,
'path'
=>
storage_path
(
'logs/laravel.log'
),
// 'path' => storage_path('logs/laravel.log'),
'path'
=>
'/data/logs/media-resource.log'
,
'level'
=>
'debug'
,
'days'
=>
14
,
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment