更新小程序同步token信息接口
This commit is contained in:
parent
6ca0bb8364
commit
39e91b1cef
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user