diff --git a/easytier-web/frontend-lib/src/locales/cn.yaml b/easytier-web/frontend-lib/src/locales/cn.yaml index b9e03753..9f3751b2 100644 --- a/easytier-web/frontend-lib/src/locales/cn.yaml +++ b/easytier-web/frontend-lib/src/locales/cn.yaml @@ -286,6 +286,9 @@ web: logout: 退出登录 language: 语言 change_password: 修改密码 + change_password_now: 立即修改密码 + default_password_warning: 当前账号仍在使用系统默认密码。为保障安全,请部署完成后立即修改密码。 + password_changed_relogin: 密码已修改,请重新登录。 device: list: 设备列表 @@ -369,6 +372,7 @@ web: change_password: 修改密码 old_password: 旧密码 new_password: 新密码 + new_password_empty: 新密码不能为空 confirm_password: 确认新密码 language: 语言 theme: 主题 diff --git a/easytier-web/frontend-lib/src/locales/en.yaml b/easytier-web/frontend-lib/src/locales/en.yaml index c614d50c..ebbc361b 100644 --- a/easytier-web/frontend-lib/src/locales/en.yaml +++ b/easytier-web/frontend-lib/src/locales/en.yaml @@ -286,6 +286,9 @@ web: logout: Logout language: Language change_password: Change Password + change_password_now: Change Password Now + default_password_warning: This account is still using the default password. Change it immediately after deployment to keep your instance secure. + password_changed_relogin: Password changed. Please log in again. device: list: Device List @@ -369,6 +372,7 @@ web: change_password: Change Password old_password: Old Password new_password: New Password + new_password_empty: New password cannot be empty confirm_password: Confirm New Password language: Language theme: Theme diff --git a/easytier-web/frontend/src/components/ChangePassword.vue b/easytier-web/frontend/src/components/ChangePassword.vue index c90a16e6..29f1be60 100644 --- a/easytier-web/frontend/src/components/ChangePassword.vue +++ b/easytier-web/frontend/src/components/ChangePassword.vue @@ -1,17 +1,52 @@ @@ -19,15 +54,17 @@ const changePassword = async () => {
- \ No newline at end of file + diff --git a/easytier-web/frontend/src/components/Login.vue b/easytier-web/frontend/src/components/Login.vue index a6f05fc0..5dd33135 100644 --- a/easytier-web/frontend/src/components/Login.vue +++ b/easytier-web/frontend/src/components/Login.vue @@ -7,6 +7,7 @@ import { I18nUtils } from 'easytier-frontend-lib'; import { getInitialApiHost, cleanAndLoadApiHosts, saveApiHost } from "../modules/api-host" import { useI18n } from 'vue-i18n' import ApiClient, { Credential, RegisterData } from '../modules/api'; +import { setMustChangePasswordFlag } from '../modules/auth-status'; const { t } = useI18n() @@ -33,6 +34,7 @@ const onSubmit = async () => { let ret = await api.value?.login(credential); if (ret.success) { localStorage.setItem('apiHost', btoa(apiHost.value)); + setMustChangePasswordFlag(Boolean(ret.mustChangePassword)); router.push({ name: 'dashboard', params: { apiHost: btoa(apiHost.value) }, diff --git a/easytier-web/frontend/src/components/MainPage.vue b/easytier-web/frontend/src/components/MainPage.vue index 0b5a335f..b56367a0 100644 --- a/easytier-web/frontend/src/components/MainPage.vue +++ b/easytier-web/frontend/src/components/MainPage.vue @@ -1,13 +1,18 @@