|
@@ -40,8 +40,8 @@ function App() {
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
// sw
|
|
// sw
|
|
- if(isSw){
|
|
|
|
- localStorage.setItem("isSw",isSw)
|
|
|
|
|
|
+ if (isSw) {
|
|
|
|
+ localStorage.setItem("isSw", isSw)
|
|
}
|
|
}
|
|
function handleOrientationChange() {
|
|
function handleOrientationChange() {
|
|
let orientationType = 'VERTICAL'
|
|
let orientationType = 'VERTICAL'
|
|
@@ -126,6 +126,10 @@ function App() {
|
|
setIsLoding(false)
|
|
setIsLoding(false)
|
|
if (res?.data) {
|
|
if (res?.data) {
|
|
let h5WeChatControl = res?.data?.h5GameConfigMap?.h5WeChatControl || 'UN_CONTROL'
|
|
let h5WeChatControl = res?.data?.h5GameConfigMap?.h5WeChatControl || 'UN_CONTROL'
|
|
|
|
+ if (h5WeChatControl === 'ONLY_WE_CHAT' && !isWeChat()) {
|
|
|
|
+ window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=888"
|
|
|
|
+ return
|
|
|
|
+ }
|
|
dispatch({ type: 'setIsPut', params: { isPut: (res.data.isPut && res.data.appId) || false } })
|
|
dispatch({ type: 'setIsPut', params: { isPut: (res.data.isPut && res.data.appId) || false } })
|
|
document.title = (res.data?.gameName || '游戏-登录')
|
|
document.title = (res.data?.gameName || '游戏-登录')
|
|
dispatch({ type: 'setInitData', params: { initData: { ...res.data, ...res.data?.h5GameConfigMap } } })
|
|
dispatch({ type: 'setInitData', params: { initData: { ...res.data, ...res.data?.h5GameConfigMap } } })
|