diff --git a/ui/src/api/type/user.ts b/ui/src/api/type/user.ts index 11ca55dc7..0d608c826 100644 --- a/ui/src/api/type/user.ts +++ b/ui/src/api/type/user.ts @@ -82,7 +82,7 @@ interface ResetCurrentUserPasswordRequest { /** * 验证码 */ - code: string + code?: string /** *密码 */ diff --git a/ui/src/api/user/user-manage.ts b/ui/src/api/user/user-manage.ts index e8e869210..b2911e8b9 100644 --- a/ui/src/api/user/user-manage.ts +++ b/ui/src/api/user/user-manage.ts @@ -78,11 +78,25 @@ const resetPassword: ( return post('/user/re_password', request, undefined, loading) } +/** + * 重置密码 + * @param request 重置密码请求参数 + * @param loading 接口加载器 + * @returns + */ +const resetCurrentPassword: ( + request: ResetPasswordRequest, + loading?: Ref +) => Promise> = (request, loading) => { + return post('/user/current/reset_password', request, undefined, loading) +} + export default { getUserManage, putUserManage, delUserManage, postUserManage, putUserManagePassword, - resetPassword + resetPassword, + resetCurrentPassword } diff --git a/ui/src/layout/layout-header/avatar/ResetPassword.vue b/ui/src/layout/layout-header/avatar/ResetPassword.vue index 25cf5a169..e3fab98a3 100644 --- a/ui/src/layout/layout-header/avatar/ResetPassword.vue +++ b/ui/src/layout/layout-header/avatar/ResetPassword.vue @@ -27,51 +27,51 @@ type="password" class="input-item" v-model="resetPasswordForm.re_password" - :placeholder="$t('views.user.userForm.form.re_password.placeholder')" + :placeholder="$t('views.login.enterPassword')" show-password > - -

{{ $t('views.login.useEmail') }}

- - - - - -
- - - - {{ - isDisabled - ? `${$t('views.login.verificationCode.resend')}(${time}s)` - : $t('views.login.verificationCode.getVerificationCode') - }} - -
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/src/layout/layout-header/avatar/index.vue b/ui/src/layout/layout-header/avatar/index.vue index ee2939b7a..f89a3c08b 100644 --- a/ui/src/layout/layout-header/avatar/index.vue +++ b/ui/src/layout/layout-header/avatar/index.vue @@ -2,11 +2,11 @@
- + {{ user.userInfo?.username }} - +
@@ -15,7 +15,7 @@
- +
@@ -25,7 +25,8 @@ > {{ user.userInfo?.role[0] }} +{{ user.userInfo?.role?.length - 1 }}+{{ user.userInfo?.role?.length - 1 }} +
@@ -42,7 +43,9 @@
{{ $t('layout.language') }} - + + +
- - + +