Browse Source

fix: 移除无家庭时的创建或加入家庭弹窗(5001 仅拒绝请求)

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
asus 3 months ago
parent
commit
e9e1e2803d
1 changed files with 1 additions and 18 deletions
  1. 1 18
      cfc-frontend/utils/api.js

+ 1 - 18
cfc-frontend/utils/api.js

@@ -22,22 +22,6 @@ function _clearAuthAndRedirect() {
   }, 1500)
 }
 
-function _showNoFamilyDialog() {
-  uni.showModal({
-    title: '请先创建或加入家庭',
-    content: '您需要加入一个家庭才能使用全部功能。请选择:',
-    confirmText: '创建家庭',
-    cancelText: '加入家庭',
-    success: function(r) {
-      if (r.confirm) {
-        uni.navigateTo({ url: '/pages/profile-extra/family-members?action=create' })
-      } else if (r.cancel) {
-        uni.navigateTo({ url: '/pages/profile-extra/family-members' })
-      }
-    }
-  })
-}
-
 const request = (url, method = 'POST', data = {}, options = {}) => {
   // Append query params from options to URL if provided (e.g., { guideId } for GET requests)
   if (options && Object.keys(options).length > 0) {
@@ -68,10 +52,9 @@ const request = (url, method = 'POST', data = {}, options = {}) => {
           reject(res.data)
           return
         }
-        // 5001: 用户无家庭 — 弹出创建/加入家庭对话框
+        // 5001: 用户无家庭 — 仅拒绝请求,不再弹创建/加入家庭对话框
         if (res.data.code === 5001) {
           console.warn('[API] 5001 ' + method + ' ' + fullUrl + ' — 无家庭')
-          _showNoFamilyDialog()
           reject(res.data)
           return
         }