Commit 1db39c8e authored by rockyl's avatar rockyl

。。。

parent 362fb7d9
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-21.
*/
export let env = {};
export let env:any = {};
export function injectEnv(data){
if(data){
......
/**
* Created by rockyl on 2019-12-10.
*/
import {env} from "./game-warpper/enviroment";
export let queryParams: any = {};
......@@ -15,3 +16,31 @@ for (let item of search.replace('?', '').split('&')) {
queryParams[arr[0]] = arr.length === 1 ? true : arr[1];
}
//appID提取
if (queryParams.appID) {
env.appID = queryParams.appID;
}
//渠道类型提取
if (queryParams.channelType) {
env.channelType = queryParams.channelType;
}
//projectID提取
if (queryParams.projectID) {
env.projectID = queryParams.projectID;
} else if (window.location.pathname.match(new RegExp("/projectx/(\\S+)/index(\\S+)", "g"))) {
env.projectID = window.location.pathname.replace(new RegExp("/projectx/(\\S+)/index(\\S+)", "g"), "$1");
}
//新用户标记
export let newUser = true;
let key = 'nu_' + env.appID + '_' + env.projectID;
let v = localStorage.getItem(key);
if (v) {
newUser = false;
} else {
localStorage.setItem(key, '1');
}
console.log(newUser);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment