feat: 调整用户接口请求

This commit is contained in:
liulujian 2026-06-16 03:27:14 +08:00
parent 9e26f62f81
commit ddc8ff0b81
3 changed files with 26 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import { fetchSso } from '@/core/request';
* 门户用户相关 API
*/
export const getProfile = () => {
return fetchSso({ url: '/mhzc/user/profile', method: 'GET' });
return fetchSso({ url: '/mhzc/user/init', method: 'POST' });
};
export const updateProfile = (data) => {

View File

@ -231,6 +231,7 @@ export default {
};
},
mounted() {
this.initUser();
this.loadDmList();
this.searchList();
//
@ -239,6 +240,17 @@ export default {
}
},
methods: {
async initUser() {
if (!hasLogin()) {
return;
}
try {
const { data } = await gxzxApi.init({});
window.sessionStorage.setItem('yhxx', JSON.stringify(data));
} catch (error) {
console.error('获取用户信息失败', error);
}
},
//
loadDmList() {
this.sshyoptionsSearch();

View File

@ -214,6 +214,7 @@ import NewNav from '@/pages/index/components/new-nav/index.vue';
import BreadcrumbNav from '@/pages/index/components/breadcrumb/index.vue';
import XqscPublish from './components/XqscPublish.vue';
import api from '@/pages/index/api/fwsc/index.js';
import { hasLogin } from '@/pages/index/api/login';
import { scrollPortalContentToTop } from '@/pages/index/utils/portal-scroll-mode';
import portalFigmaScaleMixin from '@/pages/index/utils/portal-figma-scale-mixin';
import comingSoonMixin from '@/pages/index/utils/coming-soon-mixin';
@ -270,6 +271,7 @@ export default {
};
},
mounted() {
this.initUser();
this.loadDmList();
this.searchList();
//
@ -278,6 +280,17 @@ export default {
}
},
methods: {
async initUser() {
if (!hasLogin()) {
return;
}
try {
const { data } = await api.init({});
window.sessionStorage.setItem('yhxx', JSON.stringify(data));
} catch (error) {
console.error('获取用户信息失败', error);
}
},
//
loadDmList() {
this.xqlxoptionsSearch();