获取个人信息接口更换

This commit is contained in:
fan 2023-05-29 10:32:48 +08:00
parent 94fa725cc7
commit a519447c62
4 changed files with 7 additions and 10 deletions

View File

@ -111,7 +111,6 @@
import { mapGetters } from 'vuex';
import SystemTitle from './Title';
import {getSessionStorage } from '@/utils/auth';
import { ThirdLoginList } from '@/scripts/ProjectConfig';
export default {
components: {
@ -131,7 +130,7 @@ export default {
'routers'
]),
thirdLogin() {
return ThirdLoginList.includes(getSessionStorage('project'));
return this.$store.state.user.thirdLogin;
},
username() {
return this.$store.state.user.nickname;

View File

@ -891,7 +891,7 @@
// jjjlm: 'JJJLM'
// };
// /** 嵌入第三方平台 导航栏右上角 清空 */
export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy', 'richorcxjs', 'designrichorcxjs', 'richorgscm'];
// export const ThirdLoginList = ['richor', 'designrichor', 'richorygy', 'designrichorygy', 'richorcxjs', 'designrichorcxjs', 'richorgscm'];
// /** 底部栏仅展示公司信息不展示备案号 */
// export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls',
// 'designhls', 'hyd', 'designhyd', 'hydrailway', 'designhydrailway', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint', 'nologo', 'designnologo', 'richorygy',

View File

@ -1,4 +1,4 @@
import { login, logout, getInfo, preLogout } from '@/api/login';
import { login, logout, getInfo, preLogout, getLoginInfo } from '@/api/login';
import { getToken, setToken, removeToken } from '@/utils/auth';
import { LoginParams } from '@/utils/login';
import { creatSubscribe, clearSubscribe, perpetualTopic, disconnect} from '@/utils/stomp';
@ -146,8 +146,8 @@ const user = {
// 获取用户信息
GetInfo({ commit }, token) {
return new Promise((resolve, reject) => {
getInfo(token).then(response => {
const user = response.data;
getLoginInfo(token).then(response => {
const user = response.data.accountVO;
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', user.roles);
} else {
@ -163,7 +163,7 @@ const user = {
commit('SET_COMPANYADMIN', user.companyAdmin);
commit('SET_COMPANYNAME', user.companyName);
commit('SET_COMPANYPROJECTLIST', user.projectCodes);
commit('SET_THIRDLOGIN', user.thirdLogin);
commit('SET_THIRDLOGIN', response.data.thirdLogin);
resolve(user);
}).catch(error => {
reject(error);

View File

@ -28,8 +28,6 @@
</div>
</template>
<script>
import { ThirdLoginList } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth';
export default {
name:'TerminalList',
props: {
@ -57,7 +55,7 @@ export default {
return this.$store.state.training.domConfig && this.$store.state.training.domConfig.trainingDesign;
},
thirdLogin() {
return ThirdLoginList.includes(getSessionStorage('project'));
return this.$store.state.user.thirdLogin;
}
},
watch: {