更新了埋点失败重传,scode以及分享链接更改
This commit is contained in:
parent
f24cd55677
commit
f5219a4068
|
@ -54,7 +54,7 @@ export default class NewClass extends cc.Component {
|
||||||
}
|
}
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
jumpFinishi(){
|
jumpFinishi(){
|
||||||
let url = "https://train.sparkus.cn/poster/game/";
|
let url = "https://train.sparkus.cn/poster/game/" + cc.fx.GameConfig.GM_INFO.scode + "?suc=1";
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { WeChat } from "./module/Share/share";
|
||||||
|
|
||||||
const {ccclass, property, requireComponent} = cc._decorator;
|
const {ccclass, property, requireComponent} = cc._decorator;
|
||||||
|
|
||||||
|
@ -5,6 +6,7 @@ const {ccclass, property, requireComponent} = cc._decorator;
|
||||||
export default class NewClass extends cc.Component {
|
export default class NewClass extends cc.Component {
|
||||||
start () {
|
start () {
|
||||||
window.initMgr();
|
window.initMgr();
|
||||||
|
// WeChat.setShare(location.href);
|
||||||
cc.fx.GameConfig.init();
|
cc.fx.GameConfig.init();
|
||||||
// cc.fx.AudioManager._instance.init();
|
// cc.fx.AudioManager._instance.init();
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
|
|
|
@ -14,6 +14,7 @@ export class GameConfig {
|
||||||
currSeed: number; //用于随机数种子
|
currSeed: number; //用于随机数种子
|
||||||
gameId: string; //游戏ID
|
gameId: string; //游戏ID
|
||||||
userId: number; //用户ID
|
userId: number; //用户ID
|
||||||
|
scode: string; //用户code
|
||||||
guide: boolean; //是否有引导
|
guide: boolean; //是否有引导
|
||||||
url: string; //访问域名
|
url: string; //访问域名
|
||||||
success: boolean; //用户游戏成功与否
|
success: boolean; //用户游戏成功与否
|
||||||
|
@ -55,18 +56,30 @@ export class GameConfig {
|
||||||
return this._instance;
|
return this._instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getKey(key){
|
||||||
|
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
|
||||||
|
var r = window.location.search.substr(1).match(reg);
|
||||||
|
if (r != null) {
|
||||||
|
return unescape(r[2]);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
static init(){
|
static init(){
|
||||||
this.GM_INFO_init();
|
this.GM_INFO_init();
|
||||||
this.CLICK_init();
|
this.CLICK_init();
|
||||||
this.LEVEL_INFO_init();
|
this.LEVEL_INFO_init();
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {
|
cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let jsonData: object = res.json!;
|
let jsonData: object = res.json!;
|
||||||
self.GM_INFO = jsonData["data"];
|
self.GM_INFO = jsonData["data"];
|
||||||
|
self.setCode(self.getKey("scode"));
|
||||||
WeChat.setShare(location.href);
|
WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
|
|
||||||
|
@ -101,12 +114,14 @@ export class GameConfig {
|
||||||
currSeed: 203213, //用于随机数种子
|
currSeed: 203213, //用于随机数种子
|
||||||
gameId: '100009', //游戏ID
|
gameId: '100009', //游戏ID
|
||||||
userId: 0, //用户ID
|
userId: 0, //用户ID
|
||||||
|
scode: "", //用户code,从网页后缀获取
|
||||||
guide: true, //是否有引导
|
guide: true, //是否有引导
|
||||||
url: "https://api.sparkus.cn",//访问域名
|
url: "https://api.sparkus.cn",//访问域名
|
||||||
success: false, //用户游戏成功与否
|
success: false, //用户游戏成功与否
|
||||||
matchId: null, //用于埋点上传的ID
|
matchId: null, //用于埋点上传的ID
|
||||||
custom: 0 //用于测试跳关卡
|
custom: 0 //用于测试跳关卡
|
||||||
};
|
};
|
||||||
|
this.setCode(this.getKey("scode"));
|
||||||
}
|
}
|
||||||
static CLICK_init() {
|
static CLICK_init() {
|
||||||
this.CLICK_DATA =
|
this.CLICK_DATA =
|
||||||
|
@ -335,7 +350,9 @@ export class GameConfig {
|
||||||
cc.fx.GameTool.Authentication();
|
cc.fx.GameTool.Authentication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static setCode(code){
|
||||||
|
this.GM_INFO.scode = code;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,40 +6,37 @@ const BASE_URL = "https://api.sparkus.cn";
|
||||||
//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool
|
//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool
|
||||||
@ccclass
|
@ccclass
|
||||||
export default class HttpUtil extends cc.Component {
|
export default class HttpUtil extends cc.Component {
|
||||||
static async getShareInfo(shareUrl: string): Promise<any> {
|
|
||||||
console.log("设置分享链接:",shareUrl);
|
|
||||||
const time = Math.floor((new Date().getTime()) / 1000)
|
|
||||||
const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${config.gameId}&time=${time}&url=${shareUrl}`,{})
|
|
||||||
return this.post(url,null,null);
|
|
||||||
}
|
|
||||||
//排行榜
|
//排行榜
|
||||||
static async rankData(type,callback,data): Promise<any> {
|
static async rankData(type,callback,data): Promise<any> {
|
||||||
const time = Math.floor((new Date().getTime()) / 1000)
|
const time = Math.floor((new Date().getTime()) / 1000)
|
||||||
const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)
|
const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)
|
||||||
this.post(url,data,callback);
|
this.post(url,data,callback,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async uploadUserLogData(data,callback): Promise<any> {
|
static async uploadUserLogData(data,callback): Promise<any> {
|
||||||
const url = '/log/collect/data';
|
const url = '/log/collect/data';
|
||||||
this.post(url,data,callback);
|
this.post(url,data,callback,3);
|
||||||
}
|
}
|
||||||
//暂时用不到
|
//暂时用不到
|
||||||
static async getUserRecord(data,callback): Promise<any> {
|
static async getUserRecord(data,callback): Promise<any> {
|
||||||
const time = Math.floor((new Date().getTime()) / 1000)
|
const time = Math.floor((new Date().getTime()) / 1000)
|
||||||
const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)
|
const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)
|
||||||
this.post(url,data,callback);
|
this.post(url,data,callback,0);
|
||||||
}
|
}
|
||||||
static async post(url, data, callback) {
|
|
||||||
const response = await this.fetchData(url, data, 'POST');
|
static async get(url, callback,count) {
|
||||||
|
let repeat = count?count:0;
|
||||||
|
const response = await this.fetchData(url, null, 'GET',repeat);
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async get(url, callback) {
|
static async post(url, data, callback,count) {
|
||||||
const response = await this.fetchData(url, null, 'GET');
|
let repeat = count?count:0;
|
||||||
|
const response = await this.fetchData(url, data, 'POST',repeat);
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async fetchData(url, data, method) {
|
static async fetchData(url, data, method,repeat) {
|
||||||
const fullUrl = `${BASE_URL}${url}`;
|
const fullUrl = `${BASE_URL}${url}`;
|
||||||
const headers = { 'Content-Type': 'application/json' };
|
const headers = { 'Content-Type': 'application/json' };
|
||||||
const options = {
|
const options = {
|
||||||
|
@ -49,18 +46,37 @@ export default class HttpUtil extends cc.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(fullUrl, options);
|
var response = await this.fetchWithTimeout(fullUrl,options);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP_______________error! status: ${response.status}`);
|
||||||
}
|
}
|
||||||
return await response.json();
|
return await response.json();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Fetch error:', error);
|
console.error('Fetch_______________error:', error);
|
||||||
return null;
|
if(repeat > 0){
|
||||||
|
repeat -= 1;
|
||||||
|
const timeOut = (3-repeat)*5000;
|
||||||
|
setTimeout(async () => {
|
||||||
|
response = await this.fetchData(url, data, method,repeat);
|
||||||
|
}, timeOut);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async fetchWithTimeout(resource, options = {}) {
|
||||||
|
const controller = new AbortController();
|
||||||
|
const id = setTimeout(() => controller.abort(), 5000);
|
||||||
|
const response = await fetch(resource, {
|
||||||
|
...options,
|
||||||
|
signal: controller.signal
|
||||||
|
});
|
||||||
|
clearTimeout(id);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param url {string} 接口地址
|
* @param url {string} 接口地址
|
||||||
|
|
|
@ -26,6 +26,7 @@ export class WeChat {
|
||||||
static getResult(res){
|
static getResult(res){
|
||||||
if(res){
|
if(res){
|
||||||
var data = res.data;
|
var data = res.data;
|
||||||
|
// @ts-ignore
|
||||||
wx.config({
|
wx.config({
|
||||||
debug: false,
|
debug: false,
|
||||||
appId: data.appId,
|
appId: data.appId,
|
||||||
|
@ -34,22 +35,25 @@ export class WeChat {
|
||||||
signature: data.signature,
|
signature: data.signature,
|
||||||
jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
|
jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
|
||||||
});
|
});
|
||||||
|
// @ts-ignore
|
||||||
wx.checkJsApi({
|
wx.checkJsApi({
|
||||||
jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
|
jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 100);
|
}, 200);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 200);
|
}, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static changeShare(){
|
static changeShare(){
|
||||||
|
// @ts-ignore
|
||||||
wx.ready(() => {
|
wx.ready(() => {
|
||||||
|
// @ts-ignore
|
||||||
wx.updateAppMessageShareData({
|
wx.updateAppMessageShareData({
|
||||||
title: '记忆力认知测评', // 分享标题
|
title: '记忆力认知测评', // 分享标题
|
||||||
desc: '你的注意力和工作记忆有问题吗?', // 分享描述
|
desc: '你的注意力和工作记忆有问题吗?', // 分享描述
|
||||||
|
@ -60,15 +64,19 @@ export class WeChat {
|
||||||
console.log("分享好友成功回调");
|
console.log("分享好友成功回调");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
wx.updateTimelineShareData({
|
setTimeout(() => {
|
||||||
title: '记忆力认知测评', // 分享标题
|
// @ts-ignore
|
||||||
link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
wx.updateTimelineShareData({
|
||||||
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标
|
title: '记忆力认知测评', // 分享标题
|
||||||
success: function () {
|
link: shareConfig.shareLine, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
||||||
// 设置成功
|
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标
|
||||||
console.log("分享朋友圈成功回调");
|
success: function () {
|
||||||
}
|
// 设置成功
|
||||||
})
|
console.log("分享朋友圈成功回调");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 200);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +88,7 @@ export class WeChat {
|
||||||
static async getShareInfo(shareUrl: string, callback:Function): Promise<any> {
|
static async getShareInfo(shareUrl: string, callback:Function): Promise<any> {
|
||||||
const time = Math.floor((new Date().getTime()) / 1000)
|
const time = Math.floor((new Date().getTime()) / 1000)
|
||||||
const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${cc.fx.GameConfig.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{})
|
const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${cc.fx.GameConfig.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{})
|
||||||
return cc.fx.HttpUtil.get(url,callback)
|
return cc.fx.HttpUtil.get(url,callback,3)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,18 +10,23 @@ var GameTool = {
|
||||||
var data = null;
|
var data = null;
|
||||||
if(localStorage.getItem(name)) data = JSON.parse(localStorage.getItem(name));
|
if(localStorage.getItem(name)) data = JSON.parse(localStorage.getItem(name));
|
||||||
if(data == "undifend" || data==null || data == ""){
|
if(data == "undifend" || data==null || data == ""){
|
||||||
var urlNow = window.location.href;
|
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+
|
||||||
if(!this.containsTrain(urlNow) || !this.isNumber(data.userId)){
|
encodeURIComponent(location.href);
|
||||||
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
console.log("链接没ID准备跳转",url);
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(!this.isNumber(data.userId)){
|
||||||
|
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+
|
||||||
|
encodeURIComponent(location.href);
|
||||||
|
console.log("链接不合法",url);
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
cc.fx.StorageMessage.setStorage(name,data);
|
||||||
|
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
cc.fx.StorageMessage.setStorage(name,data);
|
|
||||||
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isNumber(value) {
|
isNumber(value) {
|
||||||
|
@ -31,10 +36,6 @@ var GameTool = {
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
containsTrain(str) {
|
|
||||||
return /from=train/i.test(str);
|
|
||||||
},
|
|
||||||
|
|
||||||
//埋点上传
|
//埋点上传
|
||||||
setGameData(){
|
setGameData(){
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
|
@ -47,6 +48,7 @@ var GameTool = {
|
||||||
let postData = {
|
let postData = {
|
||||||
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
|
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId":cc.fx.GameConfig.GM_INFO.userId,
|
"userId":cc.fx.GameConfig.GM_INFO.userId,
|
||||||
|
"scode":cc.fx.GameConfig.GM_INFO.scode,
|
||||||
"matchId":matchId,
|
"matchId":matchId,
|
||||||
"data": data
|
"data": data
|
||||||
};
|
};
|
||||||
|
|
|
@ -158,7 +158,7 @@
|
||||||
if(containsNanana(urlNow) == true){
|
if(containsNanana(urlNow) == true){
|
||||||
document.title = "后裔逐日 | 测试环境";
|
document.title = "后裔逐日 | 测试环境";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 存储gameid userid gameid为key userId和时间戳为value
|
// 存储gameid userid gameid为key userId和时间戳为value
|
||||||
let name = "user_" + "100009";
|
let name = "user_" + "100009";
|
||||||
var data = JSON.parse(localStorage.getItem(name));
|
var data = JSON.parse(localStorage.getItem(name));
|
||||||
|
@ -175,7 +175,6 @@
|
||||||
console.log("缓存过期");
|
console.log("缓存过期");
|
||||||
setId(name);
|
setId(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(!isNumber(userId)){
|
else if(!isNumber(userId)){
|
||||||
console.log("缓存异常");
|
console.log("缓存异常");
|
||||||
setId(name);
|
setId(name);
|
||||||
|
@ -191,27 +190,28 @@
|
||||||
}
|
}
|
||||||
function setId(name){
|
function setId(name){
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
let userId = getUserId();
|
let userId = getKey("userId");
|
||||||
if(userId == null){
|
if(userId == null){
|
||||||
if(!containsTrain(urlNow) || !isNumber(userId)){
|
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + encodeURIComponent(location.href);
|
||||||
console.log("链接没ID准备跳转");
|
console.log("链接没ID准备跳转",url);
|
||||||
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}else{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("链接有ID",userId);
|
|
||||||
let timestamp = parseInt(new Date().getTime()/1000 + "");
|
let timestamp = parseInt(new Date().getTime()/1000 + "");
|
||||||
let idData = {
|
let idData = {
|
||||||
userId: userId,
|
userId: parseInt(userId),
|
||||||
time: timestamp
|
time: timestamp
|
||||||
}
|
}
|
||||||
localStorage.setItem(name,JSON.stringify(idData));
|
localStorage.setItem(name,JSON.stringify(idData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function genSignStr(url, postStr) {
|
||||||
|
// let lessUrl = url.replace('?', '')
|
||||||
|
// lessUrl = lessUrl + "&" + postStr
|
||||||
|
// return encodeURIComponent(fxCry.hmacSha256(lessUrl))
|
||||||
|
// }
|
||||||
|
|
||||||
function containsNanana(str) {
|
function containsNanana(str) {
|
||||||
return /test/i.test(str);
|
return /test/i.test(str);
|
||||||
}
|
}
|
||||||
|
@ -230,9 +230,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getUserId() {
|
function getKey(key){
|
||||||
var name = "userId";
|
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
|
||||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
|
||||||
var r = window.location.search.substr(1).match(reg);
|
var r = window.location.search.substr(1).match(reg);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
return unescape(r[2]);
|
return unescape(r[2]);
|
||||||
|
@ -240,8 +239,6 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getFrom() {
|
function getFrom() {
|
||||||
let pathStr = window.location.search;
|
let pathStr = window.location.search;
|
||||||
let arr=pathStr.split("&");
|
let arr=pathStr.split("&");
|
||||||
|
@ -257,12 +254,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function containsTrain(str) {
|
|
||||||
var result = /from=train/i.test(str);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js', function () {
|
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js', function () {
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
|
|
Binary file not shown.
1
build/SunMoves/assets/main/index.57d1e.js
Normal file
1
build/SunMoves/assets/main/index.57d1e.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -136,9 +136,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
||||||
<script src="src/settings.d8490.js" charset="utf-8"></script>
|
<script src="src/settings.9a03e.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<script src="main.b9a5b.js" charset="utf-8"></script>
|
<script src="main.a4f77.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
if(containsNanana(urlNow) == true){
|
if(containsNanana(urlNow) == true){
|
||||||
document.title = "后裔逐日 | 测试环境";
|
document.title = "后裔逐日 | 测试环境";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 存储gameid userid gameid为key userId和时间戳为value
|
// 存储gameid userid gameid为key userId和时间戳为value
|
||||||
let name = "user_" + "100009";
|
let name = "user_" + "100009";
|
||||||
var data = JSON.parse(localStorage.getItem(name));
|
var data = JSON.parse(localStorage.getItem(name));
|
||||||
|
@ -175,7 +175,6 @@
|
||||||
console.log("缓存过期");
|
console.log("缓存过期");
|
||||||
setId(name);
|
setId(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(!isNumber(userId)){
|
else if(!isNumber(userId)){
|
||||||
console.log("缓存异常");
|
console.log("缓存异常");
|
||||||
setId(name);
|
setId(name);
|
||||||
|
@ -191,27 +190,28 @@
|
||||||
}
|
}
|
||||||
function setId(name){
|
function setId(name){
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
let userId = getUserId();
|
let userId = getKey("userId");
|
||||||
if(userId == null){
|
if(userId == null){
|
||||||
if(!containsTrain(urlNow) || !isNumber(userId)){
|
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + encodeURIComponent(location.href);
|
||||||
console.log("链接没ID准备跳转");
|
console.log("链接没ID准备跳转",url);
|
||||||
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}else{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("链接有ID",userId);
|
|
||||||
let timestamp = parseInt(new Date().getTime()/1000 + "");
|
let timestamp = parseInt(new Date().getTime()/1000 + "");
|
||||||
let idData = {
|
let idData = {
|
||||||
userId: userId,
|
userId: parseInt(userId),
|
||||||
time: timestamp
|
time: timestamp
|
||||||
}
|
}
|
||||||
localStorage.setItem(name,JSON.stringify(idData));
|
localStorage.setItem(name,JSON.stringify(idData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function genSignStr(url, postStr) {
|
||||||
|
// let lessUrl = url.replace('?', '')
|
||||||
|
// lessUrl = lessUrl + "&" + postStr
|
||||||
|
// return encodeURIComponent(fxCry.hmacSha256(lessUrl))
|
||||||
|
// }
|
||||||
|
|
||||||
function containsNanana(str) {
|
function containsNanana(str) {
|
||||||
return /test/i.test(str);
|
return /test/i.test(str);
|
||||||
}
|
}
|
||||||
|
@ -230,9 +230,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getUserId() {
|
function getKey(key){
|
||||||
var name = "userId";
|
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
|
||||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
|
||||||
var r = window.location.search.substr(1).match(reg);
|
var r = window.location.search.substr(1).match(reg);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
return unescape(r[2]);
|
return unescape(r[2]);
|
||||||
|
@ -240,8 +239,6 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getFrom() {
|
function getFrom() {
|
||||||
let pathStr = window.location.search;
|
let pathStr = window.location.search;
|
||||||
let arr=pathStr.split("&");
|
let arr=pathStr.split("&");
|
||||||
|
@ -257,14 +254,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function containsTrain(str) {
|
|
||||||
var result = /from=train/i.test(str);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.2e4d7.js', function () {
|
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.bb976.js', function () {
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
|
loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ window.boot = function () {
|
||||||
if (window.jsb) {
|
if (window.jsb) {
|
||||||
var isRuntime = (typeof loadRuntime === 'function');
|
var isRuntime = (typeof loadRuntime === 'function');
|
||||||
if (isRuntime) {
|
if (isRuntime) {
|
||||||
require('src/settings.d8490.js');
|
require('src/settings.9a03e.js');
|
||||||
require('src/cocos2d-runtime.js');
|
require('src/cocos2d-runtime.js');
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
require('src/physics.js');
|
require('src/physics.js');
|
||||||
|
@ -125,7 +125,7 @@ if (window.jsb) {
|
||||||
require('jsb-adapter/engine/index.js');
|
require('jsb-adapter/engine/index.js');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require('src/settings.d8490.js');
|
require('src/settings.9a03e.js');
|
||||||
require('src/cocos2d-jsb.js');
|
require('src/cocos2d-jsb.js');
|
||||||
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
|
||||||
require('src/physics.js');
|
require('src/physics.js');
|
|
@ -1 +1 @@
|
||||||
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[],bundleVers:{internal:"52d36",resources:"2d635",main:"fc4e1"}};
|
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[],bundleVers:{internal:"52d36",resources:"2d635",main:"57d1e"}};
|
|
@ -17,18 +17,23 @@ var GameTool = {
|
||||||
if (localStorage.getItem(name))
|
if (localStorage.getItem(name))
|
||||||
data = JSON.parse(localStorage.getItem(name));
|
data = JSON.parse(localStorage.getItem(name));
|
||||||
if (data == "undifend" || data == null || data == "") {
|
if (data == "undifend" || data == null || data == "") {
|
||||||
var urlNow = window.location.href;
|
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
|
||||||
if (!this.containsTrain(urlNow) || !this.isNumber(data.userId)) {
|
encodeURIComponent(location.href);
|
||||||
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
console.log("链接没ID准备跳转", url);
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!this.isNumber(data.userId)) {
|
||||||
|
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
|
||||||
|
encodeURIComponent(location.href);
|
||||||
|
console.log("链接不合法", url);
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
cc.fx.StorageMessage.setStorage(name, data);
|
||||||
|
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
cc.fx.StorageMessage.setStorage(name, data);
|
|
||||||
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
isNumber: function (value) {
|
isNumber: function (value) {
|
||||||
var result = false;
|
var result = false;
|
||||||
|
@ -38,9 +43,6 @@ var GameTool = {
|
||||||
result = false;
|
result = false;
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
containsTrain: function (str) {
|
|
||||||
return /from=train/i.test(str);
|
|
||||||
},
|
|
||||||
//埋点上传
|
//埋点上传
|
||||||
setGameData: function () {
|
setGameData: function () {
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
|
@ -53,6 +55,7 @@ var GameTool = {
|
||||||
var postData = {
|
var postData = {
|
||||||
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
||||||
|
"scode": cc.fx.GameConfig.GM_INFO.scode,
|
||||||
"matchId": matchId,
|
"matchId": matchId,
|
||||||
"data": data
|
"data": data
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31,6 +31,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
window.initMgr();
|
window.initMgr();
|
||||||
|
// WeChat.setShare(location.href);
|
||||||
cc.fx.GameConfig.init();
|
cc.fx.GameConfig.init();
|
||||||
// cc.fx.AudioManager._instance.init();
|
// cc.fx.AudioManager._instance.init();
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA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CjD;kBApCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n start () {\r\n window.initMgr();\r\n cc.fx.GameConfig.init();\r\n // cc.fx.AudioManager._instance.init();\r\n var urlNow = window.location.href;\r\n if(this.containsTrain(urlNow)){\r\n console.log(\"无排行版本\");\r\n this.node.getChildByName(\"Rank\").active = false;\r\n }\r\n else{\r\n console.log(\"有排行版本\");\r\n }\r\n }\r\n\r\n //判断来源\r\n containsTrain(str) {\r\n return /from=train/i.test(str);\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;;IAqCA,CAAC;IApCG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,kCAAkC;QAClC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,uCAAuC;QACvC,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClC,IAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;SACnD;aACG;YACA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACxB;IACL,CAAC;IAED,MAAM;IACN,gCAAa,GAAb,UAAc,GAAG;QACb,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IApCgB,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAqC5B;IAAD,eAAC;CArCD,AAqCC,CArCqC,EAAE,CAAC,SAAS,GAqCjD;kBArCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["import { WeChat } from \"./module/Share/share\";\r\n\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n start () {\r\n window.initMgr();\r\n // WeChat.setShare(location.href);\r\n cc.fx.GameConfig.init();\r\n // cc.fx.AudioManager._instance.init();\r\n var urlNow = window.location.href;\r\n if(this.containsTrain(urlNow)){\r\n console.log(\"无排行版本\");\r\n this.node.getChildByName(\"Rank\").active = false;\r\n }\r\n else{\r\n console.log(\"有排行版本\");\r\n }\r\n }\r\n\r\n //判断来源\r\n containsTrain(str) {\r\n return /from=train/i.test(str);\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
|
@ -71,10 +71,10 @@ var WeChat = /** @class */ (function () {
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 100);
|
}, 200);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 200);
|
}, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,17 @@ var WeChat = /** @class */ (function () {
|
||||||
console.log("分享好友成功回调");
|
console.log("分享好友成功回调");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
wx.updateTimelineShareData({
|
setTimeout(function () {
|
||||||
title: '记忆力认知测评',
|
wx.updateTimelineShareData({
|
||||||
link: shareConfig.shareLine,
|
title: '记忆力认知测评',
|
||||||
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
|
link: shareConfig.shareLine,
|
||||||
success: function () {
|
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
|
||||||
// 设置成功
|
success: function () {
|
||||||
console.log("分享朋友圈成功回调");
|
// 设置成功
|
||||||
}
|
console.log("分享朋友圈成功回调");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
WeChat.getSignature = function (url) {
|
WeChat.getSignature = function (url) {
|
||||||
|
@ -113,7 +115,7 @@ var WeChat = /** @class */ (function () {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
||||||
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback)];
|
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback, 3)];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,17 @@ var __extends = (this && this.__extends) || (function () {
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
var __assign = (this && this.__assign) || function () {
|
||||||
|
__assign = Object.assign || function(t) {
|
||||||
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||||
|
s = arguments[i];
|
||||||
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||||
|
t[p] = s[p];
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
};
|
||||||
|
return __assign.apply(this, arguments);
|
||||||
|
};
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
@ -69,17 +80,6 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
return _super !== null && _super.apply(this, arguments) || this;
|
||||||
}
|
}
|
||||||
HttpUtil_1 = HttpUtil;
|
HttpUtil_1 = HttpUtil;
|
||||||
HttpUtil.getShareInfo = function (shareUrl) {
|
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
|
||||||
var time, url;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
console.log("设置分享链接:", shareUrl);
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
|
||||||
url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
|
||||||
return [2 /*return*/, this.post(url, null, null)];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
//排行榜
|
//排行榜
|
||||||
HttpUtil.rankData = function (type, callback, data) {
|
HttpUtil.rankData = function (type, callback, data) {
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
return __awaiter(this, void 0, Promise, function () {
|
||||||
|
@ -87,7 +87,7 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 0);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
var url;
|
var url;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
url = '/log/collect/data';
|
url = '/log/collect/data';
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 3);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -109,17 +109,19 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 0);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.post = function (url, data, callback) {
|
HttpUtil.get = function (url, callback, count) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var response;
|
var repeat, response;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, data, 'POST')];
|
case 0:
|
||||||
|
repeat = count ? count : 0;
|
||||||
|
return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)];
|
||||||
case 1:
|
case 1:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
|
@ -128,12 +130,14 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.get = function (url, callback) {
|
HttpUtil.post = function (url, data, callback, count) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var response;
|
var repeat, response;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, null, 'GET')];
|
case 0:
|
||||||
|
repeat = count ? count : 0;
|
||||||
|
return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)];
|
||||||
case 1:
|
case 1:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
|
@ -142,9 +146,10 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.fetchData = function (url, data, method) {
|
HttpUtil.fetchData = function (url, data, method, repeat) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var fullUrl, headers, options, response, error_1;
|
var fullUrl, headers, options, response, error_1, timeOut;
|
||||||
|
var _this = this;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -158,23 +163,58 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
_a.label = 1;
|
_a.label = 1;
|
||||||
case 1:
|
case 1:
|
||||||
_a.trys.push([1, 4, , 5]);
|
_a.trys.push([1, 4, , 5]);
|
||||||
return [4 /*yield*/, fetch(fullUrl, options)];
|
return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)];
|
||||||
case 2:
|
case 2:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error("HTTP error! status: " + response.status);
|
throw new Error("HTTP_______________error! status: " + response.status);
|
||||||
}
|
}
|
||||||
return [4 /*yield*/, response.json()];
|
return [4 /*yield*/, response.json()];
|
||||||
case 3: return [2 /*return*/, _a.sent()];
|
case 3: return [2 /*return*/, _a.sent()];
|
||||||
case 4:
|
case 4:
|
||||||
error_1 = _a.sent();
|
error_1 = _a.sent();
|
||||||
console.error('Fetch error:', error_1);
|
console.error('Fetch_______________error:', error_1);
|
||||||
return [2 /*return*/, null];
|
if (repeat > 0) {
|
||||||
|
repeat -= 1;
|
||||||
|
timeOut = (3 - repeat) * 5000;
|
||||||
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
||||||
|
return __generator(this, function (_a) {
|
||||||
|
switch (_a.label) {
|
||||||
|
case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)];
|
||||||
|
case 1:
|
||||||
|
response = _a.sent();
|
||||||
|
return [2 /*return*/];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}); }, timeOut);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [2 /*return*/, null];
|
||||||
|
}
|
||||||
|
return [3 /*break*/, 5];
|
||||||
case 5: return [2 /*return*/];
|
case 5: return [2 /*return*/];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
HttpUtil.fetchWithTimeout = function (resource, options) {
|
||||||
|
if (options === void 0) { options = {}; }
|
||||||
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
|
var controller, id, response;
|
||||||
|
return __generator(this, function (_a) {
|
||||||
|
switch (_a.label) {
|
||||||
|
case 0:
|
||||||
|
controller = new AbortController();
|
||||||
|
id = setTimeout(function () { return controller.abort(); }, 5000);
|
||||||
|
return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))];
|
||||||
|
case 1:
|
||||||
|
response = _a.sent();
|
||||||
|
clearTimeout(id);
|
||||||
|
return [2 /*return*/, response];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param url {string} 接口地址
|
* @param url {string} 接口地址
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -71,7 +71,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
NewClass.prototype.jumpFinishi = function () {
|
NewClass.prototype.jumpFinishi = function () {
|
||||||
var url = "https://train.sparkus.cn/poster/game/";
|
var url = "https://train.sparkus.cn/poster/game/" + cc.fx.GameConfig.GM_INFO.scode + "?suc=1";
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
};
|
};
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,6 +27,14 @@ var GameConfig = /** @class */ (function () {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
GameConfig.getKey = function (key) {
|
||||||
|
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
|
||||||
|
var r = window.location.search.substr(1).match(reg);
|
||||||
|
if (r != null) {
|
||||||
|
return unescape(r[2]);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
GameConfig.init = function () {
|
GameConfig.init = function () {
|
||||||
this.GM_INFO_init();
|
this.GM_INFO_init();
|
||||||
this.CLICK_init();
|
this.CLICK_init();
|
||||||
|
@ -34,11 +42,13 @@ var GameConfig = /** @class */ (function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
cc.resources.load('Json/GM_INFO', function (err, res) {
|
cc.resources.load('Json/GM_INFO', function (err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
share_1.WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var jsonData = res.json;
|
var jsonData = res.json;
|
||||||
self.GM_INFO = jsonData["data"];
|
self.GM_INFO = jsonData["data"];
|
||||||
|
self.setCode(self.getKey("scode"));
|
||||||
share_1.WeChat.setShare(location.href);
|
share_1.WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
});
|
});
|
||||||
|
@ -68,12 +78,14 @@ var GameConfig = /** @class */ (function () {
|
||||||
currSeed: 203213,
|
currSeed: 203213,
|
||||||
gameId: '100009',
|
gameId: '100009',
|
||||||
userId: 0,
|
userId: 0,
|
||||||
|
scode: "",
|
||||||
guide: true,
|
guide: true,
|
||||||
url: "https://api.sparkus.cn",
|
url: "https://api.sparkus.cn",
|
||||||
success: false,
|
success: false,
|
||||||
matchId: null,
|
matchId: null,
|
||||||
custom: 0 //用于测试跳关卡
|
custom: 0 //用于测试跳关卡
|
||||||
};
|
};
|
||||||
|
this.setCode(this.getKey("scode"));
|
||||||
};
|
};
|
||||||
GameConfig.CLICK_init = function () {
|
GameConfig.CLICK_init = function () {
|
||||||
this.CLICK_DATA =
|
this.CLICK_DATA =
|
||||||
|
@ -300,6 +312,9 @@ var GameConfig = /** @class */ (function () {
|
||||||
GameConfig.Authentication = function () {
|
GameConfig.Authentication = function () {
|
||||||
cc.fx.GameTool.Authentication();
|
cc.fx.GameTool.Authentication();
|
||||||
};
|
};
|
||||||
|
GameConfig.setCode = function (code) {
|
||||||
|
this.GM_INFO.scode = code;
|
||||||
|
};
|
||||||
var GameConfig_1;
|
var GameConfig_1;
|
||||||
//所有控制信息都通过GameAppStart内控制
|
//所有控制信息都通过GameAppStart内控制
|
||||||
GameConfig._instance = null;
|
GameConfig._instance = null;
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -5,21 +5,21 @@
|
||||||
"main": true,
|
"main": true,
|
||||||
"url": "app://editor/index.html",
|
"url": "app://editor/index.html",
|
||||||
"windowType": "dockable",
|
"windowType": "dockable",
|
||||||
"x": 0,
|
"x": -8,
|
||||||
"y": 0,
|
"y": -8,
|
||||||
"width": 1280,
|
"width": 1296,
|
||||||
"height": 672,
|
"height": 688,
|
||||||
"layout": {
|
"layout": {
|
||||||
"type": "dock-h",
|
"type": "dock-h",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"width": 205,
|
"width": 207.28125,
|
||||||
"height": 556.3333740234375,
|
"height": 571,
|
||||||
"type": "dock-v",
|
"type": "dock-v",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"width": 205,
|
"width": 207.28125,
|
||||||
"height": 300.1770935058594,
|
"height": 308.13543701171875,
|
||||||
"type": "panel",
|
"type": "panel",
|
||||||
"active": 0,
|
"active": 0,
|
||||||
"children": [
|
"children": [
|
||||||
|
@ -27,8 +27,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"width": 205,
|
"width": 207.28125,
|
||||||
"height": 253.15625,
|
"height": 259.8645935058594,
|
||||||
"type": "panel",
|
"type": "panel",
|
||||||
"active": 0,
|
"active": 0,
|
||||||
"children": [
|
"children": [
|
||||||
|
@ -38,8 +38,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"width": 750,
|
"width": 758.3333740234375,
|
||||||
"height": 556.3333740234375,
|
"height": 571,
|
||||||
"type": "panel",
|
"type": "panel",
|
||||||
"active": 0,
|
"active": 0,
|
||||||
"children": [
|
"children": [
|
||||||
|
@ -47,8 +47,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"width": 305,
|
"width": 308.38543701171875,
|
||||||
"height": 556.3333740234375,
|
"height": 571,
|
||||||
"type": "panel",
|
"type": "panel",
|
||||||
"active": 0,
|
"active": 0,
|
||||||
"children": [
|
"children": [
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":"1.0.8","stats":{"C:/Work/Project/Sun_moves/temp/quick-scripts/src/__qc_index__.js":"2024-08-15T03:45:36.197Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GuideManager.js":"2024-08-15T03:45:36.139Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-08-15T03:45:36.152Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Crypto/crypto-js.min.js":"2024-08-15T03:45:36.158Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/RankManager.js":"2024-08-15T03:45:36.159Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/DynamicAtlasManager.js":"2024-08-15T03:45:36.147Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Load.js":"2024-08-15T03:45:36.141Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Sun.js":"2024-08-15T03:45:36.143Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-08-15T03:45:36.154Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-08-15T03:45:36.153Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Storage/Storage.js":"2024-08-15T03:45:36.138Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/RankList/ItemRender.js":"2024-08-15T03:45:36.156Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Notification/Notification.js":"2024-08-15T03:45:36.145Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Share/share.js":"2024-08-15T03:45:36.150Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/GameStart/GameAppStart.js":"2024-08-15T03:45:36.148Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Tool/GameTool.js":"2024-08-15T03:45:36.140Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Config/GameConfig.js":"2024-08-15T03:45:36.155Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Music/AudioManager.js":"2024-08-15T03:45:36.146Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/RankList/List.js":"2024-08-15T03:45:36.157Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Crypto/HttpUtil.js":"2024-08-15T03:45:36.151Z"}}
|
{"version":"1.0.8","stats":{"C:/Work/Project/Sun_moves/temp/quick-scripts/src/__qc_index__.js":"2024-08-27T07:07:42.061Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/RankManager.js":"2024-08-27T07:07:42.034Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Load.js":"2024-08-27T07:07:42.010Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GuideManager.js":"2024-08-27T07:07:42.006Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-08-27T07:07:42.022Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/Sun.js":"2024-08-27T07:07:42.011Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-08-27T07:07:42.023Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-08-27T07:07:42.025Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/DynamicAtlasManager.js":"2024-08-27T07:07:42.015Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Crypto/HttpUtil.js":"2024-08-27T07:07:42.021Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/RankList/ItemRender.js":"2024-08-27T07:07:42.028Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Notification/Notification.js":"2024-08-27T07:07:42.012Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Music/AudioManager.js":"2024-08-27T07:07:42.014Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Config/GameConfig.js":"2024-08-27T07:07:42.026Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Storage/Storage.js":"2024-08-27T07:07:42.005Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/GameStart/GameAppStart.js":"2024-08-27T07:07:42.017Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Share/share.js":"2024-08-27T07:07:42.019Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Tool/GameTool.js":"2024-08-27T07:07:42.007Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/Crypto/crypto-js.min.js":"2024-08-27T07:07:42.033Z","C:/Work/Project/Sun_moves/temp/quick-scripts/src/assets/Script/module/RankList/List.js":"2024-08-27T07:07:42.030Z"}}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var scripts = [{"deps":{"./assets/Script/GameOver":9,"./assets/Script/GuideManager":1,"./assets/Script/Load":6,"./assets/Script/RankManager":4,"./assets/Script/Sun":7,"./assets/Script/DynamicAtlasManager":5,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":2,"./assets/Script/module/Crypto/crypto-js.min":3,"./assets/Script/module/Crypto/HttpUtil":19,"./assets/Script/module/GameStart/GameAppStart":14,"./assets/Script/module/Music/AudioManager":17,"./assets/Script/module/Notification/Notification":12,"./assets/Script/module/RankList/List":18,"./assets/Script/module/RankList/ItemRender":11,"./assets/Script/module/Share/share":13,"./assets/Script/module/Storage/Storage":10,"./assets/Script/module/Tool/GameTool":15,"./assets/Script/module/Config/GameConfig":16,"./assets/Script/GameManager":8},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/Script/GuideManager.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Crypto/crypto-js.min.js"},{"deps":{"./module/RankList/List":18},"path":"preview-scripts/assets/Script/RankManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/DynamicAtlasManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{},"path":"preview-scripts/assets/Script/Sun.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Storage/Storage.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/RankList/ItemRender.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Notification/Notification.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Share/share.js"},{"deps":{"../Config/GameConfig":16,"../Crypto/HttpUtil":19,"../Music/AudioManager":17,"../Notification/Notification":12,"../Storage/Storage":10,"../Tool/GameTool":15},"path":"preview-scripts/assets/Script/module/GameStart/GameAppStart.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Tool/GameTool.js"},{"deps":{"../Share/share":13},"path":"preview-scripts/assets/Script/module/Config/GameConfig.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Music/AudioManager.js"},{"deps":{"./ItemRender":11},"path":"preview-scripts/assets/Script/module/RankList/List.js"},{"deps":{"./crypto-js.min.js":3},"path":"preview-scripts/assets/Script/module/Crypto/HttpUtil.js"}];
|
var scripts = [{"deps":{"./assets/Script/RankManager":1,"./assets/Script/Load":2,"./assets/Script/GuideManager":3,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":4,"./assets/Script/Sun":5,"./assets/Script/GameOver":6,"./assets/Script/GameManager":7,"./assets/Script/DynamicAtlasManager":8,"./assets/Script/module/Crypto/HttpUtil":9,"./assets/Script/module/RankList/ItemRender":10,"./assets/Script/module/Notification/Notification":11,"./assets/Script/module/Music/AudioManager":12,"./assets/Script/module/Config/GameConfig":13,"./assets/Script/module/Storage/Storage":14,"./assets/Script/module/GameStart/GameAppStart":15,"./assets/Script/module/Share/share":16,"./assets/Script/module/Tool/GameTool":17,"./assets/Script/module/Crypto/crypto-js.min":18,"./assets/Script/module/RankList/List":19},"path":"preview-scripts/__qc_index__.js"},{"deps":{"./module/RankList/List":19},"path":"preview-scripts/assets/Script/RankManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{},"path":"preview-scripts/assets/Script/GuideManager.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{},"path":"preview-scripts/assets/Script/Sun.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/DynamicAtlasManager.js"},{"deps":{"./crypto-js.min.js":18},"path":"preview-scripts/assets/Script/module/Crypto/HttpUtil.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/RankList/ItemRender.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Notification/Notification.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Music/AudioManager.js"},{"deps":{"../Share/share":16},"path":"preview-scripts/assets/Script/module/Config/GameConfig.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Storage/Storage.js"},{"deps":{"../Config/GameConfig":13,"../Crypto/HttpUtil":9,"../Music/AudioManager":12,"../Notification/Notification":11,"../Storage/Storage":14,"../Tool/GameTool":17},"path":"preview-scripts/assets/Script/module/GameStart/GameAppStart.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Share/share.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Tool/GameTool.js"},{"deps":{},"path":"preview-scripts/assets/Script/module/Crypto/crypto-js.min.js"},{"deps":{"./ItemRender":10},"path":"preview-scripts/assets/Script/module/RankList/List.js"}];
|
||||||
var entries = ["preview-scripts/__qc_index__.js"];
|
var entries = ["preview-scripts/__qc_index__.js"];
|
||||||
var bundleScript = 'preview-scripts/__qc_bundle__.js';
|
var bundleScript = 'preview-scripts/__qc_bundle__.js';
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42,6 +42,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
window.initMgr();
|
window.initMgr();
|
||||||
|
// WeChat.setShare(location.href);
|
||||||
cc.fx.GameConfig.init();
|
cc.fx.GameConfig.init();
|
||||||
// cc.fx.AudioManager._instance.init();
|
// cc.fx.AudioManager._instance.init();
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
|
@ -90,4 +91,4 @@ cc._RF.pop();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxMb2FkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNNLElBQUEsS0FBd0MsRUFBRSxDQUFDLFVBQVUsRUFBcEQsT0FBTyxhQUFBLEVBQUUsUUFBUSxjQUFBLEVBQUUsZ0JBQWdCLHNCQUFpQixDQUFDO0FBRzVEO0lBQXNDLDRCQUFZO0lBQWxEOztJQW9DQSxDQUFDO0lBbkNHLHdCQUFLLEdBQUw7UUFDSSxNQUFNLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDakIsRUFBRSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDeEIsdUNBQXVDO1FBQ3ZDLElBQUksTUFBTSxHQUFHLE1BQU0sQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDO1FBQ2xDLElBQUcsSUFBSSxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsRUFBQztZQUMxQixPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1lBQ3JCLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDLE1BQU0sR0FBRyxLQUFLLENBQUM7U0FDbkQ7YUFDRztZQUNBLE9BQU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0YXJ0R2FtZSgpe1xyXG4gICAgICAgIGNjLmRpcmVjdG9yLmxvYWRTY2VuZShcIkd1aWRlU2NlbmVcIik7XHJcbiAgICB9XHJcbiAgICAvL+Wkh+eUqO+8jOeUqOadpea1i+ivlei3s+i9rCDmjIflrprlhbPljaFcclxuICAgIGNsaWNrQnRuKGV2ZW50LGRhdGEpe1xyXG4gICAgICAgIGNjLmZ4LkdhbWVDb25maWcuR01fSU5GTy5jdXN0b20gPSBwYXJzZUludChkYXRhKTtcclxuICAgICAgICBjYy5kaXJlY3Rvci5sb2FkU2NlbmUoXCJHYW1lU2NlbmVcIik7XHJcbiAgICB9ICAgXHJcbiAgICAvL+aJk+W8gOaOkuihjOamnFxyXG4gICAgb3BlblJhbmsoKXtcclxuICAgICAgICBjYy5kaXJlY3Rvci5sb2FkU2NlbmUoXCJSYW5rU2NlbmVcIik7XHJcbiAgICB9XHJcbiAgICBcclxuICAgIHByb3RlY3RlZCB1cGRhdGUoZHQ6IG51bWJlcik6IHZvaWQge1xyXG4gICAgfVxyXG59XHJcbiJdfQ==
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -71,7 +71,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
};
|
};
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
NewClass.prototype.jumpFinishi = function () {
|
NewClass.prototype.jumpFinishi = function () {
|
||||||
var url = "https://train.sparkus.cn/poster/game/";
|
var url = "https://train.sparkus.cn/poster/game/" + cc.fx.GameConfig.GM_INFO.scode + "?suc=1";
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
};
|
};
|
||||||
//打开排行榜
|
//打开排行榜
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31,6 +31,7 @@ var NewClass = /** @class */ (function (_super) {
|
||||||
}
|
}
|
||||||
NewClass.prototype.start = function () {
|
NewClass.prototype.start = function () {
|
||||||
window.initMgr();
|
window.initMgr();
|
||||||
|
// WeChat.setShare(location.href);
|
||||||
cc.fx.GameConfig.init();
|
cc.fx.GameConfig.init();
|
||||||
// cc.fx.AudioManager._instance.init();
|
// cc.fx.AudioManager._instance.init();
|
||||||
var urlNow = window.location.href;
|
var urlNow = window.location.href;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;;IAoCA,CAAC;IAnCG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,uCAAuC;QACvC,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClC,IAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;SACnD;aACG;YACA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACxB;IACL,CAAC;IAED,MAAM;IACN,gCAAa,GAAb,UAAc,GAAG;QACb,OAAO,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IAnCgB,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAoC5B;IAAD,eAAC;CApCD,AAoCC,CApCqC,EAAE,CAAC,SAAS,GAoCjD;kBApCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n start () {\r\n window.initMgr();\r\n cc.fx.GameConfig.init();\r\n // cc.fx.AudioManager._instance.init();\r\n var urlNow = window.location.href;\r\n if(this.containsTrain(urlNow)){\r\n console.log(\"无排行版本\");\r\n this.node.getChildByName(\"Rank\").active = false;\r\n }\r\n else{\r\n console.log(\"有排行版本\");\r\n }\r\n }\r\n\r\n //判断来源\r\n containsTrain(str) {\r\n return /from=train/i.test(str);\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;;IAqCA,CAA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nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n start () {\r\n window.initMgr();\r\n // WeChat.setShare(location.href);\r\n cc.fx.GameConfig.init();\r\n // cc.fx.AudioManager._instance.init();\r\n var urlNow = window.location.href;\r\n if(this.containsTrain(urlNow)){\r\n console.log(\"无排行版本\");\r\n this.node.getChildByName(\"Rank\").active = false;\r\n }\r\n else{\r\n console.log(\"有排行版本\");\r\n }\r\n }\r\n\r\n //判断来源\r\n containsTrain(str) {\r\n return /from=train/i.test(str);\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
|
|
@ -27,6 +27,14 @@ var GameConfig = /** @class */ (function () {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
configurable: true
|
configurable: true
|
||||||
});
|
});
|
||||||
|
GameConfig.getKey = function (key) {
|
||||||
|
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
|
||||||
|
var r = window.location.search.substr(1).match(reg);
|
||||||
|
if (r != null) {
|
||||||
|
return unescape(r[2]);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
GameConfig.init = function () {
|
GameConfig.init = function () {
|
||||||
this.GM_INFO_init();
|
this.GM_INFO_init();
|
||||||
this.CLICK_init();
|
this.CLICK_init();
|
||||||
|
@ -34,11 +42,13 @@ var GameConfig = /** @class */ (function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
cc.resources.load('Json/GM_INFO', function (err, res) {
|
cc.resources.load('Json/GM_INFO', function (err, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
share_1.WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var jsonData = res.json;
|
var jsonData = res.json;
|
||||||
self.GM_INFO = jsonData["data"];
|
self.GM_INFO = jsonData["data"];
|
||||||
|
self.setCode(self.getKey("scode"));
|
||||||
share_1.WeChat.setShare(location.href);
|
share_1.WeChat.setShare(location.href);
|
||||||
self.Authentication();
|
self.Authentication();
|
||||||
});
|
});
|
||||||
|
@ -68,12 +78,14 @@ var GameConfig = /** @class */ (function () {
|
||||||
currSeed: 203213,
|
currSeed: 203213,
|
||||||
gameId: '100009',
|
gameId: '100009',
|
||||||
userId: 0,
|
userId: 0,
|
||||||
|
scode: "",
|
||||||
guide: true,
|
guide: true,
|
||||||
url: "https://api.sparkus.cn",
|
url: "https://api.sparkus.cn",
|
||||||
success: false,
|
success: false,
|
||||||
matchId: null,
|
matchId: null,
|
||||||
custom: 0 //用于测试跳关卡
|
custom: 0 //用于测试跳关卡
|
||||||
};
|
};
|
||||||
|
this.setCode(this.getKey("scode"));
|
||||||
};
|
};
|
||||||
GameConfig.CLICK_init = function () {
|
GameConfig.CLICK_init = function () {
|
||||||
this.CLICK_DATA =
|
this.CLICK_DATA =
|
||||||
|
@ -300,6 +312,9 @@ var GameConfig = /** @class */ (function () {
|
||||||
GameConfig.Authentication = function () {
|
GameConfig.Authentication = function () {
|
||||||
cc.fx.GameTool.Authentication();
|
cc.fx.GameTool.Authentication();
|
||||||
};
|
};
|
||||||
|
GameConfig.setCode = function (code) {
|
||||||
|
this.GM_INFO.scode = code;
|
||||||
|
};
|
||||||
var GameConfig_1;
|
var GameConfig_1;
|
||||||
//所有控制信息都通过GameAppStart内控制
|
//所有控制信息都通过GameAppStart内控制
|
||||||
GameConfig._instance = null;
|
GameConfig._instance = null;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,17 @@ var __extends = (this && this.__extends) || (function () {
|
||||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
var __assign = (this && this.__assign) || function () {
|
||||||
|
__assign = Object.assign || function(t) {
|
||||||
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||||
|
s = arguments[i];
|
||||||
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||||
|
t[p] = s[p];
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
};
|
||||||
|
return __assign.apply(this, arguments);
|
||||||
|
};
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||||
|
@ -69,17 +80,6 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return _super !== null && _super.apply(this, arguments) || this;
|
return _super !== null && _super.apply(this, arguments) || this;
|
||||||
}
|
}
|
||||||
HttpUtil_1 = HttpUtil;
|
HttpUtil_1 = HttpUtil;
|
||||||
HttpUtil.getShareInfo = function (shareUrl) {
|
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
|
||||||
var time, url;
|
|
||||||
return __generator(this, function (_a) {
|
|
||||||
console.log("设置分享链接:", shareUrl);
|
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
|
||||||
url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
|
||||||
return [2 /*return*/, this.post(url, null, null)];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
//排行榜
|
//排行榜
|
||||||
HttpUtil.rankData = function (type, callback, data) {
|
HttpUtil.rankData = function (type, callback, data) {
|
||||||
return __awaiter(this, void 0, Promise, function () {
|
return __awaiter(this, void 0, Promise, function () {
|
||||||
|
@ -87,7 +87,7 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 0);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
var url;
|
var url;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
url = '/log/collect/data';
|
url = '/log/collect/data';
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 3);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -109,17 +109,19 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
|
||||||
this.post(url, data, callback);
|
this.post(url, data, callback, 0);
|
||||||
return [2 /*return*/];
|
return [2 /*return*/];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.post = function (url, data, callback) {
|
HttpUtil.get = function (url, callback, count) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var response;
|
var repeat, response;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, data, 'POST')];
|
case 0:
|
||||||
|
repeat = count ? count : 0;
|
||||||
|
return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)];
|
||||||
case 1:
|
case 1:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
|
@ -128,12 +130,14 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.get = function (url, callback) {
|
HttpUtil.post = function (url, data, callback, count) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var response;
|
var repeat, response;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0: return [4 /*yield*/, this.fetchData(url, null, 'GET')];
|
case 0:
|
||||||
|
repeat = count ? count : 0;
|
||||||
|
return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)];
|
||||||
case 1:
|
case 1:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
callback && callback(response);
|
callback && callback(response);
|
||||||
|
@ -142,9 +146,10 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
HttpUtil.fetchData = function (url, data, method) {
|
HttpUtil.fetchData = function (url, data, method, repeat) {
|
||||||
return __awaiter(this, void 0, void 0, function () {
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
var fullUrl, headers, options, response, error_1;
|
var fullUrl, headers, options, response, error_1, timeOut;
|
||||||
|
var _this = this;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -158,23 +163,58 @@ var HttpUtil = /** @class */ (function (_super) {
|
||||||
_a.label = 1;
|
_a.label = 1;
|
||||||
case 1:
|
case 1:
|
||||||
_a.trys.push([1, 4, , 5]);
|
_a.trys.push([1, 4, , 5]);
|
||||||
return [4 /*yield*/, fetch(fullUrl, options)];
|
return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)];
|
||||||
case 2:
|
case 2:
|
||||||
response = _a.sent();
|
response = _a.sent();
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error("HTTP error! status: " + response.status);
|
throw new Error("HTTP_______________error! status: " + response.status);
|
||||||
}
|
}
|
||||||
return [4 /*yield*/, response.json()];
|
return [4 /*yield*/, response.json()];
|
||||||
case 3: return [2 /*return*/, _a.sent()];
|
case 3: return [2 /*return*/, _a.sent()];
|
||||||
case 4:
|
case 4:
|
||||||
error_1 = _a.sent();
|
error_1 = _a.sent();
|
||||||
console.error('Fetch error:', error_1);
|
console.error('Fetch_______________error:', error_1);
|
||||||
return [2 /*return*/, null];
|
if (repeat > 0) {
|
||||||
|
repeat -= 1;
|
||||||
|
timeOut = (3 - repeat) * 5000;
|
||||||
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
||||||
|
return __generator(this, function (_a) {
|
||||||
|
switch (_a.label) {
|
||||||
|
case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)];
|
||||||
|
case 1:
|
||||||
|
response = _a.sent();
|
||||||
|
return [2 /*return*/];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}); }, timeOut);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [2 /*return*/, null];
|
||||||
|
}
|
||||||
|
return [3 /*break*/, 5];
|
||||||
case 5: return [2 /*return*/];
|
case 5: return [2 /*return*/];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
HttpUtil.fetchWithTimeout = function (resource, options) {
|
||||||
|
if (options === void 0) { options = {}; }
|
||||||
|
return __awaiter(this, void 0, void 0, function () {
|
||||||
|
var controller, id, response;
|
||||||
|
return __generator(this, function (_a) {
|
||||||
|
switch (_a.label) {
|
||||||
|
case 0:
|
||||||
|
controller = new AbortController();
|
||||||
|
id = setTimeout(function () { return controller.abort(); }, 5000);
|
||||||
|
return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))];
|
||||||
|
case 1:
|
||||||
|
response = _a.sent();
|
||||||
|
clearTimeout(id);
|
||||||
|
return [2 /*return*/, response];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param url {string} 接口地址
|
* @param url {string} 接口地址
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -71,10 +71,10 @@ var WeChat = /** @class */ (function () {
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 100);
|
}, 200);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
WeChat.changeShare();
|
WeChat.changeShare();
|
||||||
}, 200);
|
}, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,17 @@ var WeChat = /** @class */ (function () {
|
||||||
console.log("分享好友成功回调");
|
console.log("分享好友成功回调");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
wx.updateTimelineShareData({
|
setTimeout(function () {
|
||||||
title: '记忆力认知测评',
|
wx.updateTimelineShareData({
|
||||||
link: shareConfig.shareLine,
|
title: '记忆力认知测评',
|
||||||
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
|
link: shareConfig.shareLine,
|
||||||
success: function () {
|
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
|
||||||
// 设置成功
|
success: function () {
|
||||||
console.log("分享朋友圈成功回调");
|
// 设置成功
|
||||||
}
|
console.log("分享朋友圈成功回调");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
WeChat.getSignature = function (url) {
|
WeChat.getSignature = function (url) {
|
||||||
|
@ -113,7 +115,7 @@ var WeChat = /** @class */ (function () {
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
time = Math.floor((new Date().getTime()) / 1000);
|
time = Math.floor((new Date().getTime()) / 1000);
|
||||||
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
|
||||||
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback)];
|
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback, 3)];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,18 +17,23 @@ var GameTool = {
|
||||||
if (localStorage.getItem(name))
|
if (localStorage.getItem(name))
|
||||||
data = JSON.parse(localStorage.getItem(name));
|
data = JSON.parse(localStorage.getItem(name));
|
||||||
if (data == "undifend" || data == null || data == "") {
|
if (data == "undifend" || data == null || data == "") {
|
||||||
var urlNow = window.location.href;
|
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
|
||||||
if (!this.containsTrain(urlNow) || !this.isNumber(data.userId)) {
|
encodeURIComponent(location.href);
|
||||||
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
|
console.log("链接没ID准备跳转", url);
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!this.isNumber(data.userId)) {
|
||||||
|
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
|
||||||
|
encodeURIComponent(location.href);
|
||||||
|
console.log("链接不合法", url);
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
cc.fx.StorageMessage.setStorage(name, data);
|
||||||
|
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
cc.fx.StorageMessage.setStorage(name, data);
|
|
||||||
cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
isNumber: function (value) {
|
isNumber: function (value) {
|
||||||
var result = false;
|
var result = false;
|
||||||
|
@ -38,9 +43,6 @@ var GameTool = {
|
||||||
result = false;
|
result = false;
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
containsTrain: function (str) {
|
|
||||||
return /from=train/i.test(str);
|
|
||||||
},
|
|
||||||
//埋点上传
|
//埋点上传
|
||||||
setGameData: function () {
|
setGameData: function () {
|
||||||
//GAME_DATA 初始化 每次清零
|
//GAME_DATA 初始化 每次清零
|
||||||
|
@ -53,6 +55,7 @@ var GameTool = {
|
||||||
var postData = {
|
var postData = {
|
||||||
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
|
||||||
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
"userId": cc.fx.GameConfig.GM_INFO.userId,
|
||||||
|
"scode": cc.fx.GameConfig.GM_INFO.scode,
|
||||||
"matchId": matchId,
|
"matchId": matchId,
|
||||||
"data": data
|
"data": data
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user