AddEventDetail中处理没有request的情况
This commit is contained in:
@@ -1204,21 +1204,24 @@ func getSkuSaleStatus(inSkuBind *StoreSkuBindSkuInfo, skuNameBindInfo *StoreSkuB
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddEventDetail(db *dao.DaoDB, ctx *jxcontext.Context, operateType, thingID, thingType, storeID int, beforeData, afterData string) (err error) {
|
func AddEventDetail(db *dao.DaoDB, ctx *jxcontext.Context, operateType, thingID, thingType, storeID int, beforeData, afterData string) (err error) {
|
||||||
url := ctx.GetRequest().URL.Path
|
req := ctx.GetRequest()
|
||||||
apiFunction := url[strings.LastIndex(url, "/")+1 : len(url)]
|
if req != nil {
|
||||||
if ctx.GetUserName() == "jxadmin" && !strings.Contains(apiFunction, "AutoPayForPopluarMan") {
|
url := req.URL.Path
|
||||||
return err
|
apiFunction := url[strings.LastIndex(url, "/")+1 : len(url)]
|
||||||
|
if ctx.GetUserName() == "jxadmin" && !strings.Contains(apiFunction, "AutoPayForPopluarMan") {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
operateEventDetail := &model.OperateEventDetail{
|
||||||
|
OperateType: operateType,
|
||||||
|
ThingID: thingID,
|
||||||
|
ThingType: thingType,
|
||||||
|
StoreID: storeID,
|
||||||
|
AccessUUID: ctx.GetTrackInfo()[0:strings.Index(ctx.GetTrackInfo(), ",")],
|
||||||
|
BeforeData: beforeData,
|
||||||
|
AfterData: afterData,
|
||||||
|
}
|
||||||
|
err = event.AddOperateEventDetail(db, operateEventDetail)
|
||||||
}
|
}
|
||||||
operateEventDetail := &model.OperateEventDetail{
|
|
||||||
OperateType: operateType,
|
|
||||||
ThingID: thingID,
|
|
||||||
ThingType: thingType,
|
|
||||||
StoreID: storeID,
|
|
||||||
AccessUUID: ctx.GetTrackInfo()[0:strings.Index(ctx.GetTrackInfo(), ",")],
|
|
||||||
BeforeData: beforeData,
|
|
||||||
AfterData: afterData,
|
|
||||||
}
|
|
||||||
err = event.AddOperateEventDetail(db, operateEventDetail)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user