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',
|
||||
newPassword: 'New Password',
|
||||
confirmPassword: 'Confirm Password',
|
||||
changePassword: 'Change Password'
|
||||
changePassword: 'Change Password',
|
||||
changePasswordContactAdmin: 'Please contact the administrator to change your password.'
|
||||
},
|
||||
feedback: {
|
||||
title: 'Feedback',
|
||||
@@ -2907,7 +2908,8 @@ const messages = {
|
||||
currentPassword: '当前密码',
|
||||
newPassword: '新密码',
|
||||
confirmPassword: '确认密码',
|
||||
changePassword: '修改密码'
|
||||
changePassword: '修改密码',
|
||||
changePasswordContactAdmin: '请联系管理员修改'
|
||||
},
|
||||
feedback: {
|
||||
title: '意见反馈',
|
||||
@@ -4239,7 +4241,8 @@ const messages = {
|
||||
currentPassword: '當前密碼',
|
||||
newPassword: '新密碼',
|
||||
confirmPassword: '確認密碼',
|
||||
changePassword: '修改密碼'
|
||||
changePassword: '修改密碼',
|
||||
changePasswordContactAdmin: '請聯繫管理員修改'
|
||||
},
|
||||
feedback: {
|
||||
title: '意見反饋',
|
||||
@@ -5488,7 +5491,8 @@ const messages = {
|
||||
currentPassword: 'รหัสผ่านปัจจุบัน',
|
||||
newPassword: 'รหัสผ่านใหม่',
|
||||
confirmPassword: 'ยืนยันรหัสผ่าน',
|
||||
changePassword: 'เปลี่ยนรหัสผ่าน'
|
||||
changePassword: 'เปลี่ยนรหัสผ่าน',
|
||||
changePasswordContactAdmin: 'กรุณาติดต่อผู้ดูแลระบบเพื่อเปลี่ยนรหัสผ่าน'
|
||||
},
|
||||
feedback: {
|
||||
title: 'ข้อเสนอแนะ',
|
||||
|
||||
@@ -746,6 +746,16 @@ 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 handleChangePasswordClick = () => {
|
||||
if (!CHANGE_PASSWORD_ENABLED) {
|
||||
msg.warning(t('profile.changePasswordContactAdmin'));
|
||||
return;
|
||||
}
|
||||
showPasswordModal.value = true;
|
||||
};
|
||||
const profileUser = ref<ProfileForm>({
|
||||
id: 0,
|
||||
username: '',
|
||||
@@ -1446,11 +1456,12 @@ onBeforeUnmount(() => {
|
||||
<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" />
|
||||
</div>
|
||||
|
||||
<!-- 30天免登录:仅控制 localStorage vs sessionStorage,与 Casdoor token 实际有效期不一致,且企微/Casdoor 登录不走此选项,暂不展示
|
||||
<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" />
|
||||
<label for="rememberMe" class="text-sm text-secondary cursor-pointer select-none">{{ $t('login.rememberMe') }}</label>
|
||||
</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">
|
||||
{{ $t('login.submit') }}
|
||||
@@ -1680,13 +1691,13 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
</div>
|
||||
<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') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<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') }}
|
||||
</button>
|
||||
<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>
|
||||
|
||||
<!-- Change password modal: re-enable via CHANGE_PASSWORD_ENABLED when Casdoor is ready -->
|
||||
<div
|
||||
v-if="showPasswordModal"
|
||||
v-if="CHANGE_PASSWORD_ENABLED && showPasswordModal"
|
||||
class="dialog-overlay z-50 items-center"
|
||||
@click.self="showPasswordModal = false"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user