进入神舟电脑官网自动跳转到移动端神舟商城官网。
Tofloor
poster avatar
cgfeilishi
deepin
2017-05-16 16:46
Author
火狐也一样。

Reply Favorite View the author
All Replies
avatar
jingle
deepin
2017-05-16 17:30
#1
这个和系统无关
Reply View the author
avatar
134******40
deepin
2017-05-16 17:49
#2
不知道神舟官网的脚本怎么判断是PC模式或者移动终端模式的。
Reply View the author
avatar
赫赫有鸣
deepin
2017-05-16 20:12
#3
https://bbs.deepin.org/post/139515
不知道神舟官网的脚本怎么判断是PC模式或者移动终端模式的。

根据系统吧
Reply View the author
avatar
fengying6_6
deepin
2017-05-16 20:27
#4
有些智障程序员可能一辈子没有见过Linux桌面版,所以一看到浏览器UA有Linux就以为是安卓,,不要喷我,蠢就是蠢,没有什么好说的。
Reply View the author
avatar
Guumi
deepin
2017-05-16 21:04
#5
https://bbs.deepin.org/post/139515
有些智障程序员可能一辈子没有见过Linux桌面版,所以一看到浏览器UA有Linux就以为是安卓,, ...

我也这么分析的,简单实用:只要判断非windows 就属于移动设备。

之前也碰到几个类似网站,还都是大牌,只能是无语了!
Reply View the author
avatar
utopio
deepin
2017-05-16 22:21
#6
這個無解,不知道神舟是怎麼想的。
firefox下有個ua switch的插件,你可以把UA換成windwos。
Reply View the author
avatar
45******10@qq.com
deepin
2017-05-16 22:43
#7
这锅不是deepin的,别乱甩。网站开发的有问题。
Reply View the author
avatar
135******31
deepin
2017-05-18 00:44
#8
  1. *type="tex*">

  2.     //平台、设备和操作系统

  3.     var system = {

  4.         win: false,

  5.         mac: false,

  6.         xll: false

  7.     };

  8.     //检测平台

  9.     var p = navigator.platform;

  10.     system.win = p.indexOf("Win") == 0;

  11.     system.mac = p.indexOf("Mac") == 0;

  12.     system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);

  13.     //跳转语句,如果是手机访问就自动跳转到手机页面

  14.     if (system.win || system.mac || system.xll) {

  15.     }
  16.     else {
  17.         window.location.href = "http://www.hasee.net/mobile/index.aspx";

  18.     }


Copy the Code

看看他的验证脚本就知道了,检测的navigator.platform
但是只判断了win,Mac,X11(包括了linux)。
估计深度被navigator.platform检测出来的信息不在linux中把.
所以,有童鞋说改UA,我觉得多半不起作用。因为它验证的就是系统!
说实话,真的很少看到直接拿到系统来做移动端判定的。UA居多
Reply View the author
avatar
cgfeilishi
deepin
2017-05-18 07:51
#9
https://bbs.deepin.org/post/139515
看看他的验证脚本就知道了,检测的navigator.platform
但是只判断了win,Mac,X11(包括了linux)。
估计深 ...

牛逼
Reply View the author