Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -106,7 +106,7 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
errList errlist.ErrList
|
||||
userList = &UserMessageList{}
|
||||
)
|
||||
if string(msg) == "" {
|
||||
if len(string(msg)) == 0 {
|
||||
errList.AddErr(fmt.Errorf("读取平台数据为空,请检查"))
|
||||
}
|
||||
if vendorID == VendorIDMT {
|
||||
@@ -151,7 +151,7 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
errList.AddErr(fmt.Errorf("存储STU聊天记录错误:%v", err))
|
||||
}
|
||||
//3 cid推送新消息
|
||||
if err = PushMsgByCid(vendorStoreID, vendorID); err != nil {
|
||||
if err = PushMsgByCid(vendorStoreID, vendorID, string(msg)); err != nil {
|
||||
errList.AddErr(fmt.Errorf("向商家cid推送新消息错误:%v", err))
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
}
|
||||
|
||||
// PushMsgByCid 通过cid push用户
|
||||
func PushMsgByCid(vendorStoreID string, vendorID int) error {
|
||||
if err := push.NotifyImNewMessage(vendorStoreID, vendorID); err != nil {
|
||||
func PushMsgByCid(vendorStoreID string, vendorID int, msg string) error {
|
||||
if err := push.NotifyImNewMessage(vendorStoreID, vendorID, msg); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -360,9 +360,7 @@ func DecryptIm(appID int, msg string) (string, error) {
|
||||
data, _ := base64.StdEncoding.DecodeString(msg)
|
||||
key := utils.LimitUTF8StringLen2(rel[appID], 16)
|
||||
res, err := utils.AESCBCDecpryt(data, []byte(key), []byte(key))
|
||||
globals.SugarLogger.Debugf("DecryptIm err=%v", err)
|
||||
if len(string(res)) > 0 && err == nil {
|
||||
globals.SugarLogger.Debugf("DecryptIm res=%v", string(res))
|
||||
return string(res), nil
|
||||
}
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user