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: { updatePassWordInfo: {
title: '修改密码', title: '修改密码',
subtitle: 'huaxing平台', subtitle: 'huaxing平台',
api: '/carbon-smart/api/user/password', api: '/carbon-smart/api/user/update/password',
}, },
// headerBellInfo: { // headerBellInfo: {
// isShow: true, // isShow: true,

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

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

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

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

Loading…
Cancel
Save