Parcourir la source

科目四添加必需题

zhangyujun il y a 3 ans
Parent
commit
111357cdf4
3 fichiers modifiés avec 9 ajouts et 7 suppressions
  1. 1 1
      src/views/classifyChoose/index.vue
  2. 1 1
      src/views/mini/index.vue
  3. 7 5
      src/views/mini1/index.vue

+ 1 - 1
src/views/classifyChoose/index.vue

@@ -105,7 +105,7 @@ const classDataRight = ref([]);
 const classData = ref([]);
 getTopicClass(query.path as string, {
 	...query,
-	excellIssueName: "必",
+	excellIssueName: "必",
 }).then(({ data }) => {
 	// res.data.data.shift();
 	console.log(data);

+ 1 - 1
src/views/mini/index.vue

@@ -14,7 +14,7 @@
 import { defineComponent, ref } from "vue";
 import wx from "weixin-js-sdk-ts";
 import { openApi } from "@/api/index";
-const wxSign = require('@/utils/wxSign')
+import wxSign from '@/utils/wxSign';
 export default defineComponent({
 	setup() {
 		openApi

+ 7 - 5
src/views/mini1/index.vue

@@ -1,6 +1,7 @@
 <template>
 	<div>
 		<div v-text="weappHtml"></div>
+		
 		<div>https://www.baidu.com/yy</div>
 		<wx-open-launch-weapp style="display: inline-block; border: none" id="launch-btn" username="gh_a994fd2f498e" path="pages/carVideo/index.html?living_code=LIVING_CODE">
 			<div v-is="'script'" type="text/wxtag-template">
@@ -19,7 +20,7 @@ export default defineComponent({
 	setup() {
 		openApi
 			.jspapi({
-				url: encodeURIComponent(window.location.href.split('#')[0]),
+				url: window.location.href,
 		
 			})
 			.then((res) => {
@@ -34,12 +35,13 @@ export default defineComponent({
 				// };
 				let  timestamp = wxSign.createTimeStamp()
 				let nonceStr = wxSign.createNonceStr()
+				console.log(window.location.href,"window.location.href")
 				wx.config({
 					debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
-					appId:res.data.data.appId as string, // 必填,公众号的唯一标识
-					timestamp: timestamp, // 必填,生成签名的时间戳
-					nonceStr: nonceStr, // 必填,生成签名的随机串
-					signature: wxSign.calcSignature(res.data.data.ticket,nonceStr,timestamp,window.location.href), // 必填,签名
+					appId: res.data.data.appId as string, // 必填,公众号的唯一标识
+					timestamp: Number(res.data.data.timestamp) as number, // 必填,生成签名的时间戳
+					nonceStr: res.data.data.nonceStr as string, // 必填,生成签名的随机串
+					signature: res.data.data.signature as string, // 必填,签名
 					jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
 					openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
 				});