Skip to content

Unsubscribe - #7358

Open
shortlight5980 wants to merge 3 commits into
labring:mainfrom
shortlight5980:unsubscribe
Open

Unsubscribe#7358
shortlight5980 wants to merge 3 commits into
labring:mainfrom
shortlight5980:unsubscribe

Conversation

@shortlight5980

Copy link
Copy Markdown
Collaborator

账号注销

  1. 增加了身份验证组件
  2. 登录、注册、找回密码接入身份验证组件
  3. 注销功能开发并接入身份验证组件

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 26.79% 2520 / 9406
🔵 Statements 26.78% 2657 / 9918
🔵 Functions 22.84% 519 / 2272
🔵 Branches 21.85% 1198 / 5482
File CoverageNo changed files found.
Generated in workflow #2172 for commit d0ee34e by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_d0ee34e82c8d9b3b9d8271ba26636ca86ce04744

🕒 Time: 2026-08-12 10:25:18 (UTC+8)

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_d0ee34e82c8d9b3b9d8271ba26636ca86ce04744

🕒 Time: 2026-08-12 10:25:49 (UTC+8)

@FinleyGe FinleyGe self-assigned this Jul 23, 2026
@shortlight5980
shortlight5980 force-pushed the unsubscribe branch 5 times, most recently from e70c91d to 73e10d4 Compare July 27, 2026 12:12
Comment thread packages/service/support/user/account/cancellation/access.ts
Comment thread packages/service/support/permission/auth/common.ts Outdated
Comment thread projects/app/src/service/support/user/login/service.ts Outdated
@shortlight5980
shortlight5980 force-pushed the unsubscribe branch 7 times, most recently from c50f765 to 2afe5c0 Compare August 10, 2026 02:30
@FinleyGe

Copy link
Copy Markdown
Collaborator

账号注销完成条件目前会漏掉非 active 的成员关系数据。

fastgpt-pro@636d08c1 中,admin/src/service/support/user/account/cancellation/finalize/cleanupTeams.ts:29-32 只对 status === active 的非 owner membership 调用 removeUserFromTeam;而该函数在 admin/src/service/support/user/controller.ts:903-912 只是把成员状态改成 leave/forbidden,不会清除 userIdnameavatar。同时 admin/src/service/support/user/account/cancellation/finalize/residualCheck.ts:24-28 只统计 active membership,因此 finalizer 会在这些个人关联仍然存在时把注销记录标记为 completed。

建议在 finalizer 中对该用户的所有非 owner membership 做删除或字段匿名化,并让 residual check 覆盖这类记录;测试应至少断言 completed 后 team_members 中不再保留原 userId、成员名称和头像。

@shortlight5980
shortlight5980 force-pushed the unsubscribe branch 2 times, most recently from 2ee08d9 to cf0ad19 Compare August 10, 2026 07:27
Comment thread .agents/design/account-verification/account- verification.md Outdated
second: number;
};

const getFormatter = (timeZone: string) =>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种东西不需要自己实现吧如果我们已经有了 date-fns 的话

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议,这段代码实际上封装了四种能力:
指定时区解析 UTC 时间;
指定时区的本地日期加减;
本地时间转 UTC;
根据本地自然日反推数据库查询范围。

可以考虑把 addLocalDays、字符串格式化等简单部分改成 date-fns,但收益有限

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

时区解析什么的这些东西需要在业务层考虑么?

Comment thread packages/global/support/user/account/cancellation/resolver.ts
Comment thread packages/global/support/user/account/cancellation/type.ts Outdated
Comment thread packages/global/support/user/account/cancellation/type.ts Outdated
Comment thread packages/service/support/permission/publish/authLink.ts
Comment thread packages/dal/redis/adapter.ts
}
},
selfCancellation: {
apis: [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 authCert 里面指定了哪些能请求通哪些不行,这个是不是就没用了?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就是靠这个指定的

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是在接口里通过 authCert 去拦截的么?这里的指定有什么用呢

Comment thread packages/service/support/user/account/cancellation/formatter.ts
Comment thread packages/service/support/user/team/delete/utils.ts
Comment thread packages/service/support/user/team/fallback.ts Outdated
Comment thread projects/app/src/service/support/mcp/utils.ts Outdated
Comment thread packages/service/support/user/team/fallback.ts
� Conflicts:
�	projects/app/src/pages/api/support/user/team/plan/getTeamPlanStatus.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants