Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
043d65fc
Commit
043d65fc
authored
Jun 09, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试图片
parent
2f57c012
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
src/app/Exceptions/Handler.php
src/app/Exceptions/Handler.php
+4
-1
src/app/Http/Controllers/Card/CardController.php
src/app/Http/Controllers/Card/CardController.php
+0
-2
src/app/Services/UtilService.php
src/app/Services/UtilService.php
+24
-0
src/config/sign.php
src/config/sign.php
+5
-1
No files found.
src/app/Exceptions/Handler.php
View file @
043d65fc
...
@@ -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
);
}
}
}
}
src/app/Http/Controllers/Card/CardController.php
View file @
043d65fc
...
@@ -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'
]);
...
...
src/app/Services/UtilService.php
View file @
043d65fc
...
@@ -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
src/config/sign.php
View file @
043d65fc
...
@@ -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
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