迅睿開源框架是一款PHP8高性能·簡(jiǎn)單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
在線咨詢
不知道我開發(fā)的模版哪里出現(xiàn)了問題,http://www.tyjs158.com/手機(jī)訪問偶爾無法自動(dòng)跳轉(zhuǎn)到手機(jī)端http://m.tyjs158.com/
不知道是不是因?yàn)槲沂褂昧思铀贅?緩存 的問題
靜態(tài)是不能跳轉(zhuǎn)的,要加js識(shí)別代碼,手冊(cè)有
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅??蚣軇?chuàng)始人 我按照http://apdwn.com/doc/664.html這個(gè)操作,不知道哪里出問題了 報(bào)錯(cuò) syntax error, unexpected '$my_web_url' (T_VARIABLE), expecting ')'
回復(fù)迅睿框架創(chuàng)始人 我應(yīng)該是找到了原因,
關(guān)鍵就出在了 var is_mobile_cms = '{IS_MOBILE}'; 或許是模版相比官方的改動(dòng)有點(diǎn)大, 模版是我使用腳手架生成的,https://github.com/xizon/uix-kit/ 使用chrome開發(fā)模式 模擬手機(jī)訪問后,導(dǎo)航的鏈接全變成了手機(jī)鏈接 var is_mobile_cms = '1'; 沒有清空
應(yīng)該全站靜態(tài)后,這個(gè)地方就不能使用php調(diào)用了吧 。反正我注釋掉就好了,也不知道會(huì)不會(huì)有其他問題
可以在靜態(tài)頁(yè)面引入或者加入一個(gè)js,由js判斷跳轉(zhuǎn)
<script type="text/javascript"> var siteurl = 'https://m.yourdomain.com'; // 跳桌面版 if (!(navigator.userAgent.match(/(iPhone|iPod|Android|Windows Phone)/i))) { var url=window.location.href; // url=url.replace('http://m.','http://www.'); url=url.replace('https://m.','https://www.'); location.replace(url); } </script> 上面代碼是在手機(jī)模板head內(nèi)加入
<script type="text/javascript"> var new_url = window.location.href; if(new_url.indexOf('http://yourdomain') >= 0 || new_url.indexOf('https://yourdomain') >= 0) { new_url = new_url.replace('http://yourdomain', 'http://www.yourdomain'); new_url = new_url.replace('https://yourdomain', 'http://www.yourdomain'); window.location.replace(new_url); } var siteurl = 'http://www.iyourdomain.net/'; </script> <script type="text/javascript"> <!--跳m站--> function getCookie(nm) { var arr, reg = new RegExp("(^| )" + nm + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) { return unescape(arr[2]); } else { return null; } } if ((navigator.userAgent.match(/(iPhone|iPod|Android|Windows Phone)/i))) { if(getCookie('mfjian') == null) { var url = window.location.href; url = url.replace('http://yourdomain', 'http://m.yourdomain'); url = url.replace('https://yourdomain', 'https://m.yourdomain'); url = url.replace('http://www.', 'http://m.'); url = url.replace('https://www.', 'https://m.'); location.replace(url); } }/*else{ var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'http') { var url=window.location.href; url=url.replace('http://','https://'); location.replace(url); } }*/ </script> 在電腦模板head中加入
回復(fù)@唉呦喂 萬分感謝
回復(fù)@唉呦喂 這個(gè)代碼好像有點(diǎn)問題,首頁(yè)一直在加載
有地址嗎,我?guī)湍憧纯?/p>
回復(fù)@唉呦喂 http://www.tyjs158.com/ 應(yīng)該是yourdomain沒替換干凈,現(xiàn)在應(yīng)該是好了
靜態(tài)是不能跳轉(zhuǎn)的,要加js識(shí)別代碼,手冊(cè)有
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅??蚣軇?chuàng)始人 我按照http://apdwn.com/doc/664.html這個(gè)操作,不知道哪里出問題了 報(bào)錯(cuò) syntax error, unexpected '$my_web_url' (T_VARIABLE), expecting ')'
回復(fù)迅睿框架創(chuàng)始人 我應(yīng)該是找到了原因,

關(guān)鍵就出在了 var is_mobile_cms = '{IS_MOBILE}'; 或許是模版相比官方的改動(dòng)有點(diǎn)大, 模版是我使用腳手架生成的,https://github.com/xizon/uix-kit/ 使用chrome開發(fā)模式 模擬手機(jī)訪問后,導(dǎo)航的鏈接全變成了手機(jī)鏈接 var is_mobile_cms = '1'; 沒有清空
應(yīng)該全站靜態(tài)后,這個(gè)地方就不能使用php調(diào)用了吧 。反正我注釋掉就好了,也不知道會(huì)不會(huì)有其他問題
可以在靜態(tài)頁(yè)面引入或者加入一個(gè)js,由js判斷跳轉(zhuǎn)
<script type="text/javascript"> var siteurl = 'https://m.yourdomain.com'; // 跳桌面版 if (!(navigator.userAgent.match(/(iPhone|iPod|Android|Windows Phone)/i))) { var url=window.location.href; // url=url.replace('http://m.','http://www.'); url=url.replace('https://m.','https://www.'); location.replace(url); } </script> 上面代碼是在手機(jī)模板head內(nèi)加入<script type="text/javascript"> var new_url = window.location.href; if(new_url.indexOf('http://yourdomain') >= 0 || new_url.indexOf('https://yourdomain') >= 0) { new_url = new_url.replace('http://yourdomain', 'http://www.yourdomain'); new_url = new_url.replace('https://yourdomain', 'http://www.yourdomain'); window.location.replace(new_url); } var siteurl = 'http://www.iyourdomain.net/'; </script> <script type="text/javascript"> <!--跳m站--> function getCookie(nm) { var arr, reg = new RegExp("(^| )" + nm + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) { return unescape(arr[2]); } else { return null; } } if ((navigator.userAgent.match(/(iPhone|iPod|Android|Windows Phone)/i))) { if(getCookie('mfjian') == null) { var url = window.location.href; url = url.replace('http://yourdomain', 'http://m.yourdomain'); url = url.replace('https://yourdomain', 'https://m.yourdomain'); url = url.replace('http://www.', 'http://m.'); url = url.replace('https://www.', 'https://m.'); location.replace(url); } }/*else{ var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'http') { var url=window.location.href; url=url.replace('http://','https://'); location.replace(url); } }*/ </script> 在電腦模板head中加入回復(fù)@唉呦喂 萬分感謝
回復(fù)@唉呦喂 這個(gè)代碼好像有點(diǎn)問題,首頁(yè)一直在加載
有地址嗎,我?guī)湍憧纯?/p>
回復(fù)@唉呦喂 http://www.tyjs158.com/ 應(yīng)該是yourdomain沒替換干凈,現(xiàn)在應(yīng)該是好了