2023-04-10 23:14:07 +08:00
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
2023-04-18 21:17:10 +08:00
|
|
|
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;
|
2023-04-10 23:14:07 +08:00
|
|
|
|
2023-04-06 00:45:01 +08:00
|
|
|
export const getUserId = () => {
|
2023-04-18 21:17:10 +08:00
|
|
|
if(isOpenSSO){
|
|
|
|
const { userInfo } = useUserStore();
|
|
|
|
//正常取用户
|
|
|
|
return userInfo?.username;
|
|
|
|
}else{
|
|
|
|
//固定某值
|
|
|
|
return '2016900057';
|
|
|
|
}
|
2023-04-18 23:54:12 +08:00
|
|
|
}
|
|
|
|
|
2023-04-18 21:17:10 +08:00
|
|
|
//S:学生 T:教师
|
2023-04-18 23:54:12 +08:00
|
|
|
export const getUserSf = () => {
|
2023-04-18 21:17:10 +08:00
|
|
|
const { userInfo } = useUserStore();
|
|
|
|
if(userInfo?.userIdentity == 1){
|
|
|
|
return 'S';
|
|
|
|
}else if(userInfo?.userIdentity == 2){
|
|
|
|
return 'T';
|
|
|
|
}
|
2023-04-10 23:14:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// export const getSysConfig = () => defHttp.get({ url: '/kcSysConfig/kcSysConfig/queryById', params:{id:'1'} })
|
2023-04-18 21:17:10 +08:00
|
|
|
export const getSysConfig = () => {
|
|
|
|
const { sysConfigInfo } = useUserStore();
|
|
|
|
return sysConfigInfo;
|
|
|
|
}
|