Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b0aa33f2
authored
Jun 22, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改回写接口
parent
47ff92ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
app/Http/Middleware/CheckLogin.php
app/Http/routes.php
app/Http/Middleware/CheckLogin.php
View file @
b0aa33f2
...
...
@@ -5,7 +5,6 @@ namespace App\Http\Middleware;
use
App\Model\IntracodeModel
;
use
App\Model\UserInfoModel
;
use
Closure
;
use
Common\Model\RedisModel
;
use
DB
;
...
...
@@ -30,6 +29,13 @@ class CheckLogin
if
(
$hasApiRoute
===
0
)
{
$isApi
=
true
;
}
$hasSyncRoute
=
strpos
(
$request
->
path
(),
'sync/'
);
if
(
$hasSyncRoute
===
0
)
{
return
$next
(
$request
);
}
if
(
!
$userId
||
!
$skey
||
(
string
)((
int
)
$userId
)
!=
$userId
||
!
preg_match
(
'/^[a-zA-Z0-9]+$/'
,
$skey
))
{
if
(
$isApi
)
{
return
[
"errcode"
=>
401
,
"errmsg"
=>
"没有登录"
];
...
...
app/Http/routes.php
View file @
b0aa33f2
...
...
@@ -54,12 +54,11 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
});
//同步相关的接口
Route
::
group
([
'middleware'
=>
[],
'namespace'
=>
'Sync'
],
function
()
{
Route
::
group
([
'middleware'
=>
[
'external'
],
'namespace'
=>
'Sync'
],
function
()
{
//这个接口是用来接收同步结果,同时这个接口也是接收一体化那边的修改
Route
::
any
(
'/sync/unitedData/syncResult'
,
'SupplierSyncController@syncUniteResult'
);
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\SyncSupplierService
())
->
syncSupplierToUnited
(
10
);
});
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