aa
This commit is contained in:
@@ -2,6 +2,7 @@ package cms
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -4816,3 +4817,29 @@ func GetPageBrands(ctx *jxcontext.Context) (brands []*model.PageBrand, err error
|
||||
dao.GetRows(db, &brands, sql)
|
||||
return brands, err
|
||||
}
|
||||
|
||||
func AddStoreMapAudit(ctx *jxcontext.Context, storeID, vendorID int, vendorOrgCode, vendorStoreID, vendorStoreName, vendorAccount, vendorPasswaord string) (err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
storeMapAudit = &model.StoreMapAudit{
|
||||
StoreID: storeID,
|
||||
VendorID: vendorID,
|
||||
VendorOrgCode: vendorOrgCode,
|
||||
VendorStoreID: vendorStoreID,
|
||||
VendorStoreName: vendorStoreName,
|
||||
VendorAccount: vendorAccount,
|
||||
}
|
||||
)
|
||||
if vendorPasswaord != "" {
|
||||
if configList, err := dao.QueryConfigs(db, "jxKeyIV", model.ConfigTypeSys, ""); err == nil && len(configList) > 0 {
|
||||
aesKey, iv := configList[0].Value, configList[0].Value
|
||||
if data, err2 := utils.AESCBCEncpryt([]byte(vendorPasswaord), []byte(aesKey), []byte(iv)); err2 == nil {
|
||||
vendorPasswaord = base64.StdEncoding.EncodeToString(data)
|
||||
}
|
||||
}
|
||||
storeMapAudit.VendorPasswaord = vendorPasswaord
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(storeMapAudit, ctx.GetUserName())
|
||||
dao.CreateEntity(db, storeMapAudit)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user