fix golang error

This commit is contained in:
root
2021-07-16 13:45:24 +00:00
parent d51befeff9
commit bb552d50a8
2 changed files with 5 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ func (dbobj dbcon) acceptAgreement(userTOKEN string, mode string, identity strin
}
encIdentity := ""
if len(identity) > 0 {
encIdentity := basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
encIdentity, _ := basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
}
if len(userTOKEN) > 0 {
// first check if this agreement exists, then update
@@ -104,7 +104,7 @@ func (dbobj dbcon) withdrawAgreement(userTOKEN string, brief string, mode string
// update date, status
encIdentity := ""
if len(identity) > 0 {
encIdentity = basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
encIdentity, _ = basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
}
bdoc := bson.M{}
bdoc["when"] = now
@@ -149,7 +149,7 @@ func (dbobj dbcon) listAgreementRecords(userTOKEN string) ([]byte, int, error) {
}
func (dbobj dbcon) listAgreementRecordsByIdentity(identity string) ([]byte, int, error) {
encIdentity := basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
encIdentity, _ := basicStringEncrypt(identity, dbobj.masterKey, dbobj.GetCode())
records, err := dbobj.store.GetList(storage.TblName.Agreements, "who", encIdentity, 0, 0, "")
if err != nil {
return nil, 0, err

View File

@@ -88,11 +88,11 @@ func (e mainEnv) userNew(w http.ResponseWriter, r *http.Request, ps httprouter.P
}
encPhoneIdx := ""
if len(parsedData.emailIdx) > 0 {
encEmailIdx := basicStringEncrypt(parsedData.emailIdx, e.db.masterKey, e.db.GetCode())
encEmailIdx, _ := basicStringEncrypt(parsedData.emailIdx, e.db.masterKey, e.db.GetCode())
e.db.linkAgreementRecords(userTOKEN, encEmailIdx)
}
if len(parsedData.phoneIdx) > 0 {
encPhoneIdx = basicStringEncrypt(parsedData.phoneIdx, e.db.masterKey, e.db.GetCode())
encPhoneIdx, _ = basicStringEncrypt(parsedData.phoneIdx, e.db.masterKey, e.db.GetCode())
e.db.linkAgreementRecords(userTOKEN, encPhoneIdx)
}
if len(parsedData.emailIdx) > 0 && len(parsedData.phoneIdx) > 0 {