lsc 2 周之前
父節點
當前提交
d0e2c63176

+ 1 - 1
src/main.js

@@ -23,7 +23,7 @@ Vue.use(ElementUI);
 Vue.prototype.$ajax = axios;
 let region = 'cn'
 // BaseUrl='http://gpt4.cocorobo.cn:8011/';
-if (parent?.location?.href.includes('beta')) {
+if (parent?.location?.href.includes('beta') || window?.location?.href.includes('localhost')) {
   console.log(parent.location.href);
   
   region = 'beta'

+ 1 - 0
src/mixins/mixin.js

@@ -8,6 +8,7 @@ export const myMixin = {
     },
     prefixL(){
         let liyuan = window.topU.location.href.includes("lyxx")
+        // let liyuan = window.location.href.includes("lyxx")
         let newArr = ''
         if (liyuan) {
           newArr = "liyuan_"

+ 2 - 0
src/permission.js

@@ -14,6 +14,8 @@ router.beforeEach(async (to, from, next) => {
   const hasToken = store.getters.token
   let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.parent.U ? window.parent.U.UF.Cookie.get("cocoroboLoginType") : '';
   let cocorobo = window.topU ? window.topU.U.UF.Cookie.get("cocorobo") : window.parent.U ? window.parent.U.UF.Cookie.get("cocorobo") : '';
+  // let loginType = 2;
+  // let cocorobo = true;
   if (hasToken && cocorobo && loginType != 1) {
     if (to.path === '/login') {
       console.log('111111111111');

+ 5 - 4
src/store/modules/user.js

@@ -169,12 +169,12 @@ const actions = {
   },
 
   async getschPerInfo({ commit,state }) {
-      let params = [{
+        let userinfo = Object.keys(state.userinfo2).length != 0 ? state.userinfo2 : state.userinfo
+        let params = [{
           functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
-          org: state.userinfo.org, //组织id
-          oid: state.userinfo.organizeid, //学校id
+          org: userinfo.org, //组织id
+          oid: userinfo.organizeid, //学校id
         }];
-
       // console.log('params',params);
       // 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
       // 第一步
@@ -267,6 +267,7 @@ const actions = {
 					}
 				});
         perData.admin.CampusF.appList = perData.admin.CampusF.appList.filter(Boolean);
+        // perData.admin.CampusF.appList = perData.admin.CampusF.appList.filter(i => i.label !== undefined)
 			}
 
 

+ 100 - 84
src/views/HomeView.vue

@@ -171,7 +171,7 @@ export default {
 		};
 	},
 	computed: {
-		...mapGetters(["userinfo", "appSign", "userinfo2"]),
+		...mapGetters(["userinfo", "appSign", "userinfo2","formL"]),
 		userSuffix() {
 			let yym = "";
 			return function () {
@@ -428,89 +428,105 @@ export default {
 				this.$refs.sidebarLRef.getData();
 			}
 
-			let params = [
-				{
-					functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
-					org: this.roleUser.org, //组织id
-					oid: this.roleUser.organizeid, //学校id
-				},
-			];
-			// 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
-			// 第一步
-			let res = await this.$ajax.post(API_CONFIG.baseUrl, params);
-			let perData = JSON.parse(res.data[0][0].json);
-
-			// console.log('perData',JSON.parse(JSON.stringify(perData)));
-
-			// 第二步
-			let params2 = [
-				{
-					functionName: "select_desktopToolByPage",
-					status: "",
-					page: 1,
-					lim: 9999999,
-				},
-			];
-
-			let res2 = await this.$ajax.post(API_CONFIG.baseUrl, params2);
-			let toolList = res2.data[0];
-			toolList.forEach((i) => {
-				i.url = JSON.parse(i.url);
-				i.json = JSON.parse(i.json);
-				i.argumentList = JSON.parse(i.argumentList);
-			});
-
-			// 第三步
-			perData.desktop.list.forEach((i, index) => {
-				let _index = toolList.findIndex((i2) => i == i2.id);
-				if (_index != -1) {
-					perData.desktop.list[index] = toolList[_index];
-				} else {
-					console.log("无工具", i);
-				}
-			});
-
-			perData.admin.index.list.forEach((i, index) => {
-				let _index = toolList.findIndex((i2) => i == i2.id);
-				if (_index != -1) {
-					perData.admin.index.list[index] = toolList[_index];
-					perData.admin.index.list[index].hovered = false;
-				} else {
-					console.log("无工具", i);
-				}
-			});
-
-			perData.admin.sidebar.list.forEach((i, index) => {
-				if (i.children) {
-					i.children.forEach((i2, index2) => {
-						let _toolList = JSON.parse(JSON.stringify(toolList));
-						let _index = _toolList.findIndex((i3) => i2 == i3.id);
-
-						if (_index != -1) {
-							perData.admin.sidebar.list[index].children[index2] =
-								_toolList[_index];
-							perData.admin.sidebar.list[index].children[index2].typeId =
-								perData.admin.sidebar.list[index].typeId +
-								"," +
-								_toolList[_index].id;
-						} else {
-							console.log("无工具", i);
-						}
-					});
-				} else {
-					let _toolList = JSON.parse(JSON.stringify(toolList));
-					let _index = _toolList.findIndex((i2) => i == i2.id);
-					if (_index != -1) {
-						perData.admin.sidebar.list[index] = _toolList[_index];
-						perData.admin.sidebar.list[index].typeId =
-							perData.admin.sidebar.list[index].id;
-					} else {
-						console.log("无工具", i);
-					}
-				}
-			});
-
-			await store.commit("user/SET_FROM", perData);
+			// let params = [
+			// 	{
+			// 		functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
+			// 		org: this.roleUser.org, //组织id
+			// 		oid: this.roleUser.organizeid, //学校id
+			// 	},
+			// ];
+			// // 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
+			// // 第一步
+			// let res = await this.$ajax.post(API_CONFIG.baseUrl, params);
+			// let perData = JSON.parse(res.data[0][0].json);
+
+			// // console.log('perData',JSON.parse(JSON.stringify(perData)));
+
+			// // 第二步
+			// let params2 = [
+			// 	{
+			// 		functionName: "select_desktopToolByPage",
+			// 		status: "",
+			// 		page: 1,
+			// 		lim: 9999999,
+			// 	},
+			// ];
+
+			// let res2 = await this.$ajax.post(API_CONFIG.baseUrl, params2);
+			// let toolList = res2.data[0];
+			// toolList.forEach((i) => {
+			// 	i.url = JSON.parse(i.url);
+			// 	i.json = JSON.parse(i.json);
+			// 	i.argumentList = JSON.parse(i.argumentList);
+			// });
+
+			// // 第三步
+			// perData.desktop.list.forEach((i, index) => {
+			// 	let _index = toolList.findIndex((i2) => i == i2.id);
+			// 	if (_index != -1) {
+			// 		perData.desktop.list[index] = toolList[_index];
+			// 	} else {
+			// 		console.log("无工具", i);
+			// 	}
+			// });
+
+			// perData.admin.index.list.forEach((i, index) => {
+			// 	let _index = toolList.findIndex((i2) => i == i2.id);
+			// 	if (_index != -1) {
+			// 		perData.admin.index.list[index] = toolList[_index];
+			// 		perData.admin.index.list[index].hovered = false;
+			// 	} else {
+			// 		console.log("无工具", i);
+			// 	}
+			// });
+
+			// perData.admin.sidebar.list.forEach((i, index) => {
+			// 	if (i.children) {
+			// 		i.children.forEach((i2, index2) => {
+			// 			let _toolList = JSON.parse(JSON.stringify(toolList));
+			// 			let _index = _toolList.findIndex((i3) => i2 == i3.id);
+
+			// 			if (_index != -1) {
+			// 				perData.admin.sidebar.list[index].children[index2] =
+			// 					_toolList[_index];
+			// 				perData.admin.sidebar.list[index].children[index2].typeId =
+			// 					perData.admin.sidebar.list[index].typeId +
+			// 					"," +
+			// 					_toolList[_index].id;
+			// 			} else {
+			// 				console.log("无工具", i);
+			// 			}
+			// 		});
+			// 	} else {
+			// 		let _toolList = JSON.parse(JSON.stringify(toolList));
+			// 		let _index = _toolList.findIndex((i2) => i == i2.id);
+			// 		if (_index != -1) {
+			// 			perData.admin.sidebar.list[index] = _toolList[_index];
+			// 			perData.admin.sidebar.list[index].typeId =
+			// 				perData.admin.sidebar.list[index].id;
+			// 		} else {
+			// 			console.log("无工具", i);
+			// 		}
+			// 	}
+			// });
+			// fromL 的初始值如下,判断其内容是否被修改可根据 basics、desktop.list、admin.index.list、admin.sidebar.list 是否有实际数据
+			const fromL = this.fromL;
+			const hasFromLData =
+				(fromL &&
+					(
+						fromL.basics.title ||
+						fromL.basics.brief ||
+						fromL.basics.logo ||
+						(fromL.desktop && fromL.desktop.list && fromL.desktop.list.length > 0) ||
+						(fromL.admin && fromL.admin.index && fromL.admin.index.list && fromL.admin.index.list.length > 0) ||
+						(fromL.admin && fromL.admin.sidebar && fromL.admin.sidebar.list && fromL.admin.sidebar.list.length > 0)
+					)
+				) ? true : false;
+
+			if (!hasFromLData) {
+				await store.dispatch('user/getschPerInfo')
+			}
+			// await store.commit("user/SET_FROM", perData);
 			// 获取后台管理设置常见应用
 			this.$refs.homepageLRef.getadmincocoFlow();
 		},

+ 1 - 0
src/views/kanBan/components/AquickEntrance.vue

@@ -93,6 +93,7 @@ import { addrrole } from "@/api/user";
                         await store.commit('user/SET_USERINFO2', res.data[0][0])
 
                         await store.commit('user/SET_AppSIGN', '')
+                        await store.dispatch('user/getschPerInfo')
 
                         this.loading = false
 

+ 2 - 1
src/views/kanBan/components/AschoolFeature.vue

@@ -1326,7 +1326,7 @@ export default {
 		};
 	},
 	computed: {
-		...mapGetters(["userinfo"]),
+		...mapGetters(["userinfo", "fromL"]),
 		featureList() {
 			if (this.Alldata.admin.CampusF) {
 				return this.Alldata.admin.CampusF.feature; // 从 Alldata 中获取 featureList
@@ -1878,6 +1878,7 @@ export default {
 					}
 				}
 			});
+
 			console.log("perData", perData);
 
 			this.Alldata = perData;