Browse Source

修改部分bug,index.html添加监控代码

lsh 4 months ago
parent
commit
a468479ffa

+ 13 - 11
App.vue

@@ -12,9 +12,6 @@
 	import {
 		useUserStore
 	} from '@/lib/store'
-	import {
-		storeToRefs
-	} from 'pinia'
 
 	export default {
 		setup() {
@@ -28,12 +25,10 @@
 				domainname: null,
 			})
 			const getBasicInfo = () => {
-				console.log("监听咯")
 				getAuthCode()
 			}
 
 			const getAuthCode = () => {
-				console.log("监听咯-getAuthCode")
 				dd.ready(() => {
 					dd.getAuthCode({}).then((result) => {
 						if (result.code) {
@@ -41,18 +36,26 @@
 						} else {
 							formData.value.authCode = result.auth_code
 						}
-						let obj = Object.assign({}, globalParameter.value)
-						obj.authCode = formData.value.authCode;
-						store.setGlobalParameter(obj)
+						setTimeout(() => {
+							getUserInfo(formData.value.authCode);
+						}, 0);
 					}).catch(err => {
 						link.goLogin()
 					})
 				})
 			}
 
-			const getUserInfo = async () => {
+			const getUserInfo = async (authCode) => {
 				try {
-					await rest.post('/zyyp/ykz/getUserInfo?authCode=' + formData.value.authCode, '')
+					let res = await rest.post('/zyyp/ykz/getUserInfo?authCode=' + authCode, '')
+					if (!res) return
+					let obj = Object.assign({}, globalParameter.value)
+					obj.authCode = formData.value.authCode;
+					obj.zjhm = res.openid;
+					obj.userName = res.lastName;
+					obj.isLeader = res.leader;
+					store.setGlobalParameter(obj)
+					
 				} catch (error) {
 					console.error(error);
 				}
@@ -66,7 +69,6 @@
 			};
 
 			onMounted(() => {
-				console.log('App Created');
 				startIntervalTask();
 			});
 

+ 13 - 0
index.html

@@ -2,12 +2,25 @@
 <html lang="en">
   <head>
     <meta charset="UTF-8" />
+	<script src='https://zd-wpkgate-emas.bigdatacq.com:32383/static/wpk-jssdk.1.0.2/wpkReporter.js' crossorigin='true'></script>
     <script>
       var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
         CSS.supports('top: constant(a)'))
       document.write(
         '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
         (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+		try {
+		  const config = {
+		    bid: 'zyyyyjs-cqljxqshfzj_kmift2ec_orm4loju',
+		    signkey: '1234567890abcdef',
+		    gateway: 'https://zd-wpkgate-emas.bigdatacq.com:32383'
+		  };
+		  const wpk = new wpkReporter(config);
+		  wpk.installAll();
+		  window._wpk = wpk;
+		} catch (err) {
+		  console.error('WpkReporter init fail', err);
+		}
     </script>
     <title></title>
     <!--preload-links-->

+ 2 - 3
lib/config/index.ts

@@ -3,12 +3,11 @@
 // const  SERVER= 'http://127.0.0.1:48080'
 
 // //--- 本地服务器
-export const  SERVER= ''
 // export const  SERVER= 'http://192.168.31.36:48088'
+// export const BASE_URL = SERVER + '/admin-api'
 
 // //--- 正式服务器
-// export const SERVER = '/'
-// export const BASE_URL = SERVER + '/admin-api'
+export const SERVER = ''
 export const BASE_URL = SERVER + '/zyyyyjs/admin-api'
 
 export const VITE_UPLOAD_URL = 'http://192.168.31.36:48080'

+ 2 - 2
lib/link.ts

@@ -62,8 +62,8 @@ export const login = () => {
 	})
 }
 
-export const goBJList = (hzsfzh : string, hzxm : string, replace = false) => {
-	navto('/pages/feedback/index?hzsfzh=' + hzsfzh + '&hzxm=' + hzxm, replace = false)
+export const goBJList = (replace = false) => {
+	navto('/pages/feedback/index', replace)
 }
 
 // 办件详情

+ 2 - 3
pages/accredit/index.vue

@@ -6,7 +6,6 @@
 	import * as link from '@/lib/link'
 	import dd from 'gdt-jsapi';
 	import rest from '@/stores/rest'
-	import { aesEncrypt, aesDecrypt } from "@/lib/encryption"
 	import { onLoad } from "@dcloudio/uni-app";
 
 	import { useUserStore } from '@/lib/store';
@@ -32,7 +31,7 @@
 					getUserInfo(formData.value.authCode);
 				}, 0);
 			}).catch(err => {
-				alert('不是钉钉环境', err)
+				// alert('不是钉钉环境', err)
 				link.goLogin()
 			})
 		})
@@ -49,7 +48,7 @@
 			obj.isLeader = res.leader;
 			store.setGlobalParameter(obj)
 			// alert("查看内容(2):" + JSON.stringify(res))
-			link.goBJList(aesEncrypt(res.openid), aesEncrypt(res.lastName), true)
+			link.goBJList(true)
 		} catch (error) {
 			console.error(error);
 		}

+ 1 - 2
pages/feedback/FeedbackList.vue

@@ -142,8 +142,7 @@
 			
 		}
 		.feedback-no {
-			height: 300px;
-			height: calc(100vh - 200px);
+			height: calc(100vh - 210px);
 		}
 		::v-deep .scroll-view {
 			height: calc(100%);

+ 1 - 1
pages/feedback/details.vue

@@ -162,7 +162,7 @@
 					await rest.post('/zyyp/feedback/create', formData.value, globalParameter.value.authCode)
 					dlg.success('已新增反馈登记!')
 				}
-				link.back()
+				link.goBJList(true)
 			} catch (e) {
 				dlg.error(e)
 			}

+ 0 - 5
pages/feedback/index.vue

@@ -187,11 +187,6 @@
 		link.goBJDetails()
 	}
 
-	onLoad((data) => {
-		// alert("onLoad:" + JSON.stringify(globalParameter.value))
-		queryParams.value.zjhm = aesDecrypt(data.hzsfzh)
-	})
-
 	onShow(() => {
 		queryParams.value.pageNo = 1;
 		queryParams.value.zjhm = globalParameter.value.zjhm;

+ 3 - 1
pages/login/index.vue

@@ -63,8 +63,10 @@
 			try {
 				let obj = Object.assign({}, globalParameter.value)
 				obj.authCode = formData.value.hzsfzh;
+				obj.zjhm = formData.value.hzsfzh;
+				obj.userName = formData.value.hzxm
 				store.setGlobalParameter(obj)
-				link.goBJList(aesEncrypt(formData.value.hzsfzh), aesEncrypt(formData.value.hzxm))
+				link.goBJList(true)
 			} catch (e) {
 				dlg.error(e)
 			}