Browse Source

feat: 修改密码

deploy-dev
xuziqiang 2 months ago
parent
commit
48569345aa
  1. 2
      hx-ai-intelligent/src/config/app.config.ts
  2. 4
      hx-op/src/config/app.config.ts
  3. 26
      lib/saas/view/service/updatePassWord.vue

2
hx-ai-intelligent/src/config/app.config.ts

@ -103,7 +103,7 @@ export const appConfig = {
updatePassWordInfo: {
title: '修改密码',
subtitle: 'huaxing平台',
api: '/carbon-smart/api/user/password',
api: '/carbon-smart/api/user/update/password',
},
// headerBellInfo: {
// isShow: true,

4
hx-op/src/config/app.config.ts

@ -89,8 +89,8 @@ export const appConfig = {
// 修改密码配置
updatePassWordInfo: {
title: '修改密码',
subtitle: 'huaxing平台',
api: '/api/web/objs/User/changePassword',
subtitle: 'huaxing管理平台',
api: '/carbon-smart/api/user/update/password',
},
// headerBellInfo: {
// isShow: true,

26
lib/saas/view/service/updatePassWord.vue

@ -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;

Loading…
Cancel
Save