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
ee630520
Commit
ee630520
authored
Dec 18, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置钱包密码
parent
7168672d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
1 deletion
+91
-1
WalletController.php
backend/controllers/WalletController.php
+43
-0
set-passwd.php
backend/views/wallet/set-passwd.php
+46
-0
CoinReleaseCheck.php
common/models/psources/CoinReleaseCheck.php
+2
-1
No files found.
backend/controllers/WalletController.php
0 → 100644
View file @
ee630520
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/12/17
* Time: 10:13
*/
namespace
backend\controllers
;
use
common\models\psources\CoinApplicationCategory
;
use
Yii
;
class
WalletController
extends
BaseController
{
public
function
actionSetPasswd
()
{
if
(
Yii
::
$app
->
request
->
isPost
)
{
$old_passwd
=
Yii
::
$app
->
request
->
post
(
'old_passwd'
);
$new_passwd
=
Yii
::
$app
->
request
->
post
(
'new_passwd'
);
$confirm_passwd
=
Yii
::
$app
->
request
->
post
(
'confirm_passwd'
);
$passwd
=
Yii
::
$app
->
redis
->
get
(
'wallet_passwd'
);
if
(
!
$passwd
){
Yii
::
$app
->
redis
->
set
(
'wallet_passwd'
,
$new_passwd
);
$this
->
success
(
'钱包密码设置成功'
,
Yii
::
$app
->
request
->
getReferrer
());
}
if
(
$passwd
!=
$old_passwd
){
$this
->
error
(
'原始密码错误'
,
Yii
::
$app
->
request
->
getReferrer
());
}
if
(
$new_passwd
!=
$confirm_passwd
){
$this
->
error
(
'确认密码和设置的密码不一致'
,
Yii
::
$app
->
request
->
getReferrer
());
}
Yii
::
$app
->
redis
->
set
(
'wallet_passwd'
,
$new_passwd
);
$this
->
success
(
'钱包密码设置成功'
,
Yii
::
$app
->
request
->
getReferrer
());
}
return
$this
->
render
(
'set-passwd'
);
}
}
\ No newline at end of file
backend/views/wallet/set-passwd.php
0 → 100644
View file @
ee630520
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 18-12-18
* Time: 上午10:26
*/
?>
<h4>
设置密码
</h4>
<style>
.layui-form-label
{
width
:
100px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md3"
>
<form
class=
"layui-form"
method=
"post"
action=
""
>
<input
name=
"_csrf"
type=
"hidden"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
原始密码
</label>
<div
class=
"layui-input-block"
>
<input
name=
"old_passwd"
type=
"password"
required
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
设置密码
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"new_passwd"
required
type=
"password"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
确认密码
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"confirm_passwd"
required
type=
"password"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<button
class=
"layui-btn"
>
提交
</button>
</div>
</form>
</div>
</div>
<script>
var
form
=
layui
.
form
;
form
.
render
();
</script>
common/models/psources/CoinReleaseCheck.php
View file @
ee630520
...
...
@@ -159,7 +159,8 @@ class CoinReleaseCheck extends BaseActiveRecord
}
else
{
$isToken
=
true
;
}
Chain33Business
::
unLockWallet
(
"beanwalletGD666"
);
$walletpasswd
=
Yii
::
$app
->
redis
->
get
(
'wallet_passwd'
);
Chain33Business
::
unLockWallet
(
$walletpasswd
);
$result
=
Chain33Business
::
transToken
(
trim
(
$address
),
trim
(
$this
->
to_address
),
...
...
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