Ver Fonte

asset权限

xiongzhu há 3 anos atrás
pai
commit
7d3f6b3e50

+ 8 - 5
src/main/java/com/izouma/nineth/web/AssetController.java

@@ -103,7 +103,10 @@ public class AssetController extends BaseController {
     @GetMapping("/get/{id}")
     @JsonView(Asset.View.Basic.class)
     public Asset get(@PathVariable Long id) {
-        Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        Asset asset = assetRepo.findByIdAndUserIdAndDel(id, SecurityUtils.getAuthenticatedUser().getId(), false);
+        if (asset == null) {
+            throw new BusinessException("无记录");
+        }
         if (asset.getType().equals(CollectionType.DOMAIN)) {
             String domainName = asset.getName().substring(9);
             DomainOrder domainOrder = domainOrderRepo
@@ -168,7 +171,7 @@ public class AssetController extends BaseController {
     @ApiOperation("转赠(无gas费)")
     public GiftOrder giftWithoutGasFee(@RequestParam Long assetId, @RequestParam Long toUserId, @RequestParam String tradeCode) {
         return giftOrderService.giftWithoutGasFee(SecurityUtils.getAuthenticatedUser()
-                .getId(), assetId, toUserId, tradeCode);
+                                                               .getId(), assetId, toUserId, tradeCode);
     }
 
     @GetMapping("/tokenHistory")
@@ -233,7 +236,7 @@ public class AssetController extends BaseController {
     @PostMapping("/metaDestroy")
     public void metaDestroy(@RequestBody MetaDestroyParam metaDestroyParam) {
         assetService.metaDestroyWithoutTradeCode(metaDestroyParam, SecurityUtils.getAuthenticatedUser()
-                .getId(), OperationSource.META);
+                                                                                .getId(), OperationSource.META);
     }
 
     @ApiOperation("开盲盒")
@@ -259,7 +262,7 @@ public class AssetController extends BaseController {
             return 0;
         }
         return assetService.getRoyalties(asset.getMinterId(), asset.getRoyalties(), SecurityUtils.getAuthenticatedUser()
-                .getId());
+                                                                                                 .getId());
     }
 
     @PostMapping("/getServicecharge")
@@ -269,7 +272,7 @@ public class AssetController extends BaseController {
             return assetService.getDomainServiceCharge(SecurityUtils.getAuthenticatedUser().getId());
         }
         return assetService.getServicecharge(asset.getServiceCharge(), SecurityUtils.getAuthenticatedUser()
-                .getId());
+                                                                                    .getId());
     }
 
     @GetMapping("/hcChain")

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 1
src/main/resources/static/js/jquery.min.js


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff