|
@@ -23,6 +23,7 @@ import {
|
|
|
import {toast} from 'react-toastify';
|
|
import {toast} from 'react-toastify';
|
|
|
import {getHttpMsg, localStorageGet, localStorageSet} from "@utils/helpers";
|
|
import {getHttpMsg, localStorageGet, localStorageSet} from "@utils/helpers";
|
|
|
import {
|
|
import {
|
|
|
|
|
+ LOCAL_ACTIVITY_C,
|
|
|
LOCAL_CUSTOM_LOCK,
|
|
LOCAL_CUSTOM_LOCK,
|
|
|
LOCAL_FAVO_IDS, LOCAL_GAME_URL,
|
|
LOCAL_FAVO_IDS, LOCAL_GAME_URL,
|
|
|
LOCAL_IS_LOGIN,
|
|
LOCAL_IS_LOGIN,
|
|
@@ -180,6 +181,7 @@ const reducerRoutes=(state,action)=>{
|
|
|
if(user.Phone!==""&&user.Phone.startsWith(user.RegisterLocation)){
|
|
if(user.Phone!==""&&user.Phone.startsWith(user.RegisterLocation)){
|
|
|
hasPhone=1;
|
|
hasPhone=1;
|
|
|
}
|
|
}
|
|
|
|
|
+ checkChannel(user);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let conf=json.conf;
|
|
let conf=json.conf;
|
|
@@ -191,6 +193,8 @@ const reducerRoutes=(state,action)=>{
|
|
|
let popBindPhone=0;
|
|
let popBindPhone=0;
|
|
|
let firstBonus=0;
|
|
let firstBonus=0;
|
|
|
let openRelief=0;
|
|
let openRelief=0;
|
|
|
|
|
+ //sport 配置
|
|
|
|
|
+ let bbConf=null;
|
|
|
if (conf){
|
|
if (conf){
|
|
|
if (!!conf.hall)hallServerUrl=conf.hall;
|
|
if (!!conf.hall)hallServerUrl=conf.hall;
|
|
|
if (!!conf.DOLLAR)global.DOLLAR=conf.DOLLAR;
|
|
if (!!conf.DOLLAR)global.DOLLAR=conf.DOLLAR;
|
|
@@ -209,15 +213,16 @@ const reducerRoutes=(state,action)=>{
|
|
|
if (!!conf.popWheel)popWheel=conf.popWheel;
|
|
if (!!conf.popWheel)popWheel=conf.popWheel;
|
|
|
//弹出绑定电话奖励,并显示浮标
|
|
//弹出绑定电话奖励,并显示浮标
|
|
|
if (!!conf.popBindPhone)popBindPhone=hasPhone?0:conf.popBindPhone;
|
|
if (!!conf.popBindPhone)popBindPhone=hasPhone?0:conf.popBindPhone;
|
|
|
- console.log("hasPhonehasPhonehasPhonehasPhone"+popBindPhone+"hasPhonehasPhone"+hasPhone)
|
|
|
|
|
//显示首冲浮标
|
|
//显示首冲浮标
|
|
|
if (!!conf.firstBonus)firstBonus=conf.firstBonus;
|
|
if (!!conf.firstBonus)firstBonus=conf.firstBonus;
|
|
|
//显示救济浮标
|
|
//显示救济浮标
|
|
|
if (!!conf.openRelief)openRelief=conf.openRelief;
|
|
if (!!conf.openRelief)openRelief=conf.openRelief;
|
|
|
|
|
+ //sport 配置
|
|
|
|
|
+ if (!!conf.bb)bbConf=conf.bb;
|
|
|
}
|
|
}
|
|
|
//favorites
|
|
//favorites
|
|
|
// let favorites=getFavorites(json.favorites);
|
|
// let favorites=getFavorites(json.favorites);
|
|
|
- Object.assign(state, {routes:state.routes,asyncRoutes:data,styles,blocks,...generData,isLogin:isLogin,userInfo,hallServerUrl,promoteInstall,guest,upgradeBonus,popWheel,popBindPhone,firstBonus,openRelief});
|
|
|
|
|
|
|
+ Object.assign(state, {routes:state.routes,asyncRoutes:data,styles,blocks,...generData,isLogin:isLogin,userInfo,hallServerUrl,promoteInstall,guest,upgradeBonus,popWheel,popBindPhone,firstBonus,openRelief,bbConf});
|
|
|
// Object.assign(state, {routes:state.routes,asyncRoutes:data,styles:styles,blocks:blocks,...generData,isLogin:isLogin,userInfo:userInfo,hallServerUrl:hallServerUrl,promoteInstall:promoteInstall,guest:guest,upgradeBonus:upgradeBonus});
|
|
// Object.assign(state, {routes:state.routes,asyncRoutes:data,styles:styles,blocks:blocks,...generData,isLogin:isLogin,userInfo:userInfo,hallServerUrl:hallServerUrl,promoteInstall:promoteInstall,guest:guest,upgradeBonus:upgradeBonus});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -241,6 +246,20 @@ const getLocalIsLogin=()=>{
|
|
|
const getMsg=(payload)=>{
|
|
const getMsg=(payload)=>{
|
|
|
return getHttpMsg(payload);
|
|
return getHttpMsg(payload);
|
|
|
}
|
|
}
|
|
|
|
|
+//检查渠道
|
|
|
|
|
+const checkChannel=(userInfo)=>{
|
|
|
|
|
+ if (userInfo!=null&&userInfo.Channel!=null){
|
|
|
|
|
+ let Channel=parseInt(userInfo.Channel);
|
|
|
|
|
+ let localC=localStorageGet(LOCAL_ACTIVITY_C,"");
|
|
|
|
|
+ if (localC!=null&&localC!==""){
|
|
|
|
|
+ localC=parseInt(localC);
|
|
|
|
|
+ if (Channel!==localC){
|
|
|
|
|
+ localStorageSet(LOCAL_ACTIVITY_C,Channel+"");
|
|
|
|
|
+ window.location.replace(window.location.origin);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
const parseLogin=(state,action,arg,isShowMsg=true)=>{
|
|
const parseLogin=(state,action,arg,isShowMsg=true)=>{
|
|
|
let payload=action.payload;
|
|
let payload=action.payload;
|
|
|
let code=payload.code;
|
|
let code=payload.code;
|
|
@@ -261,6 +280,7 @@ const parseLogin=(state,action,arg,isShowMsg=true)=>{
|
|
|
//新注册的
|
|
//新注册的
|
|
|
trackEvent("CompleteRegistration",{external_id:data.UserID})
|
|
trackEvent("CompleteRegistration",{external_id:data.UserID})
|
|
|
}
|
|
}
|
|
|
|
|
+ checkChannel(data);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -512,7 +532,9 @@ export const Main=createSlice({
|
|
|
//是否是guest登录
|
|
//是否是guest登录
|
|
|
guest:0,
|
|
guest:0,
|
|
|
//绑定奖励
|
|
//绑定奖励
|
|
|
- upgradeBonus:0
|
|
|
|
|
|
|
+ upgradeBonus:0,
|
|
|
|
|
+ //sport conf
|
|
|
|
|
+ bbConf:null
|
|
|
},
|
|
},
|
|
|
reducers: {
|
|
reducers: {
|
|
|
logout:(state, action)=>{
|
|
logout:(state, action)=>{
|
|
@@ -813,6 +835,9 @@ export const getFirstBonus=(state)=>{
|
|
|
export const getOpenRelief=(state)=>{
|
|
export const getOpenRelief=(state)=>{
|
|
|
return state.main.openRelief;
|
|
return state.main.openRelief;
|
|
|
}
|
|
}
|
|
|
|
|
+export const getBBConf=(state)=>{
|
|
|
|
|
+ return state.main.bbConf;
|
|
|
|
|
+}
|
|
|
//数据获取
|
|
//数据获取
|
|
|
export default Main.reducer;
|
|
export default Main.reducer;
|
|
|
|
|
|