wjx 8 maanden geleden
bovenliggende
commit
24f0a9f304
3 gewijzigde bestanden met toevoegingen van 9 en 8 verwijderingen
  1. 0 0
      dist/IAA/qcsdkIAA-1.0.0.js
  2. 4 2
      src/api.js
  3. 5 6
      src/index.js

File diff suppressed because it is too large
+ 0 - 0
dist/IAA/qcsdkIAA-1.0.0.js


+ 4 - 2
src/api.js

@@ -1,5 +1,4 @@
 import IAAUtil from "./util";
 import IAAUtil from "./util";
-const window = window || GameGlobal;
 import IAAEnv from "./env";
 import IAAEnv from "./env";
 const IAA = IAAEnv.detectMiniProgramEnvironment() === 'tt' ? tt : wx
 const IAA = IAAEnv.detectMiniProgramEnvironment() === 'tt' ? tt : wx
 let reLogin = false;
 let reLogin = false;
@@ -92,7 +91,9 @@ const IAAApi = {
 		}
 		}
 		return new Promise((resolve, reject) => {
 		return new Promise((resolve, reject) => {
 			IAA.login({
 			IAA.login({
+				force: true,
 				success: (res) => {
 				success: (res) => {
+					console.log('login---->', res)
 					if (res.code) {
 					if (res.code) {
 						options.data = {
 						options.data = {
 							...options.data,
 							...options.data,
@@ -105,6 +106,7 @@ const IAAApi = {
 					}
 					}
 				},
 				},
 				fail: (res) => {
 				fail: (res) => {
+					console.log('login:fail---->', res)
 					reject(res);
 					reject(res);
 				},
 				},
 			});
 			});
@@ -173,7 +175,7 @@ const IAAApi = {
 	 */
 	 */
 	getShareInfo(options = {}) {
 	getShareInfo(options = {}) {
 		return ajax({
 		return ajax({
-			url: "/api/user/share/game",
+			url: "/api/user/share",
 			conf: { showLoading: false },
 			conf: { showLoading: false },
 			...options,
 			...options,
 		});
 		});

+ 5 - 6
src/index.js

@@ -4,7 +4,6 @@ import IAAEnv from "./env";
 const IAA = IAAEnv.detectMiniProgramEnvironment() === 'tt' ? tt : wx
 const IAA = IAAEnv.detectMiniProgramEnvironment() === 'tt' ? tt : wx
 
 
 window.qcIAASdk = {
 window.qcIAASdk = {
-
 	/**
 	/**
 	 * 初始化配置
 	 * 初始化配置
 	 * @param {*} options 
 	 * @param {*} options 
@@ -53,7 +52,7 @@ window.qcIAASdk = {
 					success() {
 					success() {
 						console.log("检测session_key未过期");
 						console.log("检测session_key未过期");
 						IAAApi.tokenCheck().then((res) => {
 						IAAApi.tokenCheck().then((res) => {
-							if (res.data) {
+							if (res.data && res.data.result) {
 								that.startTimer()
 								that.startTimer()
 								resolve({ code: 200, data: userInfo, msg: "success", success: true });
 								resolve({ code: 200, data: userInfo, msg: "success", success: true });
 							} else {
 							} else {
@@ -99,14 +98,14 @@ window.qcIAASdk = {
 		IAA.showShareMenu(); //设置开启当前页面分享按钮
 		IAA.showShareMenu(); //设置开启当前页面分享按钮
 		return IAAApi.getShareInfo().then((res) => {
 		return IAAApi.getShareInfo().then((res) => {
 			// 设置分享信息
 			// 设置分享信息
-			let { path, shareImg, title, query } = res.data;
-			console.log("设置分享信息====>", path);
+			let { path, img, title, query } = res.data;
+			console.log("设置分享信息======================>", path);
 			if (IAAEnv.detectMiniProgramEnvironment() === 'wx') {
 			if (IAAEnv.detectMiniProgramEnvironment() === 'wx') {
 				wx.onShareAppMessage(() => {
 				wx.onShareAppMessage(() => {
 					return {
 					return {
 						title,
 						title,
 						path,
 						path,
-						imageUrl: shareImg,
+						imageUrl: img,
 					};
 					};
 				});
 				});
 			} else {
 			} else {
@@ -114,7 +113,7 @@ window.qcIAASdk = {
 					return {
 					return {
 						title,
 						title,
 						query,
 						query,
-						imageUrl: shareImg,
+						imageUrl: img,
 					};
 					};
 				});
 				});
 			}
 			}

Some files were not shown because too many files changed in this diff