API接口
1.新增鉴权接口/api/v1/authToken 2.修复注册,登录,获取首页初始化数据,获取用户信息接口报错
This commit is contained in:
@@ -36,7 +36,13 @@ class Frontend extends Api
|
||||
|
||||
try {
|
||||
$this->auth = Auth::instance(['request' => $request]);
|
||||
$token = get_auth_token(['ba', 'user', 'token'], $request);
|
||||
$token = trim((string) $request->header('user-token', ''));
|
||||
if ($token === '') {
|
||||
$token = trim((string) $request->header('user_token', ''));
|
||||
}
|
||||
if ($token === '') {
|
||||
$token = get_auth_token(['ba', 'user', 'token'], $request);
|
||||
}
|
||||
if ($token) $this->auth->init($token);
|
||||
} catch (TokenExpirationException) {
|
||||
if ($needLogin) return $this->error(__('Token expiration'), [], 409);
|
||||
|
||||
Reference in New Issue
Block a user