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
8d2071ca
Commit
8d2071ca
authored
Jun 27, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
f5bde594
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
11 deletions
+15
-11
ResponseMsg.php
api/base/ResponseMsg.php
+2
-1
LoginStatusAuthInterceptor.php
common/behaviors/LoginStatusAuthInterceptor.php
+3
-3
UserAuthInterceptor.php
common/behaviors/UserAuthInterceptor.php
+5
-5
MonitorController.php
wallet/controllers/MonitorController.php
+5
-2
No files found.
api/base/ResponseMsg.php
View file @
8d2071ca
...
@@ -69,7 +69,8 @@ class ResponseMsg
...
@@ -69,7 +69,8 @@ class ResponseMsg
}
}
$view
=
[
$view
=
[
BaseConstant
::
CODE
=>
$code
,
BaseConstant
::
CODE
=>
$code
,
BaseConstant
::
MESSAGE
=>
$msg
,
BaseConstant
::
MSG
=>
$msg
,
BaseConstant
::
DATA
=>
null
,
];
];
$json
=
json_encode
(
$view
);
$json
=
json_encode
(
$view
);
return
$this
->
dumpJsonData
(
$json
);
return
$this
->
dumpJsonData
(
$json
);
...
...
common/behaviors/LoginStatusAuthInterceptor.php
View file @
8d2071ca
...
@@ -25,14 +25,14 @@ class LoginStatusAuthInterceptor extends ActionFilter
...
@@ -25,14 +25,14 @@ class LoginStatusAuthInterceptor extends ActionFilter
}
}
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
if
(
false
==
$token_string
){
if
(
false
==
$token_string
){
$m
essage
=
'platform auth error'
;
$m
sg
=
'platform auth error'
;
$code
=
'40004'
;
$code
=
'40004'
;
goto
doEnd
;
goto
doEnd
;
}
}
$model
=
new
Admin
();
$model
=
new
Admin
();
$user
=
$model
->
loginByAccessToken
(
$token_string
,
''
);
$user
=
$model
->
loginByAccessToken
(
$token_string
,
''
);
if
(
false
==
$user
){
if
(
false
==
$user
){
$m
essage
=
'user auth error'
;
$m
sg
=
'user auth error'
;
$code
=
'40004'
;
$code
=
'40004'
;
goto
doEnd
;
goto
doEnd
;
}
}
...
@@ -42,7 +42,7 @@ class LoginStatusAuthInterceptor extends ActionFilter
...
@@ -42,7 +42,7 @@ class LoginStatusAuthInterceptor extends ActionFilter
doEnd
:
doEnd
:
// 返回错误
// 返回错误
$response_message
=
new
ResponseMsg
();
$response_message
=
new
ResponseMsg
();
$content
=
$response_message
->
jsonError
(
$m
essage
,
$code
);
$content
=
$response_message
->
jsonError
(
$m
sg
,
$code
);
$content
=
$response_message
->
withHeaders
(
$response_message
->
getHeaders
())
->
withContent
(
$content
);
$content
=
$response_message
->
withHeaders
(
$response_message
->
getHeaders
())
->
withContent
(
$content
);
Yii
::
$app
->
response
->
data
=
$content
;
Yii
::
$app
->
response
->
data
=
$content
;
Yii
::
$app
->
response
->
send
();
Yii
::
$app
->
response
->
send
();
...
...
common/behaviors/UserAuthInterceptor.php
View file @
8d2071ca
...
@@ -36,13 +36,13 @@ class UserAuthInterceptor extends ActionFilter
...
@@ -36,13 +36,13 @@ class UserAuthInterceptor extends ActionFilter
$user_auth_map
=
$user_auth
[
$platform_id
]
??
null
;
$user_auth_map
=
$user_auth
[
$platform_id
]
??
null
;
if
(
empty
(
$user_auth_map
)){
if
(
empty
(
$user_auth_map
)){
$code
=
'40001'
;
$code
=
'40001'
;
$m
essage
=
'platform auth error'
;
$m
sg
=
'platform auth error'
;
goto
doEnd
;
goto
doEnd
;
}
}
$user_auth_map
=
$user_auth_map
[
$user_id
]
??
null
;
$user_auth_map
=
$user_auth_map
[
$user_id
]
??
null
;
if
(
empty
(
$user_auth_map
)){
if
(
empty
(
$user_auth_map
)){
$code
=
'40001'
;
$code
=
'40001'
;
$m
essage
=
'user auth error'
;
$m
sg
=
'user auth error'
;
goto
doEnd
;
goto
doEnd
;
}
}
$auth_type_map
=
Yii
::
$app
->
params
[
'user_auth'
][
$user_auth_map
];
$auth_type_map
=
Yii
::
$app
->
params
[
'user_auth'
][
$user_auth_map
];
...
@@ -59,7 +59,7 @@ class UserAuthInterceptor extends ActionFilter
...
@@ -59,7 +59,7 @@ class UserAuthInterceptor extends ActionFilter
}
}
if
(
false
==
$switch
){
if
(
false
==
$switch
){
$code
=
'40003'
;
$code
=
'40003'
;
$m
essage
=
'controller auth error'
;
$m
sg
=
'controller auth error'
;
goto
doEnd
;
goto
doEnd
;
}
}
if
(
empty
(
$action_map
)){
if
(
empty
(
$action_map
)){
...
@@ -69,14 +69,14 @@ class UserAuthInterceptor extends ActionFilter
...
@@ -69,14 +69,14 @@ class UserAuthInterceptor extends ActionFilter
return
true
;
return
true
;
}
else
{
}
else
{
$code
=
'40004'
;
$code
=
'40004'
;
$m
essage
=
'action auth error'
;
$m
sg
=
'action auth error'
;
goto
doEnd
;
goto
doEnd
;
}
}
doEnd
:
doEnd
:
// 返回错误
// 返回错误
$response_message
=
new
ResponseMsg
();
$response_message
=
new
ResponseMsg
();
$content
=
$response_message
->
jsonError
(
$m
essage
,
$code
);
$content
=
$response_message
->
jsonError
(
$m
sg
,
$code
);
$content
=
$response_message
->
withHeaders
(
$response_message
->
getHeaders
())
->
withContent
(
$content
);
$content
=
$response_message
->
withHeaders
(
$response_message
->
getHeaders
())
->
withContent
(
$content
);
Yii
::
$app
->
response
->
data
=
$content
;
Yii
::
$app
->
response
->
data
=
$content
;
Yii
::
$app
->
response
->
send
();
Yii
::
$app
->
response
->
send
();
...
...
wallet/controllers/MonitorController.php
View file @
8d2071ca
...
@@ -36,7 +36,10 @@ class MonitorController extends BaseController
...
@@ -36,7 +36,10 @@ class MonitorController extends BaseController
foreach
(
$models
as
$model
){
foreach
(
$models
as
$model
){
$address
[]
=
$model
[
'address'
];
$address
[]
=
$model
[
'address'
];
}
}
if
(
empty
(
$address
)){
$data
=
null
;
goto
doEnd
;
}
$service
=
new
Chain33Service
();
$service
=
new
Chain33Service
();
$execer
=
'coins'
;
$execer
=
'coins'
;
$result
=
$service
->
getBalance
(
$address
,
$execer
);
$result
=
$service
->
getBalance
(
$address
,
$execer
);
...
@@ -57,7 +60,7 @@ class MonitorController extends BaseController
...
@@ -57,7 +60,7 @@ class MonitorController extends BaseController
'list'
=>
$models
,
'list'
=>
$models
,
'page'
=>
[
'page'
=>
[
'pageCount'
=>
$pages
->
pageCount
,
'pageCount'
=>
$pages
->
pageCount
,
'pageSize'
=>
2
0
,
'pageSize'
=>
1
0
,
'currentPage'
=>
$page
,
'currentPage'
=>
$page
,
]
]
];
];
...
...
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