Browse Source

fix(api): ensureFamily改为静默兜底,移除误导性的家庭创建成功提示

家庭在注册时已由后端创建,此函数仅作为无家庭用户的静默兜底;错误提示保留

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 4 weeks ago
parent
commit
2e3e5a9a88
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cfc-frontend/utils/api.js

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

@@ -250,6 +250,8 @@ export const createFamily = (name) => {
 }
 
 // 确保家庭已存在:无家庭则自动创建(默认名)
+// 注意:家庭在用户注册时已由后端创建,此函数仅作静默兜底,成功时不弹提示
+// (此前弹『家庭创建成功』toast 会误导用户,已移除;错误仍会提示)
 export const ensureFamily = () => {
 	var ui = uni.getStorageSync('userInfo') || {}
 	if (ui.familyId) return Promise.resolve({ alreadyExists: true, familyId: ui.familyId })
@@ -259,7 +261,6 @@ export const ensureFamily = () => {
 			ui.familyId = res.data
 			uni.setStorageSync('userInfo', ui)
 			try { getApp().$store.commit('setFamilyId', res.data) } catch (e) {}
-			uni.showToast({ title: '家庭创建成功', icon: 'success' })
 			return { created: true, familyId: res.data }
 		}
 		throw new Error((res && res.message) || '创建失败')