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
8d2d9c84
Commit
8d2d9c84
authored
Oct 20, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
Feature/optimize See merge request
!396
parents
745be6d2
1990c78b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
CrossChainController.php
console/controllers/CrossChainController.php
+4
-1
UserController.php
wallet/controllers/UserController.php
+54
-0
No files found.
console/controllers/CrossChainController.php
View file @
8d2d9c84
...
...
@@ -110,7 +110,10 @@ class CrossChainController extends Controller
// 'port' => 8801
// ];
$service
=
new
Chain33Service
(
$node_params
);
$result
=
$service
->
getHeight
();
$payload
=
[
"data"
=>
'user.p.game'
,
];
$result
=
$service
->
chainQuery
(
'paracross'
,
'GetHeight'
,
$payload
);
$consensHeight
=
$result
[
'result'
][
'consensHeight'
];
$current_time
=
time
();
...
...
wallet/controllers/UserController.php
View file @
8d2d9c84
...
...
@@ -305,4 +305,57 @@ class UserController extends BaseController
}
return
[
'code'
=>
1
,
'data'
=>
$result
[
'msg'
],
'msg'
=>
'success'
];
}
public
function
actionEditPwd
()
{
if
(
!
Yii
::
$app
->
request
->
isPut
)
{
$this
->
msg
=
'请求方式错误'
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
$token
=
Yii
::
$app
->
request
->
headers
->
get
(
'Token'
);
$user_info
=
Admin
::
verfication
(
$token
);
if
(
0
!=
$user_info
[
'code'
])
{
$this
->
msg
=
$user_info
[
'data'
];
$this
->
code
=
-
1
;
goto
doEnd
;
}
$user_info
=
(
array
)
$user_info
[
'data'
];
$user
=
Admin
::
findOne
(
$user_info
[
'uid'
]);
$old_password
=
Yii
::
$app
->
request
->
post
(
'old_password'
,
null
);
$new_password
=
Yii
::
$app
->
request
->
post
(
'new_password'
,
null
);
$new_password1
=
Yii
::
$app
->
request
->
post
(
'new_password1'
,
null
);
if
(
!
$old_password
)
{
$this
->
msg
=
"请输入原始密码"
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
if
(
!
$new_password
)
{
$this
->
msg
=
"请输入新密码"
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
if
(
!
$new_password1
)
{
$this
->
msg
=
"请再次输入新密码"
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
if
(
$new_password
!=
$new_password1
)
{
$this
->
msg
=
"新密码输入不一致,请重新输入"
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
if
(
!
Yii
::
$app
->
security
->
validatePassword
(
$old_password
,
$user
->
password
))
{
$this
->
msg
=
"原始密码错误,请重新输入"
;
$this
->
code
=
-
1
;
goto
doEnd
;
}
$user
->
setPassword
(
$new_password
);
$user
->
save
();
doEnd
:
return
[
'code'
=>
$this
->
code
,
'msg'
=>
$this
->
msg
,
'data'
=>
$this
->
data
];
}
}
\ 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