Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
28a28fc1
Commit
28a28fc1
authored
Jun 25, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8b5ca475
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
LoginStatusAuthInterceptor.php
common/behaviors/LoginStatusAuthInterceptor.php
+2
-1
UserAuthInterceptor.php
common/behaviors/UserAuthInterceptor.php
+7
-3
No files found.
common/behaviors/LoginStatusAuthInterceptor.php
View file @
28a28fc1
...
...
@@ -18,7 +18,8 @@ class LoginStatusAuthInterceptor extends ActionFilter
{
public
function
beforeAction
(
$action
)
{
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'access_token'
);
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
if
(
false
==
$token_string
){
$message
=
'platform auth error'
;
$code
=
'40004'
;
...
...
common/behaviors/UserAuthInterceptor.php
View file @
28a28fc1
...
...
@@ -10,13 +10,13 @@ namespace common\behaviors;
use
api\base\ResponseMsg
;
use
yii\base\ActionFilter
;
use
common\models\Admin
;
use
Yii
;
class
UserAuthInterceptor
extends
ActionFilter
{
public
function
beforeAction
(
$action
)
{
return
true
;
if
(
!
parent
::
beforeAction
(
$action
)){
return
false
;
}
...
...
@@ -24,8 +24,12 @@ class UserAuthInterceptor extends ActionFilter
$request_class
=
get_class
(
$action
->
controller
);
$request_action
=
$action
->
id
;
$user_id
=
46
;
$platform_id
=
17
;
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$model
=
new
Admin
();
$user
=
$model
->
loginByAccessToken
(
$token_string
,
''
);
$user_id
=
$user
->
uid
;
$platform_id
=
$user
->
platform_id
;
#var_dump($user_id,$platform_id);exit;
$user_auth
=
Yii
::
$app
->
params
[
'user_auth'
][
'user_auth'
];
$user_auth_map
=
$user_auth
[
$platform_id
]
??
null
;
if
(
empty
(
$user_auth_map
)){
...
...
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