fix(profile): 修改密码,同步修改casdoor密码

This commit is contained in:
sophie committed 2026-06-08 13:28:18 +08:00
1 parent 0bb1946b7e
commit 2d59be2f92
9 files changed
+485 -8

No files matched your search

+9
View File
@@ -64,6 +64,15 @@ function resolveLocalizedErrorMessage(code?: string, fallbackMessage?: string):
if (normalizedCode === 'VALIDATION_INVALID_PARAM' && fallback && !isGenericFallback(fallback) && fallback !== localized) {
return `${localized} ${fallback}`;
}
if (
normalizedCode === 'AUTH_FORBIDDEN'
&& fallback
&& !isGenericFallback(fallback)
&& fallback.toLowerCase() !== 'forbidden'
&& fallback !== localized
) {
return fallback;
}
return localized;
}
if (fallback) return fallback;
+4
View File
@@ -157,6 +157,7 @@ const messages = {
codes: {
AUTH_UNAUTHORIZED: 'Please log in first.',
AUTH_INCORRECT_PASSWORD: 'Incorrect password',
AUTH_INCORRECT_CURRENT_PASSWORD: 'Incorrect current password',
AUTH_USER_NOT_FOUND: 'User not found',
AUTH_ACCOUNT_DISABLED: 'Account is disabled',
AUTH_FORBIDDEN: 'You do not have permission to perform this action.',
@@ -1651,6 +1652,7 @@ const messages = {
codes: {
AUTH_UNAUTHORIZED: '请先登录。',
AUTH_INCORRECT_PASSWORD: '密码错误',
AUTH_INCORRECT_CURRENT_PASSWORD: '当前密码不正确',
AUTH_USER_NOT_FOUND: '用户不存在',
AUTH_ACCOUNT_DISABLED: '账号已禁用',
AUTH_FORBIDDEN: '你没有权限执行该操作。',
@@ -3110,6 +3112,7 @@ const messages = {
codes: {
AUTH_UNAUTHORIZED: '請先登入。',
AUTH_INCORRECT_PASSWORD: '密碼錯誤',
AUTH_INCORRECT_CURRENT_PASSWORD: '當前密碼不正確',
AUTH_USER_NOT_FOUND: '用戶不存在',
AUTH_ACCOUNT_DISABLED: '帳號已禁用',
AUTH_FORBIDDEN: '你沒有權限執行此操作。',
@@ -4443,6 +4446,7 @@ const messages = {
codes: {
AUTH_UNAUTHORIZED: 'กรุณาเข้าสู่ระบบก่อน',
AUTH_INCORRECT_PASSWORD: 'รหัสผ่านไม่ถูกต้อง',
AUTH_INCORRECT_CURRENT_PASSWORD: 'รหัสผ่านปัจจุบันไม่ถูกต้อง',
AUTH_USER_NOT_FOUND: 'ไม่พบผู้ใช้',
AUTH_ACCOUNT_DISABLED: 'บัญชีถูกปิดใช้งาน',
AUTH_FORBIDDEN: 'คุณไม่มีสิทธิ์ดำเนินการนี้',
+3 -2
View File
@@ -746,8 +746,9 @@ const isProfileLoading = ref(false);
const isProfileSaving = ref(false);
const isProfileEditing = ref(false);
const showPasswordModal = ref(false);
// TODO(casdoor): set true when Casdoor change-password is ready
const CHANGE_PASSWORD_ENABLED = false;
const CHANGE_PASSWORD_ENABLED = true;
const handleChangePasswordClick = () => {
if (!CHANGE_PASSWORD_ENABLED) {
@@ -2302,7 +2303,7 @@ onBeforeUnmount(() => {
</div>
</div>
<!-- Change password modal: re-enable via CHANGE_PASSWORD_ENABLED when Casdoor is ready -->
<!-- Change password modal -->
<div
v-if="CHANGE_PASSWORD_ENABLED && showPasswordModal"
class="dialog-overlay z-50 items-center"