瀏覽代碼

fix(backend): 邀请接口相关修复

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Xiaogang Liao 3 月之前
父節點
當前提交
72d3e0f495
共有 1 個文件被更改,包括 6 次插入 和 2 次删除
  1. 6 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/InviteController.java

+ 6 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/InviteController.java

@@ -29,8 +29,12 @@ public class InviteController {
         if (userId == null || userId <= 0) {
             return Result.error("请先登录");
         }
-        String code = commissionService.getOrCreateReferralCode(userId);
-        return Result.success(code);
+        try {
+            String code = commissionService.getOrCreateReferralCode(userId);
+            return Result.success(code);
+        } catch (RuntimeException e) {
+            return Result.error(e.getMessage());
+        }
     }
 
     @PostMapping("/bind")