From a8165359ae171be1b4d12c11f2d20491fa98a55e Mon Sep 17 00:00:00 2001 From: michael <457813723@qq.com> Date: Thu, 7 Mar 2024 17:25:43 +0800 Subject: [PATCH 1/2] store cid pk --- http_server/handle/store_cid_pk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_server/handle/store_cid_pk.go b/http_server/handle/store_cid_pk.go index fc2491c..4089a23 100644 --- a/http_server/handle/store_cid_pk.go +++ b/http_server/handle/store_cid_pk.go @@ -59,7 +59,7 @@ func (h *HttpHandle) doStoreCidPk(req *ReqStoreCidPk, apiResp *http_api.ApiResp) signMsg := req.Msg signature := req.Signature address := signAddressHex.AddressHex - if address[20:] != hex.EncodeToString(common.CalculateCid1(req.Cid)) { + if address[:20] != hex.EncodeToString(common.CalculateCid1(req.Cid)) { apiResp.ApiRespErr(http_api.ApiCodeParamsInvalid, "cid err") return nil } From a0aa3ff2182dd7a1f1eccf73985c27c38236a36e Mon Sep 17 00:00:00 2001 From: michael <457813723@qq.com> Date: Thu, 7 Mar 2024 17:26:50 +0800 Subject: [PATCH 2/2] store cid pk --- dao/dao.go | 1 + 1 file changed, 1 insertion(+) diff --git a/dao/dao.go b/dao/dao.go index 5722949..e6c9ccf 100644 --- a/dao/dao.go +++ b/dao/dao.go @@ -33,6 +33,7 @@ func NewGormDB(dbMysql, parserMysql config.DbMysql, autoMigrate bool) (*DbDao, e &tables.TableBlockParserInfo{}, &tables.TableAvatarNotes{}, &tables.TableCidInfo{}, + &tables.TableCidPk{}, ); err != nil { return nil, err }