perf: 取消改密码,返回默认页面

main
LiaoYijun 2 months ago
parent af209f94c2
commit d33ef7c560

@ -9,7 +9,10 @@ function ChangePassword() {
const { t } = useTranslation()
const navigate = useNavigate()
const changeUserPassword = useAuthStore((state) => state.changeUserPassword)
const [changeUserPassword, defaultRoute] = useAuthStore((state) => [
state.changeUserPassword,
state.defaultRoute,
])
const { notification } = App.useApp()
const [form] = Form.useForm()
@ -94,7 +97,7 @@ function ChangePassword() {
<Button type="primary" htmlType="submit">
{t('Submit')}
</Button>
<Button onClick={() => navigate('/account/profile')}>
<Button onClick={() => navigate(defaultRoute)}>
{t('Cancel')}
</Button>
</Space>

Loading…
Cancel
Save