diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 765b44cb..9cdf7403 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1213,4 +1213,25 @@ class Auth extends BaseController return app('json')->success($data); } + //同步其他小程序token信息 + //userType小程序类型:1供销工作平台 2物流系统 + public function syncToken() + { + $account = $this->request->param('account', ''); + $userType = $this->request->param('user_type', 1); + $token = $this->request->param('token', ''); + $expiresTime = $this->request->param('expires_time', ''); + $user = $this->request->userInfo(); + $uid = $user->uid; + $insertData = [ + 'account' => $account, + 'user_type' => $userType, + 'token' => $token, + 'expires_time' => $expiresTime, + 'user_id' => $uid, + 'create_time' => date('Y-m-d H:i:s') + ]; + Db::name('user_thirdparty_token')->fetchSql(false)->insert($insertData); + return app('json')->success($insertData); + } } diff --git a/route/api.php b/route/api.php index c44ece06..bfe49fcd 100644 --- a/route/api.php +++ b/route/api.php @@ -32,7 +32,8 @@ Route::group('api/', function () { Route::post('articleCatch', 'api.Upload/article'); //强制登录 Route::group(function () { - + Route::post('sync/token', 'api.Auth/syncToken'); + Route::group('micro', function () { Route::get('seach_bar_code', '/seach_bar_code'); Route::get('product_details', '/ProductDetails');