diff --git a/public/react/src/modules/wxcode/index.js b/public/react/src/modules/wxcode/index.js index 9fe34d540..bb253cb6e 100644 --- a/public/react/src/modules/wxcode/index.js +++ b/public/react/src/modules/wxcode/index.js @@ -46,23 +46,31 @@ const App = (props) => { // 获取路径参数 const _params = window.location.search; const setCookier = () => { - const _params = window.location.search; - if (_params) { - let _search = _params.split('?')[1]; - _search.split('&').forEach(item => { - // console.log(item); - const _arr = item.split('='); - cookie.remove(_arr[0], { - domain: '.educoder.net', - path: '/', + var u = navigator.userAgent; + var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 + if (isIOS) { + }else{ + const _params = window.location.search; + if (_params) { + let _search = _params.split('?')[1]; + _search.split('&').forEach(item => { + // console.log(item); + const _arr = item.split('='); + cookie.remove(_arr[0], { + domain: '.educoder.net', + path: '/', + + }); + cookie.save(_arr[0], _arr[1], { + path: '/', + domain: '.educoder.net' + }); }); - cookie.save(_arr[0], _arr[1], { - path: '/', - domain: '.educoder.net' - }); - }); + } + } + } setCookier(); diff --git a/public/react/src/services/wxcodeService.js b/public/react/src/services/wxcodeService.js index 18dc4eed3..65824839a 100644 --- a/public/react/src/services/wxcodeService.js +++ b/public/react/src/services/wxcodeService.js @@ -11,23 +11,30 @@ import cookie from 'react-cookies' // axios.defaults.withCredentials = true; const setCookier = () => { - const _params = window.location.search; - if (_params) { - let _search = _params.split('?')[1]; - _search.split('&').forEach(item => { - // console.log(item); - const _arr = item.split('='); - cookie.remove(_arr[0], { - domain: '.educoder.net', - path: '/', - }); - cookie.save(_arr[0], _arr[1], { - path: '/', - domain: '.educoder.net' + var u = navigator.userAgent; + var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 + if (isIOS) { + + }else{ + const _params = window.location.search; + if (_params) { + let _search = _params.split('?')[1]; + _search.split('&').forEach(item => { + // console.log(item); + const _arr = item.split('='); + cookie.remove(_arr[0], { + domain: '.educoder.net', + path: '/', + + }); + cookie.save(_arr[0], _arr[1], { + path: '/', + domain: '.educoder.net' + }); }); - }); - } + } + } } // 获取代码块