Commit b0aa33f2 by 杨树贤

修改回写接口

parent 47ff92ec
...@@ -5,7 +5,6 @@ namespace App\Http\Middleware; ...@@ -5,7 +5,6 @@ namespace App\Http\Middleware;
use App\Model\IntracodeModel; use App\Model\IntracodeModel;
use App\Model\UserInfoModel; use App\Model\UserInfoModel;
use Closure; use Closure;
use Common\Model\RedisModel;
use DB; use DB;
...@@ -30,6 +29,13 @@ class CheckLogin ...@@ -30,6 +29,13 @@ class CheckLogin
if ($hasApiRoute === 0) { if ($hasApiRoute === 0) {
$isApi = true; $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 (!$userId || !$skey || (string)((int)$userId) != $userId || !preg_match('/^[a-zA-Z0-9]+$/', $skey)) {
if ($isApi) { if ($isApi) {
return ["errcode" => 401, "errmsg" => "没有登录"]; return ["errcode" => 401, "errmsg" => "没有登录"];
......
...@@ -54,12 +54,11 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () { ...@@ -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::any('/sync/unitedData/syncResult', 'SupplierSyncController@syncUniteResult');
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\SyncSupplierService())->syncSupplierToUnited(10); (new \App\Http\Services\SyncSupplierService())->syncSupplierToUnited(10);
}); });
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 sign in to comment