Explorar el Código

测试打开小程序

zhangyujun hace 3 años
padre
commit
bb9746aad7
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. 1 1
      src/hooks/index.ts
  2. 4 4
      src/views/mini/index.vue

+ 1 - 1
src/hooks/index.ts

@@ -8,7 +8,7 @@ import store from "@/store";
 /** 用户通过微信code登陆 */
 export const useLogin = async (query: LocationQuery) => {
 	console.log(query)
-
+	
 	//登陆
 	const res = await API.login(query.code);
 	store.commit("setToken", res.data.token);

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

@@ -16,10 +16,10 @@ export default defineComponent({
 		wx.config({
 			debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
 			appId: "wx67ca1b8c9816ef28", // 必填,公众号的唯一标识
-			timestamp: 0, // 必填,生成签名的时间戳
-			nonceStr: "", // 必填,生成签名的随机串
-			signature: "", // 必填,签名
-			jsApiList: [], // 必填,需要使用的JS接口列表
+			timestamp: 1649744766, // 必填,生成签名的时间戳
+			nonceStr: "Sa4k8traGpnLJCzoQytqr00nL216RpUX", // 必填,生成签名的随机串
+			signature: "41e0e4f710d64bbecec3108fbf5c343602791d0d", // 必填,签名
+			jsApiList: ['previewImage'], // 必填,需要使用的JS接口列表
 			openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
 		});
 		let isWxReady = ref(false);