|
|
@@ -44,7 +44,6 @@
|
|
|
<input style="display: absolute; z-index: -1; height: 0; width: 0" id="copyTest" />
|
|
|
<script type="text/javascript">
|
|
|
var ua = navigator.userAgent.toLocaleUpperCase().indexOf("WEIBO") >= 0;
|
|
|
- alert(ua);
|
|
|
function setCookie(cname, cvalue, exdays) {
|
|
|
var d = new Date();
|
|
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
|
|
@@ -61,24 +60,25 @@
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
|
+
|
|
|
+ function getQueryString(name) {
|
|
|
+ let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
|
+ let r = window.location.search.substr(1).match(reg);
|
|
|
+ if (r != null) return unescape(r[2]);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
if (!ua) {
|
|
|
let url = "http://www.weibo.cn/demo.html"; // 要打开的 H5 页面的地址
|
|
|
let scheme = `sinaweibo://browser?url=` + encodeURIComponent(url);
|
|
|
window.location.href = `https://m.weibo.cn/feature/openapp?scheme=` + encodeURIComponent(scheme);
|
|
|
} else {
|
|
|
if (getCookie("SUB") == "") {
|
|
|
- setCookie("SUB", " 1235892217", 7);
|
|
|
+ setCookie("SUB", getQueryString("sub"), 7);
|
|
|
// alert("未登录");
|
|
|
// let url = "http://www.weibo.cn/demo.html"; // 要打开的 H5 页面的地址
|
|
|
// //未登录状态下跳转 scheme:
|
|
|
// window.location.href = `sinaweibo://login?redirect_scheme` + encodeURIComponent(url);
|
|
|
}
|
|
|
- function getQueryString(name) {
|
|
|
- let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
|
- let r = window.location.search.substr(1).match(reg);
|
|
|
- if (r != null) return unescape(r[2]);
|
|
|
- return null;
|
|
|
- }
|
|
|
$("#login").click(function () {
|
|
|
getCode("1");
|
|
|
// callNative('sendCode', '');
|