mirror of
				https://github.com/shufflewzc/faker2.git
				synced 2025-10-31 12:02:44 +08:00 
			
		
		
		
	update
This commit is contained in:
		
							parent
							
								
									3b807204de
								
							
						
					
					
						commit
						2cfdb115a6
					
				| @ -265,14 +265,6 @@ if(DisableIndex!=-1){ | |||||||
| 	EnableJdSpeed=false;	 | 	EnableJdSpeed=false;	 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //京喜牧场
 |  | ||||||
| let EnableJxMC=true; |  | ||||||
| DisableIndex= strDisableList.findIndex((item) => item === "京喜牧场"); |  | ||||||
| if(DisableIndex!=-1){ |  | ||||||
| 	console.log("检测到设定关闭京喜牧场查询"); |  | ||||||
| 	EnableJxMC=false;	 |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // 京东工厂
 | // 京东工厂
 | ||||||
| let EnableJDGC=true; | let EnableJDGC=true; | ||||||
| DisableIndex=strDisableList.findIndex((item) => item === "京东工厂"); | DisableIndex=strDisableList.findIndex((item) => item === "京东工厂"); | ||||||
| @ -495,7 +487,6 @@ if(DisableIndex!=-1){ | |||||||
| 			        getJoyBaseInfo(), //汪汪乐园
 | 			        getJoyBaseInfo(), //汪汪乐园
 | ||||||
| 			        getJdZZ(), //京东赚赚		        
 | 			        getJdZZ(), //京东赚赚		        
 | ||||||
| 			        cash(), //特价金币
 | 			        cash(), //特价金币
 | ||||||
| 			        jdJxMCinfo(), //京喜牧场
 |  | ||||||
| 			        bean(), //京豆查询
 | 			        bean(), //京豆查询
 | ||||||
| 			        getDdFactoryInfo(), // 京东工厂
 | 			        getDdFactoryInfo(), // 京东工厂
 | ||||||
| 			        jdCash(), //领现金
 | 			        jdCash(), //领现金
 | ||||||
| @ -1241,20 +1232,6 @@ async function Monthbean() { | |||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function jdJxMCinfo(){ |  | ||||||
|     if (EnableJxMC) { |  | ||||||
|         llgeterror = false; |  | ||||||
|         await requestAlgo(); |  | ||||||
|         if (llgeterror) { |  | ||||||
|             console.log(`等待10秒后再次尝试...`) |  | ||||||
|             await $.wait(10 * 1000); |  | ||||||
|             await requestAlgo(); |  | ||||||
|         } |  | ||||||
|         await JxmcGetRequest(); |  | ||||||
|     } |  | ||||||
| 	return; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| async function jdCash() { | async function jdCash() { | ||||||
| 	if (!EnableCash) | 	if (!EnableCash) | ||||||
| 		return; | 		return; | ||||||
| @ -2226,38 +2203,6 @@ function taskcashUrl(_0x7683x2, _0x7683x3 = {}) { | |||||||
| 	} | 	} | ||||||
| })({}) | })({}) | ||||||
| 
 | 
 | ||||||
| async function JxmcGetRequest() { |  | ||||||
| 	let url = ``; |  | ||||||
| 	let myRequest = ``; |  | ||||||
| 	url = `https://m.jingxi.com/jxmc/queryservice/GetHomePageInfo?channel=7&sceneid=1001&activeid=null&activekey=null&isgift=1&isquerypicksite=1&_stk=channel%2Csceneid&_ste=1`; |  | ||||||
| 	url += `&h5st=${decrypt(Date.now(), '', '', url)}&_=${Date.now() + 2}&sceneval=2&g_login_type=1&callback=jsonpCBK${String.fromCharCode(Math.floor(Math.random() * 26) + "A".charCodeAt(0))}&g_ty=ls`; |  | ||||||
| 	myRequest = getGetRequest(`GetHomePageInfo`, url); |  | ||||||
| 
 |  | ||||||
| 	return new Promise(async resolve => { |  | ||||||
| 		$.get(myRequest, (err, resp, data) => { |  | ||||||
| 			try { |  | ||||||
| 				if (err) { |  | ||||||
| 					console.log(`${JSON.stringify(err)}`) |  | ||||||
| 					console.log(`JxmcGetRequest API请求失败,请检查网路重试`) |  | ||||||
| 					$.runFlag = false; |  | ||||||
| 					console.log(`请求失败`) |  | ||||||
| 				} else { |  | ||||||
| 					data = JSON.parse(data.match(new RegExp(/jsonpCBK.?\((.*);*/))[1]); |  | ||||||
| 					if (data.ret === 0) { |  | ||||||
| 						$.JDEggcnt = data.data.eggcnt; |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
| 			} catch (e) { |  | ||||||
| 				console.log(data); |  | ||||||
| 				$.logErr(e, resp) |  | ||||||
| 			} |  | ||||||
| 			finally { |  | ||||||
| 				resolve(); |  | ||||||
| 			} |  | ||||||
| 		}) |  | ||||||
| 	}) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| // 东东工厂信息查询
 | // 东东工厂信息查询
 | ||||||
| async function getDdFactoryInfo() { | async function getDdFactoryInfo() { | ||||||
| 	if (!EnableJDGC) | 	if (!EnableJDGC) | ||||||
| @ -2566,29 +2511,6 @@ function randomString(e) { | |||||||
| 	return n | 	return n | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function getGetRequest(type, url) { |  | ||||||
| 	UA = `jdpingou;iPhone;4.13.0;14.4.2;${randomString(40)};network/wifi;model/iPhone10,2;appBuild/100609;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/1;hasOCPay/0;supportBestPay/0;session/${Math.random * 98 + 1};pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148` |  | ||||||
| 
 |  | ||||||
| 		const method = `GET`; |  | ||||||
| 	let headers = { |  | ||||||
| 		'Origin': `https://st.jingxi.com`, |  | ||||||
| 		'Cookie': cookie, |  | ||||||
| 		'Connection': `keep-alive`, |  | ||||||
| 		'Accept': `application/json`, |  | ||||||
| 		'Referer': `https://st.jingxi.com/pingou/jxmc/index.html`, |  | ||||||
| 		'Host': `m.jingxi.com`, |  | ||||||
| 		'User-Agent': UA, |  | ||||||
| 		'Accept-Encoding': `gzip, deflate, br`, |  | ||||||
| 		'Accept-Language': `zh-cn` |  | ||||||
| 	}; |  | ||||||
| 	return { |  | ||||||
| 		url: url, |  | ||||||
| 		method: method, |  | ||||||
| 		headers: headers, |  | ||||||
| 		timeout: 10000 |  | ||||||
| 	}; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| Date.prototype.Format = function (fmt) { | Date.prototype.Format = function (fmt) { | ||||||
| 	var e, | 	var e, | ||||||
| 	n = this, | 	n = this, | ||||||
| @ -2642,69 +2564,6 @@ function decrypt(time, stk, type, url) { | |||||||
| 		} | 		} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function requestAlgo() { |  | ||||||
| 	$.fingerprint = await generateFp(); |  | ||||||
| 	$.appId = 10028; |  | ||||||
| 	const options = { |  | ||||||
| 		"url": `https://cactus.jd.com/request_algo?g_ty=ajax`, |  | ||||||
| 		"headers": { |  | ||||||
| 			'Authority': 'cactus.jd.com', |  | ||||||
| 			'Pragma': 'no-cache', |  | ||||||
| 			'Cache-Control': 'no-cache', |  | ||||||
| 			'Accept': 'application/json', |  | ||||||
| 			'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), |  | ||||||
| 			//'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
 |  | ||||||
| 			'Content-Type': 'application/json', |  | ||||||
| 			'Origin': 'https://st.jingxi.com', |  | ||||||
| 			'Sec-Fetch-Site': 'cross-site', |  | ||||||
| 			'Sec-Fetch-Mode': 'cors', |  | ||||||
| 			'Sec-Fetch-Dest': 'empty', |  | ||||||
| 			'Referer': 'https://st.jingxi.com/', |  | ||||||
| 			'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7' |  | ||||||
| 		}, |  | ||||||
| 		'body': JSON.stringify({ |  | ||||||
| 			"version": "1.0", |  | ||||||
| 			"fp": $.fingerprint, |  | ||||||
| 			"appId": $.appId.toString(), |  | ||||||
| 			"timestamp": Date.now(), |  | ||||||
| 			"platform": "web", |  | ||||||
| 			"expandParams": "" |  | ||||||
| 		}) |  | ||||||
| 	} |  | ||||||
| 	new Promise(async resolve => { |  | ||||||
| 		$.post(options, (err, resp, data) => { |  | ||||||
| 			try { |  | ||||||
| 				if (err) { |  | ||||||
| 					console.log(`${JSON.stringify(err)}`) |  | ||||||
| 					console.log(`request_algo 签名参数API请求失败,请检查网路重试`) |  | ||||||
| 					llgeterror = true; |  | ||||||
| 				} else { |  | ||||||
| 					if (data) { |  | ||||||
| 						data = JSON.parse(data); |  | ||||||
| 						if (data['status'] === 200) { |  | ||||||
| 							$.Jxmctoken = data.data.result.tk; |  | ||||||
| 							let enCryptMethodJDString = data.data.result.algo; |  | ||||||
| 							if (enCryptMethodJDString) |  | ||||||
| 								$.enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)(); |  | ||||||
| 						} else { |  | ||||||
| 							console.log('request_algo 签名参数API请求失败:') |  | ||||||
| 						} |  | ||||||
| 					} else { |  | ||||||
| 						llgeterror = true; |  | ||||||
| 						console.log(`京东服务器返回空数据`) |  | ||||||
| 					} |  | ||||||
| 				} |  | ||||||
| 			} catch (e) { |  | ||||||
| 				llgeterror = true; |  | ||||||
| 				$.logErr(e, resp) |  | ||||||
| 			} |  | ||||||
| 			finally { |  | ||||||
| 				resolve(); |  | ||||||
| 			} |  | ||||||
| 		}) |  | ||||||
| 	}) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function generateFp() { | function generateFp() { | ||||||
| 	let e = "0123456789"; | 	let e = "0123456789"; | ||||||
| 	let a = 13; | 	let a = 13; | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								jd_fans.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								jd_fans.js
									
									
									
									
									
								
							| @ -8,11 +8,11 @@ | |||||||
| 
 | 
 | ||||||
| //活动列表
 | //活动列表
 | ||||||
| let activityList = [ | let activityList = [ | ||||||
|   { 'id': "52f81b37b31642b584524e5fcd4b00e0", 'endTime': 1677599999000 }, |   { 'id': "082aabe02bc94c88a5897ca8dd4b451c", 'endTime': 1680192000000 }, | ||||||
|   { 'id': "2408d0c60ff94ec49170abd65b1d1e99", 'endTime': 1677599999000 },   |   { 'id': "a36fd42d4a13473db25fd81106f0a788", 'endTime': 1680192000000 },   | ||||||
|   { 'id': "935e28226bde4c039e30467fb1d9d417", 'endTime': 1677599999000 }, |   // { 'id': "935e28226bde4c039e30467fb1d9d417", 'endTime': 1677599999000 },
 | ||||||
|   { 'id': "5b2aadcb361f44e9965367e049272c73", 'endTime': 1676390399000 },   |   // { 'id': "5b2aadcb361f44e9965367e049272c73", 'endTime': 1676390399000 },  
 | ||||||
|   { 'id': "25a66a027689426baedfcc83dac0c696", 'endTime': 1676390399000 },   |   // { 'id': "25a66a027689426baedfcc83dac0c696", 'endTime': 1676390399000 },  
 | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| const $ = new Env('粉丝互动-加密'); | const $ = new Env('粉丝互动-加密'); | ||||||
|  | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										102
									
								
								sendNotify.js
									
									
									
									
									
								
							
							
						
						
									
										102
									
								
								sendNotify.js
									
									
									
									
									
								
							| @ -21,7 +21,7 @@ const querystring = require('querystring'); | |||||||
| const exec = require('child_process').exec; | const exec = require('child_process').exec; | ||||||
| const $ = new Env(); | const $ = new Env(); | ||||||
| const timeout = 15000; //超时时间(单位毫秒)
 | const timeout = 15000; //超时时间(单位毫秒)
 | ||||||
| console.log("加载sendNotify,当前版本: 20221118"); | console.log("加载sendNotify,当前版本: 20230224"); | ||||||
| // =======================================go-cqhttp通知设置区域===========================================
 | // =======================================go-cqhttp通知设置区域===========================================
 | ||||||
| //gobot_url 填写请求地址http://127.0.0.1/send_private_msg
 | //gobot_url 填写请求地址http://127.0.0.1/send_private_msg
 | ||||||
| //gobot_token 填写在go-cqhttp文件设置的访问密钥
 | //gobot_token 填写在go-cqhttp文件设置的访问密钥
 | ||||||
| @ -91,8 +91,6 @@ let IGOT_PUSH_KEY = ''; | |||||||
| //PUSH_PLUS_USER: 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)
 | //PUSH_PLUS_USER: 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)
 | ||||||
| let PUSH_PLUS_TOKEN = ''; | let PUSH_PLUS_TOKEN = ''; | ||||||
| let PUSH_PLUS_USER = ''; | let PUSH_PLUS_USER = ''; | ||||||
| let PUSH_PLUS_TOKEN_hxtrip = ''; |  | ||||||
| let PUSH_PLUS_USER_hxtrip = ''; |  | ||||||
| 
 | 
 | ||||||
| // ======================================= WxPusher 通知设置区域 ===========================================
 | // ======================================= WxPusher 通知设置区域 ===========================================
 | ||||||
| // 此处填你申请的 appToken. 官方文档:https://wxpusher.zjiecode.com/docs
 | // 此处填你申请的 appToken. 官方文档:https://wxpusher.zjiecode.com/docs
 | ||||||
| @ -225,8 +223,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
|         IGOT_PUSH_KEY = ''; |         IGOT_PUSH_KEY = ''; | ||||||
|         PUSH_PLUS_TOKEN = ''; |         PUSH_PLUS_TOKEN = ''; | ||||||
|         PUSH_PLUS_USER = ''; |         PUSH_PLUS_USER = ''; | ||||||
|         PUSH_PLUS_TOKEN_hxtrip = ''; |  | ||||||
|         PUSH_PLUS_USER_hxtrip = ''; |  | ||||||
|         Notify_CKTask = ""; |         Notify_CKTask = ""; | ||||||
|         Notify_SkipText = []; |         Notify_SkipText = []; | ||||||
| 
 | 
 | ||||||
| @ -240,7 +236,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
|         var Use_qywxamNotify = true; |         var Use_qywxamNotify = true; | ||||||
|         var Use_iGotNotify = true; |         var Use_iGotNotify = true; | ||||||
|         var Use_gobotNotify = true; |         var Use_gobotNotify = true; | ||||||
|         var Use_pushPlushxtripNotify = true; |  | ||||||
|         var Use_WxPusher = true; |         var Use_WxPusher = true; | ||||||
|         var strtext = text; |         var strtext = text; | ||||||
|         var strdesp = desp; |         var strdesp = desp; | ||||||
| @ -502,7 +497,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
| 		                    console.log("关闭所有通知变量..."); | 		                    console.log("关闭所有通知变量..."); | ||||||
| 		                    Use_serverNotify = false; | 		                    Use_serverNotify = false; | ||||||
| 		                    Use_pushPlusNotify = false; | 		                    Use_pushPlusNotify = false; | ||||||
| 		                    Use_pushPlushxtripNotify = false; |  | ||||||
| 		                    Use_BarkNotify = false; | 		                    Use_BarkNotify = false; | ||||||
| 		                    Use_tgBotNotify = false; | 		                    Use_tgBotNotify = false; | ||||||
| 		                    Use_ddBotNotify = false; | 		                    Use_ddBotNotify = false; | ||||||
| @ -522,10 +516,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
| 		                            Use_pushPlusNotify = true; | 		                            Use_pushPlusNotify = true; | ||||||
| 		                            console.log("自定义设定启用pushplus(推送加)进行通知..."); | 		                            console.log("自定义设定启用pushplus(推送加)进行通知..."); | ||||||
| 		                            break;		                         | 		                            break;		                         | ||||||
| 		                        case "pushplushxtrip": |  | ||||||
| 		                            Use_pushPlushxtripNotify = true; |  | ||||||
| 		                            console.log("自定义设定启用pushplus_hxtrip(推送加)进行通知..."); |  | ||||||
| 		                            break; |  | ||||||
| 		                        case "Bark": | 		                        case "Bark": | ||||||
| 		                            Use_BarkNotify = true; | 		                            Use_BarkNotify = true; | ||||||
| 		                            console.log("自定义设定启用Bark进行通知..."); | 		                            console.log("自定义设定启用Bark进行通知..."); | ||||||
| @ -670,13 +660,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
| 		if (process.env["PUSH_PLUS_USER" + UseGroupNotify] && Use_pushPlusNotify) { | 		if (process.env["PUSH_PLUS_USER" + UseGroupNotify] && Use_pushPlusNotify) { | ||||||
| 		    PUSH_PLUS_USER = process.env["PUSH_PLUS_USER" + UseGroupNotify]; | 		    PUSH_PLUS_USER = process.env["PUSH_PLUS_USER" + UseGroupNotify]; | ||||||
| 		}		 | 		}		 | ||||||
| 
 |  | ||||||
| 		if (process.env["PUSH_PLUS_TOKEN_hxtrip" + UseGroupNotify] && Use_pushPlushxtripNotify) { |  | ||||||
| 		    PUSH_PLUS_TOKEN_hxtrip = process.env["PUSH_PLUS_TOKEN_hxtrip" + UseGroupNotify]; |  | ||||||
| 		} |  | ||||||
| 		if (process.env["PUSH_PLUS_USER_hxtrip" + UseGroupNotify] && Use_pushPlushxtripNotify) { |  | ||||||
| 		    PUSH_PLUS_USER_hxtrip = process.env["PUSH_PLUS_USER_hxtrip" + UseGroupNotify]; |  | ||||||
| 		} |  | ||||||
| 		if (process.env["GOTIFY_URL" + UseGroupNotify]) { | 		if (process.env["GOTIFY_URL" + UseGroupNotify]) { | ||||||
| 		    GOTIFY_URL = process.env["GOTIFY_URL" + UseGroupNotify]; | 		    GOTIFY_URL = process.env["GOTIFY_URL" + UseGroupNotify]; | ||||||
| 		} | 		} | ||||||
| @ -690,24 +673,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
|         const notifySkipRemarkList = process.env.NOTIFY_SKIP_NAMETYPELIST ? process.env.NOTIFY_SKIP_NAMETYPELIST.split('&') : []; |         const notifySkipRemarkList = process.env.NOTIFY_SKIP_NAMETYPELIST ? process.env.NOTIFY_SKIP_NAMETYPELIST.split('&') : []; | ||||||
|         const titleIndex3 = notifySkipRemarkList.findIndex((item) => item === strTitle); |         const titleIndex3 = notifySkipRemarkList.findIndex((item) => item === strTitle); | ||||||
| 		 | 		 | ||||||
|         if (text == "京东到家果园互助码:") { |  | ||||||
|             ShowRemarkType = "1"; |  | ||||||
|             if (desp) { |  | ||||||
|                 var arrTemp = desp.split(","); |  | ||||||
|                 var allCode = ""; |  | ||||||
|                 for (let k = 0; k < arrTemp.length; k++) { |  | ||||||
|                     if (arrTemp[k]) { |  | ||||||
|                         if (arrTemp[k].substring(0, 1) != "@") |  | ||||||
|                             allCode += arrTemp[k] + ","; |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 if (allCode) { |  | ||||||
|                     desp += '\n' + '\n' + "ccwav格式化后的互助码:" + '\n' + allCode; |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         if (ShowRemarkType != "1" && titleIndex3 == -1) { |         if (ShowRemarkType != "1" && titleIndex3 == -1) { | ||||||
|             console.log("sendNotify正在处理账号Remark....."); |             console.log("sendNotify正在处理账号Remark....."); | ||||||
|             //开始读取青龙变量列表
 |             //开始读取青龙变量列表
 | ||||||
| @ -842,24 +807,9 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //提供6种通知
 |     //提供6种通知
 | ||||||
|     desp = buildLastDesp(desp, author) |     desp = buildLastDesp(desp, author); | ||||||
| 
 |  | ||||||
| 	await serverNotify(text, desp); //微信server酱
 | 	await serverNotify(text, desp); //微信server酱
 | ||||||
| 
 | 
 | ||||||
|     if (PUSH_PLUS_TOKEN_hxtrip) { |  | ||||||
|         console.log("hxtrip TOKEN :" + PUSH_PLUS_TOKEN_hxtrip); |  | ||||||
|     } |  | ||||||
|     if (PUSH_PLUS_USER_hxtrip) { |  | ||||||
|         console.log("hxtrip USER :" + PUSH_PLUS_USER_hxtrip); |  | ||||||
|     } |  | ||||||
|     PushErrorTime = 0; |  | ||||||
|     await pushPlusNotifyhxtrip(text, desp); //pushplushxtrip(推送加)
 |  | ||||||
|     if (PushErrorTime > 0) { |  | ||||||
|         console.log("等待1分钟后重试....."); |  | ||||||
|         await $.wait(60000); |  | ||||||
|         await pushPlusNotifyhxtrip(text, desp); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     if (PUSH_PLUS_TOKEN) { |     if (PUSH_PLUS_TOKEN) { | ||||||
|         console.log("PUSH_PLUS TOKEN :" + PUSH_PLUS_TOKEN); |         console.log("PUSH_PLUS TOKEN :" + PUSH_PLUS_TOKEN); | ||||||
|     } |     } | ||||||
| @ -1334,6 +1284,7 @@ function tgBotNotify(text, desp) { | |||||||
|             chat_id: `${TG_USER_ID}`, |             chat_id: `${TG_USER_ID}`, | ||||||
|             text: `${text}\n\n${desp}`, |             text: `${text}\n\n${desp}`, | ||||||
|             disable_web_page_preview:true, |             disable_web_page_preview:true, | ||||||
|  | 			parse_mode:"html", | ||||||
|           }, |           }, | ||||||
|         headers: { |         headers: { | ||||||
|           'Content-Type': 'application/json', |           'Content-Type': 'application/json', | ||||||
| @ -1678,53 +1629,6 @@ function iGotNotify(text, desp, params = {}) { | |||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| function pushPlusNotifyhxtrip(text, desp) { |  | ||||||
|     return new Promise((resolve) => { |  | ||||||
|         if (PUSH_PLUS_TOKEN_hxtrip) { |  | ||||||
|             //desp = `<font size="3">${desp}</font>`;
 |  | ||||||
| 
 |  | ||||||
|             desp = desp.replace(/[\n\r]/g, '<br>'); // 默认为html, 不支持plaintext
 |  | ||||||
|             const body = { |  | ||||||
|                 token: `${PUSH_PLUS_TOKEN_hxtrip}`, |  | ||||||
|                 title: `${text}`, |  | ||||||
|                 content: `${desp}`, |  | ||||||
|                 topic: `${PUSH_PLUS_USER_hxtrip}`, |  | ||||||
|             }; |  | ||||||
|             const options = { |  | ||||||
|                 url: `http://pushplus.hxtrip.com/send`, |  | ||||||
|                 body: JSON.stringify(body), |  | ||||||
|                 headers: { |  | ||||||
|                     'Content-Type': ' application/json', |  | ||||||
|                 }, |  | ||||||
|                 timeout, |  | ||||||
|             }; |  | ||||||
|             $.post(options, (err, resp, data) => { |  | ||||||
|                 try { |  | ||||||
|                     if (err) { |  | ||||||
|                         console.log(`hxtrip push+发送${PUSH_PLUS_USER_hxtrip ? '一对多' : '一对一'}通知消息失败!!\n`); |  | ||||||
|                         PushErrorTime += 1; |  | ||||||
|                         console.log(err); |  | ||||||
|                     } else { |  | ||||||
|                         if (data.indexOf("200") > -1) { |  | ||||||
|                             console.log(`hxtrip push+发送${PUSH_PLUS_USER_hxtrip ? '一对多' : '一对一'}通知消息完成。\n`); |  | ||||||
|                             PushErrorTime = 0; |  | ||||||
|                         } else { |  | ||||||
|                             console.log(`hxtrip push+发送${PUSH_PLUS_USER_hxtrip ? '一对多' : '一对一'}通知消息失败:${data}\n`); |  | ||||||
|                             PushErrorTime += 1; |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                 } catch (e) { |  | ||||||
|                     $.logErr(e, resp); |  | ||||||
|                 } |  | ||||||
|                 finally { |  | ||||||
|                     resolve(data); |  | ||||||
|                 } |  | ||||||
|             }); |  | ||||||
|         } else { |  | ||||||
|             resolve(); |  | ||||||
|         } |  | ||||||
|     }); |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| function pushPlusNotify(text, desp) { | function pushPlusNotify(text, desp) { | ||||||
|     return new Promise((resolve) => { |     return new Promise((resolve) => { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Faker
						Faker