feat: 调整用户接口请求
This commit is contained in:
parent
9e26f62f81
commit
ddc8ff0b81
@ -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) => {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user