|
|
@@ -1,7 +1,10 @@
|
|
|
import querystring from "querystring"
|
|
|
import _this from "../main"
|
|
|
+import $CONFIG from "../config"
|
|
|
var CryptoJS = require('crypto-js');
|
|
|
var Md5 = require("js-md5");
|
|
|
+
|
|
|
+
|
|
|
const utils = {
|
|
|
// 设置cookie
|
|
|
setCookie(name, value, days) {
|
|
|
@@ -212,10 +215,10 @@ const utils = {
|
|
|
if (window.android) {
|
|
|
return this.onRememberFun(account, password)
|
|
|
}
|
|
|
- const platform = this.getQueryString("platform");
|
|
|
|
|
|
- // 仙界情缘
|
|
|
- if (platform === "xjqy") {
|
|
|
+ const platform = this.getQueryString("platform");
|
|
|
+ // 忘川伏魔录
|
|
|
+ if (platform === "wcfml") {
|
|
|
return this.onRememberFun(account, password)
|
|
|
}
|
|
|
},
|
|
|
@@ -293,8 +296,8 @@ const utils = {
|
|
|
}
|
|
|
|
|
|
const platform = this.getQueryString("platform");
|
|
|
- // 仙界情缘特制版
|
|
|
- if (platform == "xjqy") {
|
|
|
+ // 忘川伏魔录特制版
|
|
|
+ if (platform == "wcfml") {
|
|
|
let data = JSON.parse(decodeURI(decodeURIComponent(this.getQueryString('data')))) || {}
|
|
|
return localStorage.getItem(keyName) || data[keyName];
|
|
|
}
|
|
|
@@ -308,10 +311,10 @@ const utils = {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 仙界情缘特制版
|
|
|
+ // 忘川伏魔录特制版
|
|
|
const platform = this.getQueryString("platform");
|
|
|
- // 仙界情缘特制版
|
|
|
- if (platform == "xjqy") {
|
|
|
+ // 忘川伏魔录特制版
|
|
|
+ if (platform == "wcfml") {
|
|
|
localStorage.setItem(keyName, value);
|
|
|
const query = this.getAllQueryString();
|
|
|
let data = decodeURI(decodeURIComponent(query.data));
|
|
|
@@ -319,6 +322,7 @@ const utils = {
|
|
|
query.data[keyName] = value;
|
|
|
query.data = JSON.stringify(query.data)
|
|
|
this.routeLink("", query, "", _this)
|
|
|
+ return
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -327,11 +331,14 @@ const utils = {
|
|
|
// 安卓内部
|
|
|
if (window.android) {
|
|
|
window.android.deleteStorage(bookName, keyName)
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
- // 仙界情缘特制版
|
|
|
+ // 忘川伏魔录特制版
|
|
|
const platform = this.getQueryString("platform");
|
|
|
- if (platform == "xjqy") {}
|
|
|
+ if (platform == "wcfml") {
|
|
|
+ return
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 安卓内 销毁数据(bookName)
|
|
|
@@ -339,8 +346,9 @@ const utils = {
|
|
|
// 安卓内部
|
|
|
if (window.android) {
|
|
|
window.android.destoryStorage(bookName)
|
|
|
+ return
|
|
|
}
|
|
|
- // 仙界情缘特制版
|
|
|
+ // 忘川伏魔录特制版
|
|
|
},
|
|
|
|
|
|
// 获取所有bookName里面的key列表
|
|
|
@@ -348,8 +356,9 @@ const utils = {
|
|
|
// 安卓内部
|
|
|
if (window.android) {
|
|
|
window.android.getKeysInStorage(bookName)
|
|
|
+ return
|
|
|
}
|
|
|
- // 仙界情缘特制版
|
|
|
+ // 忘川伏魔录特制版
|
|
|
},
|
|
|
|
|
|
// 对象序列化工具函数
|
|
|
@@ -370,5 +379,18 @@ const utils = {
|
|
|
// console.log(err);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 关闭支付页面工具函数
|
|
|
+ closePayPage() {
|
|
|
+ if (window.android) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const platform = this.getQueryString("platform");
|
|
|
+ if (platform == "wcfml") {
|
|
|
+ window.location.href = $CONFIG.wcfmlPayUrl
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
export default utils;
|