Sfoglia il codice sorgente

化学品教程/统一认证 基础部分

dedsudiyu 3 settimane fa
parent
commit
cc74268320

+ 11 - 9
api/request/config.js

@@ -1,7 +1,7 @@
 const config = {
-	/****** 后台服务地址 ******/
+	/************************************ 后台服务地址 ************************************/
 	
-	// base_url: 'http://192.168.1.43/api', //43服务器
+	base_url: 'http://192.168.1.43/api', //43服务器
 	// base_url: 'http://192.168.1.8/api',//1.8服务器
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.24:8080',//林总
@@ -22,19 +22,21 @@ const config = {
 	// base_url: 'https://lab.zjznai.com/api/', //暨大化材
 	// base_url: 'https://lab.zjznai.com/kdwclabSystem/', //矿大文昌地址
     //base_url: 'https://znyj.zjznai.suda.edu.cn/labSystem/', //苏大临时地址
-	base_url: 'https://labcontrol.nwafu.edu.cn/api/', //西北农林
+	// base_url: 'https://labcontrol.nwafu.edu.cn/api/', //西北农林
 	// base_url: 'http://172.16.0.65/api/', //西北农林
 	//base_url: 'https://lab.zjznai.com/labapp/', //43测试
 	// base_url: 'https://metersphere.zjznai.com/labSystem/', //中国海关
 	
-	/****** 图片服务地址(imagesUrl.styl 文件内还需要配置一次css相关地址注意是否与imagesUrl.styl一致) ******/
+	/************************************ 图片服务地址 ************************************/
+	//(imagesUrl.styl 文件内还需要配置一次css相关地址注意是否与imagesUrl.styl一致)
 	imagesUrl: 'https://zj-wechat.oss-cn-beijing.aliyuncs.com/xcx_images/xcx_v3/',
-	/****** 扫一扫 1.MSDS说明书			2.安全制度			3.危险源详情 地址配置 ******/
+	/************************************ 扫一扫 ************************************/
+	//1.MSDS说明书			2.安全制度			3.危险源详情 地址配置 
 	saoCodeTypeUrl: 'https://labcontrol.nwafu.edu.cn/#/codeHtml?',
-	/****** 登录方式 ******/
-	//account 账户登录
-	//certification 统一认证登录
-	loginType:'account',
+	/************************************ 校级管理员身份ID ************************************/
+  schoolId:'1815293314666532865',
+	/************************************ 院级管理员身份ID ************************************/
+  collegeId:'1815336278075838465',
 }
 export {
 	config

+ 2 - 1
api/request/imagesUrl.styl

@@ -1,2 +1,3 @@
-/****** css样式图片服务地址(config.js 文件内还需要配置一次相关地址注意是否与config.js一致) ******/
+/****** css样式图片服务地址 ******/
+//config.js 文件内还需要配置一次相关地址注意是否与config.js一致
 $imagesUrl = "https://zj-wechat.oss-cn-beijing.aliyuncs.com/xcx_images/xcx_v3/"

+ 8 - 0
pages.json

@@ -143,6 +143,14 @@
 				"navigationBarTextStyle": "white", //导航文字颜色
 				"navigationBarBackgroundColor": "#0183FA" //导航背景色
 			}
+		},
+		{
+			"path": "pages/views/saoCode/chemicalsInstructionsVideo", //操作教程
+			"style": {
+				"navigationBarTitleText": "操作教程",
+				"navigationBarTextStyle": "white", //导航文字颜色
+				"navigationBarBackgroundColor": "#0183FA" //导航背景色
+			}
 		}
 	],
 	"subPackages": [

+ 8 - 0
pages/api/index.js

@@ -504,4 +504,12 @@ export const systemUserPersonalData  = (data) => {
         url: `/system/user/personalData`,
         method: 'get',
     })
+};
+//根据 token 获取用户信息
+export const authGetAppletUser  = (data) => {
+    return apiResquest({
+        url: `/auth/getAppletUser`,
+				method: 'POST',
+				data: { ...data }
+    })
 };

+ 66 - 32
pages/views/login/ssoCertification.vue

@@ -7,11 +7,19 @@
 
 <script>
 	import {
+		config
+	} from '@/api/request/config.js'
+	import {
+		authGetAppletUser,
 		configInfo,
 		getConfigByType,
 		systemAppletRolePermission,
 		securityDataStatisticsGetUserIdentity
 	} from '@/pages/api/index.js'
+	import {
+		Encrypt,
+		Decrypt
+	} from '@/utils/secret.js'
 	export default {
 		name: "ssoCertification",
 		data() {
@@ -24,7 +32,7 @@
 			if(option.token){
 				uni.setStorageSync('token', option.token);
 				//获取登录人信息接口
-				this.getUserInfo();
+				this.authGetAppletUser();
 			}else{
 				uni.redirectTo({
 					url: '/pages/views/login/ssoLogin',
@@ -34,40 +42,54 @@
 		mounted() {
 
 		},
-
 		methods: {
-			getUserInfo(){
-				//等待配置与字段获取到后跳转
-				Promise.all([
-					//查询公共配置
-					this.getConfigInfo(),
-					//获取开发配置
-					this.getConfigByType(),
-					//获取权限字段
-					this.systemAppletRolePermission(),
-					//查询身份
-					this.securityDataStatisticsGetUserIdentity()
-				]).then((result) => {
-					if (uni.getStorageSync('codeData')) {
-						uni.redirectTo({
-							url: '/pages/views/saoCode/saoCode',
-						});
-					} else if (uni.getStorageSync('warningId')) {
-						uni.redirectTo({
-							url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail',
-						});
-					} else {
-						uni.redirectTo({
-							url: '/pages/views/home/home',
+			async authGetAppletUser(){
+				const {
+					data
+				} = await authGetAppletUser();
+				if (data.code == 200) {
+					uni.setStorageSync('dataBoardType', false);
+					uni.setStorageSync('userId', data.data.userId);
+					uni.setStorageSync('isInitPwd', true);
+					// userType 0-系统 1-教职工 2-学生 3-大屏
+					uni.setStorageSync('userType', data.data.userType == 0 || data.data.userType == 1 ? '1' :
+						(data.data.userType == 2 ? '2' : (data.data.userType == 3 ? '3' : 'none')));
+					//等待配置与字段获取到后跳转
+					Promise.all([
+						//查询公共配置
+						this.getConfigInfo(),
+						//获取开发配置
+						this.getConfigByType(),
+						//获取权限字段
+						this.systemAppletRolePermission(),
+						//查询身份
+						this.securityDataStatisticsGetUserIdentity()
+					]).then((result) => {
+						if (uni.getStorageSync('codeData')) {
+							uni.redirectTo({
+								url: '/pages/views/saoCode/saoCode',
+							});
+						} else if (uni.getStorageSync('warningId')) {
+							uni.redirectTo({
+								url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail',
+							});
+						} else {
+							uni.redirectTo({
+								url: '/pages/views/home/home',
+							});
+						}
+					}).catch((error) => {
+						wx.showToast({
+							title: '数据异常,请稍候再试!',
+							icon: "none",
+							duration: 3000
 						});
-					}
-				}).catch((error) => {
-					wx.showToast({
-						title: '数据异常,请稍候再试!',
-						icon: "none",
-						duration: 3000
+					})
+				}else{
+					uni.redirectTo({
+						url: '/pages/views/home/home',
 					});
-				})
+				}
 			},
 			
 			//查询公共配置
@@ -124,6 +146,18 @@
 					uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
 				}
 			},
+			//获取权限字段
+			async systemAppletRolePermission() {
+				let self = this;
+				const {
+					data
+				} = await systemAppletRolePermission();
+				if (data.code == 200) {
+					uni.setStorageSync('permissions', data.data.data)
+					uni.setStorageSync('controlsRestrict', data.data.roleKeys ? data.data.roleKeys : [])
+					uni.setStorageSync('user', data.data.userInfo)
+				}
+			},
 			//查询身份
 			async securityDataStatisticsGetUserIdentity(routeUrl) {
 				let self = this;

+ 2 - 2
pages/views/login/ssoLogin.vue

@@ -2,8 +2,8 @@
 <template>
 	<view id="ssoLogin">
 		<web-view @message="handleMessage"
-		src="https://labcontrol.nwafu.edu.cn/stream/#/miniProgramAuthentication">
-		<!-- src="http://192.168.1.10:80/#/miniProgramAuthentication?token=123123"> -->
+		src="http://192.168.1.10:80/#/miniProgramAuthentication?token=41cd8b02-f612-4dd5-abbd-efb5c45d69ad">
+		<!-- src="https://labcontrol.nwafu.edu.cn/stream/#/miniProgramAuthentication"> -->
 		</web-view>
 	</view>
 </template>

+ 1 - 1
pages/views/pupilPage/pupilHome.vue

@@ -167,7 +167,7 @@
 						if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
 							5 || codeData.type == 7 ||
 							codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
-							codeData.type == 11 || codeData.type == 12 || codeData.type == 13) {
+							codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
 							uni.navigateTo({
 								url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
 							});

+ 70 - 0
pages/views/saoCode/chemicalsInstructionsVideo.vue

@@ -0,0 +1,70 @@
+<template>
+	<view id="chemicalsInstructionsVideo">
+		<view class="max-big-video-box">
+			<video class="video-box"
+			src="https://labcontrol.nwafu.edu.cn//statics/2025/03/21/a367d265-c780-4e8e-a137-95524368beec.mp4"></video>
+			<view class="video-title-p">化学品存储</view>
+		</view>
+		<view class="max-big-video-box">
+			<video class="video-box"
+			 src="https://labcontrol.nwafu.edu.cn//statics/2025/03/21/24b9d6fd-d158-4405-bae2-575ad066da34.mp4"></video>
+			<view class="video-title-p">化学品领用</view>
+		</view>
+		<view class="max-big-video-box">
+			<video class="video-box"
+			 src="https://labcontrol.nwafu.edu.cn//statics/2025/03/21/1102689d-51ae-40e9-83df-60dddb08d8ce.mp4"></video>
+			<view class="video-title-p">化学品归还</view>
+		</view>
+		<view class="max-big-video-box">
+			<video class="video-box"
+			 src="https://labcontrol.nwafu.edu.cn//statics/2025/03/21/02e4d8b8-ea65-4c36-ad33-00a334a834ed.mp4"></video>
+			<view class="video-title-p">化学品废弃</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "chemicalsInstructionsVideo",
+		data() {
+			return {
+				
+			}
+		},
+		onLoad(option) {
+			
+		},
+		mounted() {
+
+		},
+
+		methods: {
+			
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	#chemicalsInstructionsVideo {
+		background-color: #EBEBEB;
+		padding:40rpx 0;
+		.max-big-video-box{
+			width:690rpx;
+			margin:0 30rpx 40rpx;
+			background-color: #fff;
+			border-radius:20rpx;
+			overflow: hidden;
+			.video-box{
+				width:690rpx;
+				height:300rpx;
+			}
+			.video-title-p{
+				height:76rpx;
+				line-height:70rpx;
+				font-size:30rpx;
+				color:#333;
+				padding-left:20rpx;
+			}
+		}
+	}
+</style>

+ 5 - 0
pages/views/saoCode/saoCode.vue

@@ -84,6 +84,11 @@
 					} else if (codeData.type == 13) {
 						//电子信息牌二维码-小程序扫码验证
 						this.laboratoryAppBoardScanCodeVerification(codeData.macId, codeData.subId, codeData.code);
+					} else if (codeData.type == 14) {
+						//化学品-操作教程
+						uni.reLaunch({
+							url: '/pages/views/saoCode/chemicalsInstructionsVideo'
+						});
 					} else if (codeData.type == 7) {
 						//培训课程
 						uni.reLaunch({

+ 1 - 1
pages/views/teacherPage/teacherHome.vue

@@ -235,7 +235,7 @@
 						if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
 							5 || codeData.type == 7 ||
 							codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
-							codeData.type == 11 || codeData.type == 12 || codeData.type == 13) {
+							codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
 							uni.reLaunch({
 								url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
 							});

+ 3 - 3
utils/index.js

@@ -1,3 +1,4 @@
+import { config } from '@/api/request/config.js'
 /*            操作权限验证
 * str 为权限字符 用于匹配操作角色的字符
 * str === performEvacuation   应急疏散操作权限
@@ -31,10 +32,9 @@ export function pageRestrictVerify(str) {
   userInfo.userId     当前用户userID
 */
 export function itoOrVideoLimits(subAdminId) {
-  console.log('subAdminId',subAdminId)
   let userInfo = uni.getStorageSync('user');
-  let schoolId = '1815293314666532865';
-  let collegeId = '1815336278075838465';
+  let schoolId = config.schoolId;
+  let collegeId = config.collegeId;
   if(userInfo.position == null){
     //如果是管理员(系统用户)
     return true