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
e04c49b8
Commit
e04c49b8
authored
Jul 16, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户信息
parent
74f6c883
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
1 deletion
+38
-1
LoginForm.php
common/models/LoginForm.php
+1
-1
TrusteeShipService.php
common/service/trusteeship/TrusteeShipService.php
+7
-0
UserController.php
wallet/controllers/UserController.php
+15
-0
WalletController.php
wallet/controllers/WalletController.php
+15
-0
No files found.
common/models/LoginForm.php
View file @
e04c49b8
...
@@ -92,7 +92,7 @@ class LoginForm extends Model
...
@@ -92,7 +92,7 @@ class LoginForm extends Model
}
}
/**
/**
* Finds user by [[
username
]]
* Finds user by [[
token
]]
*
*
* @return User|null
* @return User|null
*/
*/
...
...
common/service/trusteeship/TrusteeShipService.php
View file @
e04c49b8
...
@@ -55,4 +55,11 @@ class TrusteeShipService
...
@@ -55,4 +55,11 @@ class TrusteeShipService
return
$this
->
send
(
"GET"
,
$uri
,
$params
);
return
$this
->
send
(
"GET"
,
$uri
,
$params
);
}
}
public
function
getWalletBalance
(
$params
=
[])
{
$uri
=
'backend/account/wallet-balance'
;
return
$this
->
send
(
"GET"
,
$uri
,
$params
);
}
}
}
wallet/controllers/UserController.php
View file @
e04c49b8
...
@@ -36,6 +36,21 @@ class UserController extends BaseController
...
@@ -36,6 +36,21 @@ class UserController extends BaseController
return
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
];
return
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
];
}
}
public
function
actionUserInfo
()
{
$msg
=
'ok'
;
$code
=
0
;
$token_string
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$user
=
Admin
::
findIdentityByAccessToken
(
$token_string
);
$data
=
[
'username'
=>
$user
->
username
,
'uid'
=>
isset
(
$user
->
bind_uid
)
?
$user
->
bind_uid
:
$user
->
uid
,
'type'
=>
isset
(
$user
->
bind_uid
)
?
2
:
1
];
doEnd
:
return
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
];
}
/**
/**
* 用户同步
* 用户同步
*/
*/
...
...
wallet/controllers/WalletController.php
View file @
e04c49b8
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
wallet\controllers
;
namespace
wallet\controllers
;
use
common\service\trusteeship\TrusteeShipService
;
use
Yii
;
use
Yii
;
use
common\models\Admin
;
use
common\models\Admin
;
use
wallet\base\BaseController
;
use
wallet\base\BaseController
;
...
@@ -21,4 +22,17 @@ class WalletController extends BaseController
...
@@ -21,4 +22,17 @@ class WalletController extends BaseController
return
[
'code'
=>
0
,
'msg'
=>
'ok'
,
'data'
=>
$platforms
];
return
[
'code'
=>
0
,
'msg'
=>
'ok'
,
'data'
=>
$platforms
];
}
}
public
function
actionWalletBallance
()
{
$type
=
Yii
::
$app
->
request
->
get
(
'type'
,
1
);
$currency
=
Yii
::
$app
->
request
->
get
(
'currency '
,
''
);
$params
=
[
'type'
=>
$type
,
'currency'
=>
$currency
];
$service
=
new
TrusteeShipService
();
$result
=
$service
->
getWalletBalance
(
$params
);
return
[
'code'
=>
1
,
'data'
=>
$result
,
'msg'
=>
'success'
];
}
}
}
\ No newline at end of file
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