dedsudiyu 6 月之前
父節點
當前提交
dc363e3277
共有 3 個文件被更改,包括 30 次插入48 次删除
  1. 2 2
      pages/api/index.js
  2. 0 1
      pages/views/login/login.vue
  3. 28 45
      pages/views/teacherPage/teacherHome.vue

+ 2 - 2
pages/api/index.js

@@ -147,9 +147,9 @@ export function getConfigByType(data) {
 }
 
 //查询人员身份标识
-export const getGentleIdentifier = (data) => {
+export const securityDataStatisticsGetUserIdentity = (data) => {
 	return apiResquest({
-		url: `/security/checkSet/getGentle`,
+		url: `/security/dataStatistics/getUserIdentity`,
 		method: 'GET',
 		data: data,
 	})

+ 0 - 1
pages/views/login/login.vue

@@ -40,7 +40,6 @@
 		login,
 		configInfo,
 		getConfigByType,
-		getGentleIdentifier,
 		systemAppletRolePermission
 	} from '@/pages/api/index.js'
 	import {

+ 28 - 45
pages/views/teacherPage/teacherHome.vue

@@ -79,7 +79,7 @@
 
 <script>
 	import {
-		getGentleIdentifier
+		securityDataStatisticsGetUserIdentity
 	} from '@/pages/api/index.js'
 	import {
 		pageRestrictVerify
@@ -124,7 +124,7 @@
 			}
 		},
 		mounted() {
-
+			this.securityDataStatisticsGetUserIdentity()
 		},
 		methods: {
 			goHome() {
@@ -158,7 +158,6 @@
 					uni.navigateTo({
 						url: "/pages_safetyCheck/views/safetyCheck",
 					});
-					//this.getGentleIdentifier();
 				} else if (type == 'securityExamination') {
 					//安全考试
 
@@ -208,51 +207,35 @@
 
 				}
 			}, //获取用户身份标识"adminGentle": false,   管理员身份 "rectifyGentle": false, 院级管理员collegeGentle   整改身份"applyGentle": false    检查者身份
-			async getGentleIdentifier(routeUrl) {
+			async securityDataStatisticsGetUserIdentity(routeUrl) {
 				let self = this;
 				const {
 					data
-				} = await getGentleIdentifier();
-				if (data.code == 200) {
-					let pageType = null
-					// 如果是管理员 检查者和整改者
-					let list = [];
-					if (data.data.adminGentle || data.data.collegeGentle) { //校级管理员
-						list.push({
-							name: '管理员',
-							pageType: 1
-						})
-					}
-					if (data.data.applyGentle || data.data.myApplyGentle) {
-						list.push({
-							name: '检查者',
-							pageType: 2
-						})
-					}
-					if (data.data.rectifyGentle) {
-						list.push({
-							name: '整改者',
-							pageType: 3
-						})
-					}
-					if (!data.data.adminGentle && !data.data.applyGentle && !data.data.myApplyGentle && !data.data
-						.rectifyGentle && !data.data.collegeGentle) {
-
-					}
-					uni.setStorageSync('gentleIdentifier', list)
-					uni.setStorageSync('gentleIdentifierData', data.data)
-					if (list.length > 0) {
-						uni.navigateTo({
-							url: "/pages_safetyExamine/views/safetyExamineWorkbench",
-						});
-					} else {
-						uni.showToast({
-							title: '您没有管理员/检查者/整改者身份,请联系管理员',
-							icon: "none",
-							mask: true,
-							duration: 2000
-						});
-					}
+				} = await securityDataStatisticsGetUserIdentity();
+				if(data.schoolAdmin){
+					//校级管理员
+					uni.setStorageSync('identityData',{
+						type:'schoolAdmin'
+					});
+				}else if(data.collegeAdmin){
+					//院级管理员
+					uni.setStorageSync('identityData',{
+						type:'collegeAdmin'
+					});
+				}else if(data.schoolGroup){
+					//校级督导组
+					uni.setStorageSync('identityData',{
+						type:'schoolGroup',
+						groupIds:data.groupIds
+					});
+				}else if(data.collegeGroup){
+					//院级督导组
+					uni.setStorageSync('identityData',{
+						type:'collegeGroup',
+						groupIds:data.groupIds
+					});
+				}else{
+					uni.removeStorageSync('identityType');
 				}
 			},
 			/* 扫一扫*/