|
|
@ -19,7 +19,7 @@ |
|
|
|
<ns-form |
|
|
|
style="width: 100%; margin: auto" |
|
|
|
ref="formOneRef" |
|
|
|
formLayout="修改" |
|
|
|
formLayout="vertical" |
|
|
|
:schemas="formSchema" |
|
|
|
:model="data" /> |
|
|
|
<div class="step-box"> |
|
|
@ -32,8 +32,6 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-layout-content> |
|
|
|
<a class="toLogin" @click="toLogin" v-show="step === 0">登录已有豪恩账号 ></a> |
|
|
|
<!-- <a-layout-footer>Copyright 2021 xu科技 All Rights Reserved</a-layout-footer> --> |
|
|
|
</a-layout> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -69,7 +67,7 @@ |
|
|
|
const { navigateBackV2: navigateBack } = useNavigate(); |
|
|
|
const formSchema = reactive([ |
|
|
|
{ |
|
|
|
field: 'oldPassword', |
|
|
|
field: 'originPassword', |
|
|
|
label: '原密码', |
|
|
|
component: 'NsInputPassword', |
|
|
|
componentProps: { |
|
|
@ -86,7 +84,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
field: 'newPassword', |
|
|
|
field: 'password', |
|
|
|
label: '新密码', |
|
|
|
component: 'NsInputPassword', |
|
|
|
componentProps: { |
|
|
@ -147,7 +145,7 @@ |
|
|
|
if (!value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (value !== data.newPassword) { |
|
|
|
if (value !== data.password) { |
|
|
|
return Promise.reject('两次密码不一致'); |
|
|
|
} |
|
|
|
}, |
|
|
@ -166,14 +164,14 @@ |
|
|
|
async function update() { |
|
|
|
try { |
|
|
|
const res = await http.post(configStore.updatePassWordInfo?.api, data); |
|
|
|
if (res.success) { |
|
|
|
NsMessage.success('修改成功,需重新登陆', 1, () => { |
|
|
|
Cookies.remove(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`); |
|
|
|
sessionStorage.clear(); |
|
|
|
router.push('/login'); |
|
|
|
authorizationStore.clearAuthorization(); |
|
|
|
}); |
|
|
|
} |
|
|
|
// if (res.success) { |
|
|
|
NsMessage.success('修改成功,需重新登陆', 1, () => { |
|
|
|
Cookies.remove(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`); |
|
|
|
sessionStorage.clear(); |
|
|
|
router.replace('/login'); |
|
|
|
authorizationStore.clearAuthorization(); |
|
|
|
}); |
|
|
|
// } |
|
|
|
loading.value = false; |
|
|
|
} catch (err) { |
|
|
|
loading.value = false; |
|
|
|