import { defHttp } from '/@/utils/http/axios'; import { useUserStore } from '/@/store/modules/user'; /** * 项目名称 */ export const projectName = import.meta.env.VITE_GLOB_APP_TITLE; /** * 是否开启单点登录 */ export const isOpenSSO = import.meta.env.VITE_GLOB_APP_OPEN_SSO == 'true'?true:false; export const getUserId = () => { console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ isOpenSSO:`, isOpenSSO) if(isOpenSSO){ console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ isOpenSSO1:`, isOpenSSO) const { userInfo } = useUserStore(); //正常取用户 return userInfo?.username; }else{ console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ isOpenSSO2:`, isOpenSSO) //固定某值 // return '2016900057';//教师 return '2022010920';//学生 } } //S:学生 T:教师 export const getUserSf = () => { const { userInfo } = useUserStore(); if(userInfo?.userIdentity == 1){ return 'S'; }else if(userInfo?.userIdentity == 2){ return 'T'; } } /** * 获取当前登录用户信息 */ export const getUserInfo = () => { const { userInfo } = useUserStore(); return userInfo; } // export const getSysConfig = () => defHttp.get({ url: '/kcSysConfig/kcSysConfig/queryById', params:{id:'1'} }) export const getSysConfig = () => { const { sysConfigInfo } = useUserStore(); return sysConfigInfo; }