fix qdreader message window and nested result
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
//[author: Hermes]
|
||||
//[service: BOSS]
|
||||
//[class: 工具类]
|
||||
//[version: 2.10.1]
|
||||
//[version: 2.10.2]
|
||||
//[platform: web,qq,wx,tg,tb,fs,we]
|
||||
//[public: false]
|
||||
//[price: 0]
|
||||
@@ -276,7 +276,7 @@ function contentText() {
|
||||
}
|
||||
function usage() {
|
||||
return [
|
||||
"启点读书签到插件 v2.10.1",
|
||||
"启点读书签到插件 v2.10.2",
|
||||
"【一级菜单】",
|
||||
"账号管理:启点账号",
|
||||
"执行查询:启点查询",
|
||||
@@ -404,7 +404,14 @@ function qidianRequest(path, method, data, cookie) {
|
||||
if (typeof out === "string") out = safeJsonParse(out, out)
|
||||
return out
|
||||
}
|
||||
function resultCode(obj) { return obj && (obj.Result !== undefined ? obj.Result : obj.result !== undefined ? obj.result : obj.Code !== undefined ? obj.Code : obj.code !== undefined ? obj.code : obj.retcode) }
|
||||
function resultCode(obj) {
|
||||
if (!obj) return undefined
|
||||
var keys = ["Result", "result", "Code", "code", "retcode", "RetCode"]
|
||||
for (var i = 0; i < keys.length; i++) if (obj[keys[i]] !== undefined) return obj[keys[i]]
|
||||
var data = obj.Data || obj.data || obj.ResultData || obj.resultData
|
||||
if (data && typeof data === "object") for (var j = 0; j < keys.length; j++) if (data[keys[j]] !== undefined) return data[keys[j]]
|
||||
return undefined
|
||||
}
|
||||
function resultOk(obj) {
|
||||
var code = resultCode(obj)
|
||||
var status = obj && (obj.status || obj.Status)
|
||||
@@ -695,11 +702,18 @@ function recentCreateTime(v) {
|
||||
var now = (new Date()).getTime()
|
||||
return now - t >= 0 && now - t <= 24 * 60 * 60 * 1000
|
||||
}
|
||||
function beijingHour(dateLike) { return beijingDate(dateLike).getUTCHours() }
|
||||
function messageBoxWindowLabel() { return "20:00-22:00" }
|
||||
function messageBoxAllowedNow() {
|
||||
var h = beijingHour()
|
||||
return h >= 20 && h < 22
|
||||
}
|
||||
function orderIdFromText(s) {
|
||||
var m = String(s || "").match(/orderId=([a-f0-9]+)/i)
|
||||
return m ? m[1] : ""
|
||||
}
|
||||
function doMessageBox(cookie) {
|
||||
if (!messageBoxAllowedNow()) return { name: "大咖荐书", ok: true, skipped: true, msg: "不在执行时间 " + messageBoxWindowLabel() + ",已跳过", path: "https://magev6.if.qidian.com/argus/api/v2/message/pullmessage" }
|
||||
var token = messageTokenFromCookie(cookie)
|
||||
if (!token) return { name: "大咖荐书", ok: true, msg: "缺少消息 token,已跳过", path: "https://magev6.if.qidian.com/argus/api/v2/message/pullmessage" }
|
||||
var baseParams = { token: token, type: "0", pg: "1", pz: "10" }
|
||||
|
||||
Reference in New Issue
Block a user