清除密码

This commit is contained in:
tianmo committed 2026-10-19 16:27:48 +08:00
1 parent 366b8a4272
commit dd0005b7ba
2 files changed
+16 -2

No files matched your search

@@ -11,6 +11,9 @@ export default defineEventHandler(async (event) => {
if (!target) {
createApiError(event, 'INVALID_REQUEST', '用户不存在', 404)
}
if (target.role === 'admin') {
createApiError(event, 'FORBIDDEN', '不允许清除管理员账号', 403)
}
if (target.id === operator.id) {
createApiError(event, 'INVALID_REQUEST', '不能清除自己的密码', 400)
}