xiongzhu 4 years ago
parent
commit
92f228f920
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/izouma/nineth/service/GiftOrderService.java

+ 1 - 1
src/main/java/com/izouma/nineth/service/GiftOrderService.java

@@ -64,7 +64,7 @@ public class GiftOrderService {
     @Transactional
     @Transactional
     public GiftOrder gift(Long userId, Long assetId, Long toUserId) {
     public GiftOrder gift(Long userId, Long assetId, Long toUserId) {
         Asset asset = assetRepo.findById(assetId).orElseThrow(new BusinessException("资产不存在"));
         Asset asset = assetRepo.findById(assetId).orElseThrow(new BusinessException("资产不存在"));
-        if (asset.getUserId().equals(userId)) {
+        if (!asset.getUserId().equals(userId)) {
             throw new BusinessException("无权限");
             throw new BusinessException("无权限");
         }
         }
         if (!(asset.getStatus() == AssetStatus.NORMAL)) {
         if (!(asset.getStatus() == AssetStatus.NORMAL)) {