fix(ui): 修改密码和免登录功能先灰化
This commit is contained in:
1 parent
cc53d29e76
commit
bee3139824
2 files changed
+24
-8
No files matched your search
@@ -1434,7 +1434,8 @@ const messages = {
|
|||||||
currentPassword: 'Current Password',
|
currentPassword: 'Current Password',
|
||||||
newPassword: 'New Password',
|
newPassword: 'New Password',
|
||||||
confirmPassword: 'Confirm Password',
|
confirmPassword: 'Confirm Password',
|
||||||
changePassword: 'Change Password'
|
changePassword: 'Change Password',
|
||||||
|
changePasswordContactAdmin: 'Please contact the administrator to change your password.'
|
||||||
},
|
},
|
||||||
feedback: {
|
feedback: {
|
||||||
title: 'Feedback',
|
title: 'Feedback',
|
||||||
@@ -2907,7 +2908,8 @@ const messages = {
|
|||||||
currentPassword: '当前密码',
|
currentPassword: '当前密码',
|
||||||
newPassword: '新密码',
|
newPassword: '新密码',
|
||||||
confirmPassword: '确认密码',
|
confirmPassword: '确认密码',
|
||||||
changePassword: '修改密码'
|
changePassword: '修改密码',
|
||||||
|
changePasswordContactAdmin: '请联系管理员修改'
|
||||||
},
|
},
|
||||||
feedback: {
|
feedback: {
|
||||||
title: '意见反馈',
|
title: '意见反馈',
|
||||||
@@ -4239,7 +4241,8 @@ const messages = {
|
|||||||
currentPassword: '當前密碼',
|
currentPassword: '當前密碼',
|
||||||
newPassword: '新密碼',
|
newPassword: '新密碼',
|
||||||
confirmPassword: '確認密碼',
|
confirmPassword: '確認密碼',
|
||||||
changePassword: '修改密碼'
|
changePassword: '修改密碼',
|
||||||
|
changePasswordContactAdmin: '請聯繫管理員修改'
|
||||||
},
|
},
|
||||||
feedback: {
|
feedback: {
|
||||||
title: '意見反饋',
|
title: '意見反饋',
|
||||||
@@ -5488,7 +5491,8 @@ const messages = {
|
|||||||
currentPassword: 'รหัสผ่านปัจจุบัน',
|
currentPassword: 'รหัสผ่านปัจจุบัน',
|
||||||
newPassword: 'รหัสผ่านใหม่',
|
newPassword: 'รหัสผ่านใหม่',
|
||||||
confirmPassword: 'ยืนยันรหัสผ่าน',
|
confirmPassword: 'ยืนยันรหัสผ่าน',
|
||||||
changePassword: 'เปลี่ยนรหัสผ่าน'
|
changePassword: 'เปลี่ยนรหัสผ่าน',
|
||||||
|
changePasswordContactAdmin: 'กรุณาติดต่อผู้ดูแลระบบเพื่อเปลี่ยนรหัสผ่าน'
|
||||||
},
|
},
|
||||||
feedback: {
|
feedback: {
|
||||||
title: 'ข้อเสนอแนะ',
|
title: 'ข้อเสนอแนะ',
|
||||||
|
|||||||
@@ -746,6 +746,16 @@ const isProfileLoading = ref(false);
|
|||||||
const isProfileSaving = ref(false);
|
const isProfileSaving = ref(false);
|
||||||
const isProfileEditing = ref(false);
|
const isProfileEditing = ref(false);
|
||||||
const showPasswordModal = ref(false);
|
const showPasswordModal = ref(false);
|
||||||
|
// TODO(casdoor): set true when Casdoor change-password is ready
|
||||||
|
const CHANGE_PASSWORD_ENABLED = false;
|
||||||
|
|
||||||
|
const handleChangePasswordClick = () => {
|
||||||
|
if (!CHANGE_PASSWORD_ENABLED) {
|
||||||
|
msg.warning(t('profile.changePasswordContactAdmin'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showPasswordModal.value = true;
|
||||||
|
};
|
||||||
const profileUser = ref<ProfileForm>({
|
const profileUser = ref<ProfileForm>({
|
||||||
id: 0,
|
id: 0,
|
||||||
username: '',
|
username: '',
|
||||||
@@ -1446,11 +1456,12 @@ onBeforeUnmount(() => {
|
|||||||
<label class="text-xs font-semibold text-primary uppercase ml-1">{{ $t('login.password') }}</label>
|
<label class="text-xs font-semibold text-primary uppercase ml-1">{{ $t('login.password') }}</label>
|
||||||
<input v-model="loginPassword" type="password" class="input-field" :placeholder="$t('login.placeholder.password')" @keyup.enter="handleLogin" />
|
<input v-model="loginPassword" type="password" class="input-field" :placeholder="$t('login.placeholder.password')" @keyup.enter="handleLogin" />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 30天免登录:仅控制 localStorage vs sessionStorage,与 Casdoor token 实际有效期不一致,且企微/Casdoor 登录不走此选项,暂不展示
|
||||||
<div class="flex items-center gap-2 mt-2">
|
<div class="flex items-center gap-2 mt-2">
|
||||||
<input type="checkbox" id="rememberMe" v-model="rememberMe" class="rounded border-slate-300 text-brand-600 focus:ring-brand-500 w-4 h-4" />
|
<input type="checkbox" id="rememberMe" v-model="rememberMe" class="rounded border-slate-300 text-brand-600 focus:ring-brand-500 w-4 h-4" />
|
||||||
<label for="rememberMe" class="text-sm text-secondary cursor-pointer select-none">{{ $t('login.rememberMe') }}</label>
|
<label for="rememberMe" class="text-sm text-secondary cursor-pointer select-none">{{ $t('login.rememberMe') }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
<button type="button" @click="handleLogin" class="btn-primary w-full py-3 text-base shadow-brand-500/40 hover:shadow-brand-500/50 transform hover:-translate-y-0.5 transition-all mt-4">
|
<button type="button" @click="handleLogin" class="btn-primary w-full py-3 text-base shadow-brand-500/40 hover:shadow-brand-500/50 transform hover:-translate-y-0.5 transition-all mt-4">
|
||||||
{{ $t('login.submit') }}
|
{{ $t('login.submit') }}
|
||||||
@@ -1680,13 +1691,13 @@ onBeforeUnmount(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!isMobile" class="flex shrink-0 items-center gap-2 self-start lg:ml-6">
|
<div v-if="!isMobile" class="flex shrink-0 items-center gap-2 self-start lg:ml-6">
|
||||||
<button @click="showPasswordModal = true" class="btn-primary px-6 py-3 text-base">
|
<button @click="handleChangePasswordClick" class="btn-primary px-6 py-3 text-base">
|
||||||
{{ $t('profile.changePassword') }}
|
{{ $t('profile.changePassword') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isMobile" class="mt-4 flex items-center justify-center gap-4">
|
<div v-if="isMobile" class="mt-4 flex items-center justify-center gap-4">
|
||||||
<button @click="showPasswordModal = true" class="btn-primary flex-1 py-2.5 text-sm text-center">
|
<button @click="handleChangePasswordClick" class="btn-primary flex-1 py-2.5 text-sm text-center">
|
||||||
{{ $t('profile.changePassword') }}
|
{{ $t('profile.changePassword') }}
|
||||||
</button>
|
</button>
|
||||||
<button @click="handleLogout" class="btn-secondary flex-1 py-2.5 text-sm text-center text-red-600 hover:bg-red-50">
|
<button @click="handleLogout" class="btn-secondary flex-1 py-2.5 text-sm text-center text-red-600 hover:bg-red-50">
|
||||||
@@ -2291,8 +2302,9 @@ onBeforeUnmount(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Change password modal: re-enable via CHANGE_PASSWORD_ENABLED when Casdoor is ready -->
|
||||||
<div
|
<div
|
||||||
v-if="showPasswordModal"
|
v-if="CHANGE_PASSWORD_ENABLED && showPasswordModal"
|
||||||
class="dialog-overlay z-50 items-center"
|
class="dialog-overlay z-50 items-center"
|
||||||
@click.self="showPasswordModal = false"
|
@click.self="showPasswordModal = false"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user