Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
e3643641
Commit
e3643641
authored
Feb 28, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
password
parent
010adfb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
node.go
routers/api/v1/node.go
+8
-4
No files found.
routers/api/v1/node.go
View file @
e3643641
...
...
@@ -460,7 +460,10 @@ func FeedBackStatus(c *gin.Context){
}
func
EscrowPasswd
(
c
*
gin
.
Context
){
var
passwd
map
[
string
]
string
type
Password
struct
{
Password
string
`json:"password" binding:"required"`
}
var
passwd
Password
appG
:=
app
.
Gin
{
C
:
c
}
err
:=
appG
.
C
.
ShouldBindJSON
(
&
passwd
)
if
err
!=
nil
{
...
...
@@ -470,7 +473,7 @@ func EscrowPasswd(c *gin.Context){
}
r
,
errs
:=
setting
.
PaiClient
.
Unlock
(
&
types
.
WalletUnLock
{
Passwd
:
passwd
[
"password"
]
,
Passwd
:
passwd
.
Password
,
Timeout
:
0
,
WalletOrTicket
:
false
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
...
...
@@ -484,7 +487,7 @@ func EscrowPasswd(c *gin.Context){
}
//覆盖原有密码
if
!
r
.
IsOk
{
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR_AUTH
,
r
.
Msg
)
tlog
.
Info
(
"Auth Faild"
)
tlog
.
Info
(
"Auth Faild"
,
"password"
,
passwd
.
Password
)
return
}
f
,
err
:=
os
.
OpenFile
(
setting
.
BityuanSetting
.
Passwd
,
os
.
O_WRONLY
|
os
.
O_TRUNC
|
os
.
O_CREATE
,
0666
)
...
...
@@ -494,7 +497,7 @@ func EscrowPasswd(c *gin.Context){
tlog
.
Info
(
err
.
Error
())
return
}
f
.
WriteString
(
passwd
[
"password"
]
)
f
.
WriteString
(
passwd
.
Password
)
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
nil
)
}
\ 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