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
7df42407
Commit
7df42407
authored
Jan 17, 2020
by
ligaishun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增钱包代解锁接口
parent
258c9ec8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
node.go
routers/api/v1/node.go
+36
-0
No files found.
routers/api/v1/node.go
View file @
7df42407
...
@@ -456,4 +456,39 @@ func FeedBackStatus(c *gin.Context){
...
@@ -456,4 +456,39 @@ func FeedBackStatus(c *gin.Context){
}
}
appG
.
Response
(
http
.
StatusOK
,
e
.
NETWORK_ERROR
,
"网络出错"
)
appG
.
Response
(
http
.
StatusOK
,
e
.
NETWORK_ERROR
,
"网络出错"
)
log
.
Println
(
results
)
log
.
Println
(
results
)
}
func
EscrowPasswd
(
c
*
gin
.
Context
){
var
passwd
map
[
string
]
string
appG
:=
app
.
Gin
{
C
:
c
}
err
:=
appG
.
C
.
ShouldBindJSON
(
&
passwd
)
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
INVALID_PARAMS
,
nil
)
tlog
.
Info
(
"invalid params"
)
return
}
r
,
errs
:=
setting
.
PaiClient
.
Unlock
(
&
types
.
WalletUnLock
{
Passwd
:
passwd
[
"password"
],
Timeout
:
0
,
WalletOrTicket
:
false
,
XXX_NoUnkeyedLiteral
:
struct
{}{},
XXX_unrecognized
:
nil
,
XXX_sizecache
:
0
,
})
if
errs
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
NODE_ERROR
,
nil
)
tlog
.
Info
(
"节点故障"
)
return
}
//覆盖原有密码
if
!
r
.
IsOk
{
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR_AUTH
,
r
.
Msg
)
tlog
.
Info
(
"Auth Faild"
)
return
}
f
,
err
:=
os
.
OpenFile
(
setting
.
BityuanSetting
.
Passwd
,
os
.
O_WRONLY
|
os
.
O_TRUNC
|
os
.
O_CREATE
,
0666
)
defer
f
.
Close
()
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