|
@@ -162,12 +162,8 @@ func ProductDelete(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if !found || err != nil {
|
|
|
return nil, errors.New("该商品不存在")
|
|
|
}
|
|
|
-
|
|
|
- _userId := apictx.User.ID
|
|
|
- userId, _ := primitive.ObjectIDFromHex(_userId)
|
|
|
-
|
|
|
// 不是自己的商品
|
|
|
- if product.SupplyId != userId {
|
|
|
+ if product.SupplyId.Hex() != apictx.User.ID {
|
|
|
return nil, errors.New("非法操作")
|
|
|
}
|
|
|
|