Commit e3643641 authored by szh's avatar szh

password

parent 010adfb4
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment