适配Fa米家最新签到接口

This commit is contained in:
blackmatrix7 2021-04-19 11:32:48 +08:00
parent 8034c100fe
commit 20057bb3bc
2 changed files with 6 additions and 5 deletions

View File

@ -92,5 +92,5 @@ https://github.com/blackmatrix7/ios_rule_script/tree/master/rewrite
以下排名不分先后 以下排名不分先后
[@BaileyZyp](https://github.com/BaileyZyp) [@Mazeorz](https://github.com/Mazeorz) [@LuzMasonj](https://github.com/LuzMasonj) [@ypannnn](https://github.com/ypannnn) [@echizenryoma](https://github.com/echizenryoma) [@zirawell](https://github.com/zirawell) [@urzz](https://github.com/urzz) [@ASD-max](https://github.com/ASD-max) [@BaileyZyp](https://github.com/BaileyZyp) [@Mazeorz](https://github.com/Mazeorz) [@LuzMasonj](https://github.com/LuzMasonj) [@chouchoui](https://github.com/chouchoui) [@ypannnn](https://github.com/ypannnn) [@echizenryoma](https://github.com/echizenryoma) [@zirawell](https://github.com/zirawell) [@urzz](https://github.com/urzz) [@ASD-max](https://github.com/ASD-max)

View File

@ -2,7 +2,7 @@ const scriptName = "Fa米家";
const getCookieRegex = /^https?:\/\/fmapp\.chinafamilymart\.com\.cn\/api\/app\/market\/member\/(signin\/usersign|sign\/current)/; const getCookieRegex = /^https?:\/\/fmapp\.chinafamilymart\.com\.cn\/api\/app\/market\/member\/(signin\/usersign|sign\/current)/;
const startAdRegex = /^https?:\/\/fmapp\.chinafamilymart\.com\.cn\/api\/app\/market\/start\/ad/; const startAdRegex = /^https?:\/\/fmapp\.chinafamilymart\.com\.cn\/api\/app\/market\/start\/ad/;
const famijiaCookieKey = "famijia_checkin_cookie"; const famijiaCookieKey = "famijia_checkin_cookie";
const famijiaDeviceIdKey = "famijia_device_id_cookie"; const famijiaDeviceIdKey = "famijia_device_id";
const famijiaBlackBoxKey = "famijia_black_box"; const famijiaBlackBoxKey = "famijia_black_box";
let magicJS = MagicJS(scriptName, "INFO"); let magicJS = MagicJS(scriptName, "INFO");
magicJS.unifiedPushUrl = magicJS.read("famijia_unified_push_url") || magicJS.read("magicjs_unified_push_url"); magicJS.unifiedPushUrl = magicJS.read("famijia_unified_push_url") || magicJS.read("magicjs_unified_push_url");
@ -14,15 +14,16 @@ function CheckInNewVerrsion(cookie, deviceId, blackBox) {
headers: { headers: {
"Accept": "*/*", "Accept": "*/*",
"Accept-Encoding": "br;q=1.0, gzip;q=0.9, deflate;q=0.8", "Accept-Encoding": "br;q=1.0, gzip;q=0.9, deflate;q=0.8",
"Accept-Language": "zh-Hans-CN;q=1.0", "Accept-Language": "zh-Hans-CN;q=1.0, en-CN;q=0.9",
"Connection": "keep-alive", "Connection": "keep-alive",
"Content-Type": "application/json", "Content-Type": "application/json",
"Host": "fmapp.chinafamilymart.com.cn", "Host": "fmapp.chinafamilymart.com.cn",
"User-Agent": "Fa", "User-Agent": "Fa",
"blackBox": blackBox, "blackBox": blackBox,
"deviceId": deviceId, "deviceId": deviceId,
"fmVersion": "2.1.1", "fmVersion": "2.2.3",
"loginChannel": "app", "loginChannel": "app",
"os": "ios",
"token": cookie, "token": cookie,
}, },
body: {}, body: {},
@ -37,7 +38,7 @@ function CheckInNewVerrsion(cookie, deviceId, blackBox) {
let obj = typeof data === "string" ? JSON.parse(data) : data; let obj = typeof data === "string" ? JSON.parse(data) : data;
if (obj.code === "200") { if (obj.code === "200") {
resolve([obj.data, ""]); resolve([obj.data, ""]);
} else if (obj.code === "3004000") { } else if (obj.message) {
resolve([null, obj.message]); resolve([null, obj.message]);
} else { } else {
magicJS.logError(`签到失败,响应异常:${data}`); magicJS.logError(`签到失败,响应异常:${data}`);