|
|
// 引用Cookie
|
|
|
import Cookie from './cookie';
|
|
|
// 引用公共方法
|
|
|
import PublicFn from './public';
|
|
|
import interfaceConfig from './axios-config';
|
|
|
import Base64 from './base64'
|
|
|
const isSZUpload = true;//是否使用苏州版本上传附件地址
|
|
|
const isCloud = true;//是否云环境 插入图片资源接口路径切换
|
|
|
PublicFn.isSZUpload = isSZUpload;
|
|
|
PublicFn.isCloud = isCloud;
|
|
|
/**
|
|
|
* 配置信息 - 公共方法
|
|
|
* @type {{}}
|
|
|
*/
|
|
|
const ConfigFn = {
|
|
|
getContextHtmlPath: () => {//获取桶名信息
|
|
|
// eslint-disable-next-line no-debugger
|
|
|
let pathName = document.location.pathname;
|
|
|
let index = pathName.substr(1).indexOf("/");
|
|
|
let result = pathName.substr(0, index + 1);
|
|
|
if (result != "/dsideal_yy") {
|
|
|
result = pathName.substr(0, 0);
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
|
/**
|
|
|
* 获取host路径,Ip+端口
|
|
|
* https协议需要优化
|
|
|
*/
|
|
|
getServerUrl: () => {
|
|
|
return document.location.origin;
|
|
|
},
|
|
|
/**
|
|
|
* 自url地址后面获取需要的参数值
|
|
|
* @param name
|
|
|
* @returns {null}
|
|
|
*/
|
|
|
getQueryString: (name) => {
|
|
|
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
let r = window.location.search.substr(1).match(reg);
|
|
|
if (r !== null)
|
|
|
return unescape(r[2]);
|
|
|
return null;
|
|
|
},
|
|
|
/**
|
|
|
* 设置登录用户角色信息对象,
|
|
|
* 1:是否为当前角色下的管理员;是:true;否:false
|
|
|
* 2:是否为当前角色下的班主任;是:true;否:false
|
|
|
* @param _type:单位id;101 - 省;102 - 市;103 - 区/县;104 - 校;
|
|
|
*/
|
|
|
checkYthRole: (_type) => {
|
|
|
_type = Number(_type);
|
|
|
// 定义role对象
|
|
|
let _userRole = {
|
|
|
isAdmin: false,// 是否为管理员
|
|
|
isTeachDirector: false,//教务管理
|
|
|
isClassDirector: false // 是否为班主任
|
|
|
};
|
|
|
// 获取role列表
|
|
|
let _roles = BaseConfig.person_info_my.roles;
|
|
|
if (_roles && _roles.length > 0) {
|
|
|
// 循环遍历
|
|
|
for (let i = 0; i < _roles.length; i++) {
|
|
|
// 判断是否为省级管理员
|
|
|
if (_type === 101 && _roles[i].role_code === "PROVINCE_BUREAU_ADMIN") {
|
|
|
_userRole.isAdmin = true;
|
|
|
}
|
|
|
// 判断是否为市级管理员
|
|
|
if (_type === 102 && _roles[i].role_code === "CITY_BUREAU_ADMIN") {
|
|
|
_userRole.isAdmin = true;
|
|
|
|
|
|
}
|
|
|
// 判断是否为区/县管理员
|
|
|
if (_type === 103 && _roles[i].role_code === "DISTRICT_BUREAU_ADMIN") {
|
|
|
_userRole.isAdmin = true;
|
|
|
|
|
|
}
|
|
|
// 判断是否为校级管理员
|
|
|
if (_type === 104 && _roles[i].role_code === "SCHOOL_ADMIN") {
|
|
|
_userRole.isAdmin = true;
|
|
|
|
|
|
}
|
|
|
// 是否为当前学校下的教务主任
|
|
|
if (_type === 104 && _roles[i].role_code === "GLRJ_JWCZR") {
|
|
|
_userRole.isTeachDirector = true;
|
|
|
}
|
|
|
|
|
|
if (_type === 104 && _roles[i].role_code === "BZR") {
|
|
|
_userRole.isClassDirector = true;
|
|
|
}
|
|
|
|
|
|
if ((_type === 108 || _type === 109 || _type === 110) && _roles[i].role_code === "EDUASSIST_BUREAU_ADMIN") {
|
|
|
_userRole.isAdmin = true;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
// 返回
|
|
|
return _userRole;
|
|
|
},
|
|
|
/**
|
|
|
* 获取登录用户权限数据
|
|
|
*/
|
|
|
getPersonInfo_I: () => {
|
|
|
if (Cookie.get("person_id")) {
|
|
|
let _param = {
|
|
|
"person_id": BaseConfig.userInfo.person_id_cookie,
|
|
|
"identity_id": BaseConfig.userInfo.identity_id_cookie
|
|
|
};
|
|
|
let _person_info_my = {};
|
|
|
// 请求接口路径
|
|
|
let url = "";
|
|
|
if(isSZUpload){
|
|
|
url = "intellioa/sys/cloudPlatform/getPersonInfo";
|
|
|
}else {
|
|
|
url = "person/getPersonInfo";
|
|
|
}
|
|
|
interfaceConfig.callInterface([{
|
|
|
//url: "person/getPersonInfo",
|
|
|
url: url,
|
|
|
method: "get",
|
|
|
params: _param,
|
|
|
isTestLogin: true
|
|
|
}], (result) => {
|
|
|
if (result[0].status === 200) {
|
|
|
let data = result[0].data;
|
|
|
// eslint-disable-next-line no-debugger
|
|
|
// 标识是否获取
|
|
|
BaseConfig.personInfoMy = true;
|
|
|
// 处理用户相关信息 - 临时保存
|
|
|
_person_info_my['person_name'] = data.table_List.person_name;
|
|
|
_person_info_my['sheng_id'] = data.table_List.province_id;
|
|
|
_person_info_my['sheng_name'] = data.table_List.province_name;
|
|
|
_person_info_my['shi_id'] = data.table_List.city_id;
|
|
|
_person_info_my['shi_name'] = data.table_List.city_name;
|
|
|
_person_info_my['qu_id'] = data.table_List.district_id;
|
|
|
_person_info_my['qu_name'] = data.table_List.district_name;
|
|
|
_person_info_my['bureau_id'] = data.table_List.bureau_id;
|
|
|
_person_info_my['bureau_name'] = data.table_List.bureau_name;
|
|
|
_person_info_my['login_name'] = data.table_List.login_name;
|
|
|
_person_info_my['tel'] = data.table_List.TEL;
|
|
|
_person_info_my['email'] = data.table_List.email || data.table_List.EMAIL;
|
|
|
_person_info_my['identity_num'] = data.table_List.identity_num;
|
|
|
_person_info_my['dep_id'] = data.table_List.dep_id;
|
|
|
_person_info_my['dep_name'] = data.table_List.dep_name;
|
|
|
_person_info_my['branch_school'] = data.table_List.branch_school;
|
|
|
_person_info_my['school_type'] = data.table_List.school_type;
|
|
|
if (data.table_List.bureau_type === 2) {
|
|
|
_person_info_my['xiao_id'] = data.table_List.bureau_id;
|
|
|
_person_info_my['xiao_name'] = data.table_List.bureau_name;
|
|
|
_person_info_my['bureau_iid'] = 104;
|
|
|
} else if (data.table_List.bureau_type === 7) {//教辅单位
|
|
|
// let _url_tea = BaseConfig.url_path_action_login + "/admin/new_base/getLevelOfJf";
|
|
|
// 创建common实体类
|
|
|
let _param_tea = { "org_id": parseInt(_person_info_my['bureau_id']) };
|
|
|
// let _common_tea = new Common(_url_tea, _param_tea);
|
|
|
interfaceConfig.callInterface([{
|
|
|
// url: "admin/new_base/getLevelOfJf",
|
|
|
url: "intellioa/sys/cloudPlatform/getLevelOfJf",
|
|
|
method: "get",
|
|
|
params: _param_tea,
|
|
|
isTestLogin: true
|
|
|
}], (data_tea) => {
|
|
|
if (data_tea[0].success) {
|
|
|
if (data_tea.level === 1) {//省级教辅单位
|
|
|
_person_info_my['bureau_iid'] = 110;
|
|
|
BaseConfig.person_info_my['bureau_iid'] = 110;
|
|
|
if (window.person_info_my) {
|
|
|
window.person_info_my["bureau_iid"] = 110;
|
|
|
} else {
|
|
|
window.person_info_my = { "bureau_iid": 110 };
|
|
|
}
|
|
|
} else if (data_tea.level === 2) {//市级教辅单位
|
|
|
_person_info_my['bureau_iid'] = 109;
|
|
|
BaseConfig.person_info_my['bureau_iid'] = 109;
|
|
|
if (window.person_info_my) {
|
|
|
window.person_info_my["bureau_iid"] = 109;
|
|
|
} else {
|
|
|
window.person_info_my = { "bureau_iid": 109 };
|
|
|
}
|
|
|
} else if (data_tea.level === 3) {//区级教辅单位
|
|
|
_person_info_my['bureau_iid'] = 108;
|
|
|
BaseConfig.person_info_my['bureau_iid'] = 108;
|
|
|
if (window.person_info_my) {
|
|
|
window.person_info_my["bureau_iid"] = 108;
|
|
|
} else {
|
|
|
window.person_info_my = { "bureau_iid": 108 };
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
switch (_person_info_my['bureau_id']) {
|
|
|
case _person_info_my['sheng_id']:
|
|
|
_person_info_my['bureau_iid'] = 101;
|
|
|
break;
|
|
|
case _person_info_my['shi_id']:
|
|
|
_person_info_my['bureau_iid'] = 102;
|
|
|
break;
|
|
|
case _person_info_my['qu_id']:
|
|
|
_person_info_my['bureau_iid'] = 103;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
_person_info_my['roles'] = data.table_List.roles;
|
|
|
_person_info_my['cur_role'] = data.table_List.roles[0];
|
|
|
_person_info_my['personlogin_name'] = data.table_List.login_name;
|
|
|
_person_info_my['person_name'] = data.table_List.person_name;
|
|
|
if (BaseConfig.userInfo.identity_id_cookie === 6) {
|
|
|
_person_info_my['class_id'] = data.table_List.class_id;
|
|
|
_person_info_my['class_name'] = data.table_List.class_name;
|
|
|
}
|
|
|
if (BaseConfig.userInfo.identity_id_cookie === 7) {
|
|
|
_person_info_my['student_id'] = data.table_List.student_id;
|
|
|
_person_info_my['class_id'] = data.table_List.class_id;
|
|
|
_person_info_my['class_name'] = data.table_List.class_name;
|
|
|
}
|
|
|
|
|
|
//兼容移动端(微信、App)cookie中没有值得问题
|
|
|
// if (isShowInMobile){
|
|
|
// let token = Cookie.get("token");
|
|
|
let Days = 30 * 12; //cookie 将被保存一年
|
|
|
let exp = new Date(); //获得当前时间
|
|
|
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000); //换成毫秒
|
|
|
Cookie.set("person_name", Base64.encode(data.table_List.person_name));
|
|
|
Cookie.set("token", data.table_List.token);
|
|
|
// }
|
|
|
//兼容结束
|
|
|
BaseConfig.userInfo.person_name_cookie = data.table_List.person_name;
|
|
|
BaseConfig.userInfo.person_name = data.table_List.person_name;
|
|
|
BaseConfig.person_info_my = PublicFn.extendedObject(BaseConfig.person_info_my, _person_info_my);
|
|
|
window.person_info_my = BaseConfig.person_info_my
|
|
|
|
|
|
if (!BaseConfig.pt_type || BaseConfig.pt_type === "") {
|
|
|
interfaceConfig.callInterface([{
|
|
|
url: 'golbal/getValueByKey',
|
|
|
//url:"intellioa/sys/cloudPlatform/getValueByKey",
|
|
|
params: { key: 'common.server.location' },
|
|
|
method: 'get',
|
|
|
isTestLogin: false
|
|
|
}], (res) => {
|
|
|
if (res[0].status === 200) {
|
|
|
let env = res[0].data;
|
|
|
BaseConfig.pt_type = env["common.server.location"];
|
|
|
window.pt_type = env["common.server.location"]
|
|
|
BaseConfig.ConfigFn.setParamsValue();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
/*
|
|
|
* 设置依赖于pt_type的公共变量的值
|
|
|
* */
|
|
|
setParamsValue: () => {
|
|
|
// 判断云板还是局版,并配置相关地址
|
|
|
if (BaseConfig.pt_type === "1") {
|
|
|
//素材服务器IP地址
|
|
|
// BaseConfig.url_path_down = "http://dsideal-yy.oss-cn-qingdao.aliyuncs.com/";
|
|
|
BaseConfig.url_path_down = window.location.protocol + "//video.edusoa.com/";
|
|
|
//资源上传地址
|
|
|
// BaseConfig.url_path = "http://dsideal-yy.oss-cn-qingdao.aliyuncs.com";
|
|
|
BaseConfig.url_path = "https://dsideal.obs.cn-north-1.myhuaweicloud.com";
|
|
|
//资源上传地址后缀
|
|
|
BaseConfig.url_path_suffix = "down/Material/";
|
|
|
//图片预览地址
|
|
|
BaseConfig.url_path_img = "down/Material/";
|
|
|
//上传地址(缩略图等)
|
|
|
// BaseConfig.url_path_other = "http://dsideal-yy.oss-cn-qingdao.aliyuncs.com";
|
|
|
BaseConfig.url_path_other = "https://dsideal.obs.cn-north-1.myhuaweicloud.com";
|
|
|
//游戏资源地址 周枫
|
|
|
BaseConfig.url_path_game = "down/Game/";
|
|
|
//专题资源地址 周枫
|
|
|
BaseConfig.url_path_zt = "down/Zhuanti/";
|
|
|
//图片预览压缩请求地址
|
|
|
BaseConfig.STATIC_IMAGE_PRE = window.location.protocol + "//image.edusoa.com/";
|
|
|
//专题资源地址 wzt
|
|
|
BaseConfig.zt_url_path_down = 'down/Zhuanti/';
|
|
|
|
|
|
BaseConfig.game_url_path_down = 'down/Game/';
|
|
|
//微课app
|
|
|
BaseConfig.wkapp_url_path_down = 'down/dzsb/apk/';
|
|
|
//游戏移动端 apk ios windows
|
|
|
BaseConfig.game_app_url_path_down = 'down/App/';
|
|
|
} else {
|
|
|
//图片上传地址(头像等)
|
|
|
BaseConfig.url_path_img_head = "down/Image/";
|
|
|
|
|
|
BaseConfig.url_path_down = BaseConfig.url_path_html + "/html/";// demo:/dsideal_yy/html/
|
|
|
//局版资源上传路径 周枫
|
|
|
BaseConfig.url_path_suffix = "down/Material/";
|
|
|
if(isSZUpload){
|
|
|
BaseConfig.url_path = BaseConfig.url_path_action_login + "/dsideal_yy/ypt/intellioa/java/sys/cloudPlatform/plupload";
|
|
|
}else {
|
|
|
BaseConfig.url_path = BaseConfig.url_path_action_login + "/res/plupload/";
|
|
|
}
|
|
|
//局版图片预览路径 周枫
|
|
|
BaseConfig.url_path_img = "thumb/Material/";
|
|
|
//图片预览压缩请求地址
|
|
|
BaseConfig.STATIC_IMAGE_PRE = BaseConfig._action_path + "/dsideal_yy/html/";
|
|
|
|
|
|
BaseConfig.zt_url_path_down = 'down/Zhuanti/';
|
|
|
|
|
|
BaseConfig.game_url_path_down = 'down/Game/';
|
|
|
//微课app
|
|
|
BaseConfig.wkapp_url_path_down = 'down/dzsb/apk/';
|
|
|
//游戏移动端 apk ios windows
|
|
|
BaseConfig.game_app_url_path_down = 'down/App/';
|
|
|
}
|
|
|
/*** 相关参数配置信息 - 如:是局版还是云版 -- end **************/
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
|
* 配置信息
|
|
|
* @type {{}}
|
|
|
*/
|
|
|
const BaseConfig = {
|
|
|
version: "v1.0.0",// 版本号
|
|
|
isLogin: false, // 是否登录
|
|
|
page_number: 1,// 默认分页数,第几页
|
|
|
showCount: 10,// 显示的分页块数
|
|
|
page_size: 10// 分页时每页显示的条数
|
|
|
};
|
|
|
/**
|
|
|
* 当前登录用户的person_id和identity_id
|
|
|
*/
|
|
|
BaseConfig.userInfo = {
|
|
|
// 用户id
|
|
|
person_id: Cookie.get("person_id"),
|
|
|
person_id_cookie: Cookie.get("person_id"),
|
|
|
// 登录用户名称
|
|
|
person_name_cookie: Cookie.get("person_name"),
|
|
|
// 用户角色
|
|
|
identity_id: Cookie.get("identity_id"),
|
|
|
identity_id_cookie: Cookie.get("identity_id")
|
|
|
};
|
|
|
/**
|
|
|
* 当前登录人信息对象数据,该参数中包含当前登录人的所有数据
|
|
|
* @type {{}}
|
|
|
*/
|
|
|
BaseConfig.person_info_my = {
|
|
|
spatialProperties: "",// 空间属性;student - 学生空间;teacher - 教师空间;bureauEdu - 局空间
|
|
|
loginUserRole: { // 登录用户角色信息对象
|
|
|
isAdmin: false,// 当前登录用户是否为当前角色下的管理员,默认false
|
|
|
isTeachDirector: false,// 当前登录用户是否为当前学校下的教务主任,默认false
|
|
|
isClassDirector: false // 当前登录用户是否为当前角色下的班主任。默认false
|
|
|
},
|
|
|
admin_list: [],// 管辖范围 - 地区结构管理员
|
|
|
bureau_id: "",// 所属单位id
|
|
|
bureau_iid: "",// 所属单位类型;100 - 全国;101 - 省;102 - 市;103 - 区/县;104 - 校;105 - 班
|
|
|
bureau_name: "",// 所属单位名称
|
|
|
email: "",// 邮件
|
|
|
dep_id: "",//部门id
|
|
|
dep_name: "",//部门名称
|
|
|
identity_num: "",// 用户身份id
|
|
|
isTeacherRole: "",// 是否是教职工
|
|
|
login_name: "",// 登录用户名
|
|
|
person_name: "",// 用户名
|
|
|
personlogin_name: "",//
|
|
|
class_id: "",// 所属班级id
|
|
|
qu_id: "",// 所属区id
|
|
|
qu_name: "",// 所属区名称
|
|
|
roles: [],// 角色列表
|
|
|
cur_role: null,//当前角色
|
|
|
sheng_id: "",// 所属省id
|
|
|
sheng_name: "",// 所属省名称
|
|
|
shi_id: "",// 所属市id
|
|
|
shi_name: "",// 所属市名称
|
|
|
space_avatar_fileid: "",// 头像图片地址
|
|
|
tel: "",// 电话号码
|
|
|
topOrgIid: "", // 最高部署级别;表示100 - 全国;101 - 省;102 - 市;103 - 区/县;104 - 校
|
|
|
xiao_id: "",// 所属校id
|
|
|
xiao_name: "",// 所属校名称
|
|
|
branch_school: []//分校数组
|
|
|
};
|
|
|
// 用来标识是否获取了personInfo信息
|
|
|
BaseConfig.personInfoMy = false;
|
|
|
/*** 相关参数配置信息 - 如:是局版还是云版 -- start **************/
|
|
|
// 页面链接地址
|
|
|
BaseConfig.url_path_html = ConfigFn.getContextHtmlPath();
|
|
|
// 路径一级域名
|
|
|
BaseConfig.url_origin = window.location.origin + "/";
|
|
|
// contextpath
|
|
|
BaseConfig.contextpath = ConfigFn.getContextHtmlPath();
|
|
|
//未登录时调用的action路径
|
|
|
BaseConfig.url_path_action_login = BaseConfig.contextpath;
|
|
|
// 前台action路径
|
|
|
BaseConfig.url_path_action = BaseConfig.contextpath + "/ypt";
|
|
|
//后台action路径
|
|
|
BaseConfig.url_path_action_ht = BaseConfig.contextpath + "/management";
|
|
|
//访问地址(后台上传后跳转的action用到)
|
|
|
BaseConfig._action_path = ConfigFn.getServerUrl();
|
|
|
// 展示空间主页面地址
|
|
|
BaseConfig.spaceMainUrl = BaseConfig.url_path_html + "/html/space/main/main.html";
|
|
|
|
|
|
// 云版还是局版,配置参数;获取该字段参
|
|
|
// 数值,调用的接口需要在外部调用
|
|
|
BaseConfig.pt_type = "";
|
|
|
// 判断是否获取父页面中的top.window.pt_type
|
|
|
if (top.window) {
|
|
|
BaseConfig.pt_type = top.window.pt_type;
|
|
|
ConfigFn.setParamsValue();
|
|
|
}
|
|
|
|
|
|
/*********************** 管理软件配置信息 -- start *****************/
|
|
|
BaseConfig.managementInfo = {
|
|
|
// 基础数据
|
|
|
baseServer_url: BaseConfig.url_path_html + "/base-server/a",
|
|
|
// 学生评价
|
|
|
xspj_url: BaseConfig.url_path_html + "/business_xspj_interface/a",
|
|
|
// 排选课
|
|
|
jwgl_url: BaseConfig.url_path_html + "/business_jwgl_interface/a"
|
|
|
};
|
|
|
/*********************** 统计分析平台配置信息 -- start *****************/
|
|
|
BaseConfig.statisticalInfo = {
|
|
|
// 基础信息模块
|
|
|
baseInfoUrl: BaseConfig.url_path_html + "/dsideal_bda/baseinfo"
|
|
|
};
|
|
|
|
|
|
/*************************** 以下处理BaseConfig中相关参数的业务逻辑 --- start ********************************/
|
|
|
|
|
|
/********* 判断当前访问的用户信息,并保存 ****************/
|
|
|
if (ConfigFn.getQueryString("id") !== null && ConfigFn.getQueryString("identity_id") !== null) {
|
|
|
BaseConfig.userInfo.person_id = ConfigFn.getQueryString("id");
|
|
|
BaseConfig.userInfo.identity_id = ConfigFn.getQueryString("identity_id");
|
|
|
}
|
|
|
/********************* 根据当前cookie判断是否登录,如果未登录并记录 *********************/
|
|
|
if (Cookie.get("person_id") !== null && Cookie.get("person_id") !== undefined && Cookie.get("person_id") !== "") {
|
|
|
BaseConfig.isLogin = true;
|
|
|
} else {
|
|
|
BaseConfig.isLogin = false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取当前登录用户的信息对象
|
|
|
* 1:判断当前项目是否被iframe嵌入到空间框架中,如果被嵌入,person_info_my对象信息数据从外部获取,如果获取到则不调用接口获取数据
|
|
|
* 2: 如果没有被嵌入则调取接口,获取当前登录用户信息数据
|
|
|
*/
|
|
|
if (!BaseConfig.personInfoMy) {
|
|
|
if (top.window && top.window.person_info_my) {
|
|
|
BaseConfig.person_info_my = top.window.person_info_my;
|
|
|
BaseConfig.person_info_my['cur_role'] = BaseConfig.person_info_my.roles[0];
|
|
|
window.person_info_my = top.window.person_info_my;
|
|
|
// 标识是否获取
|
|
|
BaseConfig.personInfoMy = true;
|
|
|
} else {
|
|
|
// 获取登录用户信息权限
|
|
|
ConfigFn.getPersonInfo_I();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 判断当前空间属性,是学生空间、教职工空间还是局版空间
|
|
|
* 规则:
|
|
|
* 判断Cookie中的identityId - BaseConfig.userInfo.identity_id_cookie;该值有可能为字符串或者整形,所以使用时需要强转为字符串后判断
|
|
|
* 1:如果该值为5,证明当前用户角色为教师,而教师中分教职工角色和局职工角色
|
|
|
* 2:如果该值为6,证明当前用户角色为学生,则为学生空间
|
|
|
*/
|
|
|
// 如果角色为5 - 教师
|
|
|
if ((BaseConfig.userInfo.identity_id + '') === "5") {
|
|
|
// 判断为教职工还是局
|
|
|
if (BaseConfig.person_info_my.isTeacherRole) {
|
|
|
// 教职工
|
|
|
BaseConfig.person_info_my.spatialProperties = "teacher";
|
|
|
} else {
|
|
|
// 局
|
|
|
BaseConfig.person_info_my.spatialProperties = "bureauEdu";
|
|
|
}
|
|
|
} else if ((BaseConfig.userInfo.identity_id + '') === "6") {
|
|
|
// 如果角色id为6- 学生
|
|
|
BaseConfig.person_info_my.spatialProperties = "student";
|
|
|
}
|
|
|
// 判断登录用户角色相关信息,是否为管理员,班主任
|
|
|
BaseConfig.person_info_my.loginUserRole = ConfigFn.checkYthRole(BaseConfig.person_info_my.bureau_iid);
|
|
|
|
|
|
/************ 判断当前登录用户角色(学生空间,教师空间),显示不通的主题样式 --- start ***********/
|
|
|
if (BaseConfig.person_info_my.spatialProperties === "student") {// 学生空间
|
|
|
PublicFn.setStyleSheet('student.main', 'themeStyle');
|
|
|
} else if (BaseConfig.person_info_my.spatialProperties === "teacher") {// 教师空间
|
|
|
PublicFn.setStyleSheet('teacher.main', 'themeStyle');
|
|
|
} else if (BaseConfig.person_info_my.spatialProperties === "bureauEdu") {// 局空间
|
|
|
PublicFn.setStyleSheet('main', 'themeStyle');
|
|
|
}
|
|
|
/************ 判断当前登录用户角色(学生空间,教师空间),显示不通的主题样式 --- end ***********/
|
|
|
|
|
|
/**
|
|
|
* 各个项目路径配置的地址
|
|
|
* @type {{brightLife: string, newTabWindow: string}}
|
|
|
*/
|
|
|
BaseConfig.projectUrl = {
|
|
|
// 慧生活
|
|
|
brightLife: BaseConfig.url_path_html + "/pro_integration/reactProject/officeSystem/",
|
|
|
// 新开窗口newTabWindow项目的路径
|
|
|
newTabWindow: window.location.origin + BaseConfig.url_path_html + "/pro_integration/reactProject/newTabWindow/"
|
|
|
};
|
|
|
|
|
|
// console.log("BaseConfig")
|
|
|
// console.log(BaseConfig)
|
|
|
|
|
|
// 添加方法库
|
|
|
BaseConfig.ConfigFn = ConfigFn;
|
|
|
BaseConfig.isSZUpload = isSZUpload;//是否苏州版本上传附件方式
|
|
|
BaseConfig.isCloud = isCloud;//是否云环境
|
|
|
export default BaseConfig;
|