Procházet zdrojové kódy

删除部分可能导致问题的配置选项

JXDS18FUJT před 2 roky
rodič
revize
028474edb9

+ 39 - 37
src/components/m-wrong-preview/components/bottomBar.vue

@@ -69,23 +69,27 @@ export default defineComponent({
 			switch(props.listType){
 				//本地的错误保存
 				case "localWrong":
-						submitResVisible.value = true
-			trueNum.value =0 
-			falseNum.value =0
-			props.subjectList.forEach((item:any,index)=>{
-				let answers = item.answer.split("-")
-				if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
-						++trueNum.value 
-				}
-				else if(item.userAnswer.length==0){
-					 
-				}
-				else{
-					++falseNum.value
-				}
-				
+					
+			Dialog.confirm({
+				message: "确认交卷吗?",
 			})
-		
+				.then(() => {
+				let wrongSet =	props.subjectList.filter((item:any,index)=>{
+					let answers = item.answer.split("-")
+						return JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())
+
+					})
+					window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
+					
+					
+					
+
+
+				})
+				.catch(() => {
+					console.log(props.subjectList,"props")
+				});
+
 				break;
 				//本地的错误保存
 
@@ -135,26 +139,26 @@ export default defineComponent({
 
 
 		};
-		// const showSubmitResVisible = ()=>{
-		// 	submitResVisible.value = true
-		// 	trueNum.value =0 
-		// 	falseNum.value =0
-		// 	props.subjectList.forEach((item:any,index)=>{
-		// 		let answers = item.answer.split("-")
-		// 		if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
-		// 				++trueNum.value 
-		// 		}
-		// 		else if(item.userAnswer.length==0){
+		const showSubmitResVisible = ()=>{
+			submitResVisible.value = true
+			trueNum.value =0 
+			falseNum.value =0
+			props.subjectList.forEach((item:any,index)=>{
+				let answers = item.answer.split("-")
+				if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
+						++trueNum.value 
+				}
+				else if(item.userAnswer.length==0){
 					 
-		// 		}
-		// 		else{
-		// 			++falseNum.value
-		// 		}
+				}
+				else{
+					++falseNum.value
+				}
 				
-		// 	})
+			})
 
 
-		// }
+		}
 		const wrongReDo = ()=>{
 
 			let wrongSet =	props.subjectList.filter((item:any,index)=>{
@@ -175,10 +179,8 @@ export default defineComponent({
 								_item.status =0	
 							})
 
-					})
-					let localVuex = JSON.parse(window.localStorage.getItem('vuex')||'{}')
-					let tempUserWrongKey = localVuex.userData.openid+'_用户临时错题_'+subject
-					window.sessionStorage.setItem(tempUserWrongKey,JSON.stringify(wrongSet))
+					})	
+					window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
 					if(wrongSet.length){
 						emit('redo')
 					}
@@ -252,7 +254,7 @@ export default defineComponent({
 
 					<van-tabbar-item
 						onClick={() => {
-							goWrongPreviewScore()
+							showSubmitResVisible()
 						}}
 						v-slots={{
 							icon: () => <m-icon type="jiaojuan" />,

+ 2 - 2
src/route/guard.ts

@@ -22,7 +22,7 @@ const guard = (router: Router) => {
 			await useLogin(to.query);
 			// Toast("登录成功")
 			next("./")
-			useUpdateUserInfo();
+		
 			// try {
 			// 	await useLogin(to.query);
 			// 	toast.message = `登陆成功`;
@@ -38,7 +38,7 @@ const guard = (router: Router) => {
 			// }
 		}
 		//更新用户的信息
-		
+		useUpdateUserInfo();
 		//检测token状态,token失效直接跳转至登陆链接
 		// try {
 		// 	useUpdateUserInfo();

+ 2 - 2
vite.config.ts

@@ -32,13 +32,13 @@ export default defineConfig({
 			"/dev-api": {
 				target: "https://jpcj1.zzxcx.net/jpcj-admin",
 				changeOrigin: true,
-				secure: false,
+
 				rewrite: (path) => path.replace(/^\/dev-api/, ""),
 			},
 			"/prod-api": {
 				target: "https://jpcj.zzxcx.net/jpcj-admin",
 				changeOrigin: true,
-				secure: false,
+
 				rewrite: (path) => path.replace(/^\/prod-api/, ""),
 			},
 		},