12345678910111213141516171819202122 |
- (function(win) {
- var orgLink = win.location.href
- var newLink = ''
- if (orgLink.indexOf('&mobile=true') != -1) {
- Object.defineProperty(navigator, 'userAgent', {
- value: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",
- writable: false
- })
- }
- else if (/iPhone|iPad|Android/i.test(win.navigator.userAgent)) {
- if (orgLink.indexOf('pc.html') !== -1) {
- newLink = orgLink.replace('pc.html', 'mobile.html')
- }
- } else {
- if (orgLink.indexOf('mobile.html') !== -1) {
- newLink = orgLink.replace('mobile.html', 'pc.html')
- }
- }
- if (newLink) {
- win.location.href = newLink
- }
- }(window))
|