-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[rewrite_local] | ||
^https?:\/\/www\.xiaomaigongkao\.com\/AppApi\/(vip|StartPage\/welcome|Member\/indexHangingWindow|Course\/(curriculum|details)) url script-response-body https://raw.githubusercontent.com/halgfdc/113/main/delay.js// | ||
|
||
[mitm] | ||
hostname = www.xiaomaigongkao.com | ||
|
||
*************************************/ | ||
|
||
|
||
var chxm1023 = JSON.parse($response.body); | ||
const vip = /AppApi\/vip\/index/; //会员信息 | ||
const user = /AppApi\/vip\/userInfo/; //用户会员 | ||
const ad = /AppApi\/(StartPage\/welcome|Member\/indexHangingWindow)/; //开屏/浮窗 | ||
const kc = /AppApi\/(Course\/(curriculum|details)|vip\/ebook)/; //解锁课程 | ||
|
||
if(vip.test($request.url)){ | ||
chxm1023.data.vip_user = { | ||
...chxm1023.data.vip_user, | ||
"status": "1", | ||
"end_valid_time": "4092599349" | ||
}; | ||
searchAndModify(chxm1023, 'is_vip_user', true, 'is_free', 1); | ||
} | ||
|
||
if(user.test($request.url)){ | ||
chxm1023.data = { | ||
...chxm1023.data, | ||
"status" : "1", | ||
"end_valid_time" : "4092599349" | ||
}; | ||
} | ||
|
||
if(ad.test($request.url)){ | ||
chxm1023.data = null; | ||
} | ||
|
||
if(kc.test($request.url)){ | ||
searchAndModify(chxm1023, 'is_free', 2, 'is_buy', 1, 'is_vip_user', true); | ||
} | ||
|
||
$done({ body: JSON.stringify(chxm1023) }); | ||
|
||
function searchAndModify(obj, ...args) {for (let i = 0; i < args.length; i += 2) {const key = args[i];const value = args[i + 1];for (var prop in obj) {if (obj.hasOwnProperty(prop)) {if (typeof obj[prop] === 'object') {searchAndModify(obj[prop], ...args);} else if (prop === key) {obj[prop] = value;}}}}}; |