MCPcopy Create free account
hub / github.com/6dylan6/jdpro / sendNotifybyWxPucher

Function sendNotifybyWxPucher

function/sendNotify.js:971–1078  ·  view source on GitHub ↗
(text, desp, PtPin, author = '\n================================\n好物推荐:<a href="https://u.jd.com/WLEVYTM">https://u.jd.com/WLEVYTM</a>', strsummary = "")

Source from the content-addressed store, hash-verified

969}
970
971async function sendNotifybyWxPucher(text, desp, PtPin, author = '\n================================\n好物推荐:<a href="https://u.jd.com/WLEVYTM">https://u.jd.com/WLEVYTM</a>', strsummary = "") {
972
973 try {
974 var Uid = "";
975 var UserRemark = "";
976 var strTempdesp = [];
977 var strAllNotify = "";
978 if (text == "京东资产统计") {
979 strTempdesp = desp.split('🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏');
980 if (strTempdesp.length == 2) {
981 strAllNotify = strTempdesp[0];
982 desp = strTempdesp[1];
983 }
984
985 }
986
987 if (WP_APP_TOKEN_ONE) {
988 var tempEnv = await getEnvByPtPin(PtPin);
989 if (tempEnv) {
990 cookie = tempEnv.value;
991 Uid = getuuid(tempEnv.remarks, PtPin);
992 UserRemark = getRemark(tempEnv.remarks);
993
994 if (Uid) {
995 console.log("查询到Uid :" + Uid);
996 WP_UIDS_ONE = Uid;
997 console.log("正在发送一对一通知,请稍后...");
998
999 if (text == "京东资产统计") {
1000 try {
1001 $.nickName = "";
1002 $.FoundPin = "";
1003 $.UserName = PtPin;
1004 if (tempEnv.status == 0) {
1005 if (TempCK) {
1006 for (let j = 0; j < TempCK.length; j++) {
1007 if (TempCK[j].pt_pin == $.UserName) {
1008 $.FoundPin = TempCK[j].pt_pin;
1009 $.nickName = TempCK[j].nickName;
1010 }
1011 }
1012 }
1013 if (!$.FoundPin) {
1014 //缓存文件中有没有这个账号,调用京东接口获取别名,并更新缓存文件
1015 console.log($.UserName + "好像是新账号,尝试获取别名.....");
1016 await GetnickName();
1017 if (!$.nickName) {
1018 console.log("别名获取失败,尝试调用另一个接口获取别名.....");
1019 await GetnickName2();
1020 }
1021 }
1022 }
1023
1024 $.nickName = $.nickName || $.UserName;
1025
1026 //额外处理1,nickName包含星号
1027 $.nickName = $.nickName.replace(new RegExp(`[*]`, 'gm'), "[*]");
1028

Callers 1

sendNotifyFunction · 0.70

Calls 10

getEnvByPtPinFunction · 0.70
getuuidFunction · 0.70
getRemarkFunction · 0.70
GetnickNameFunction · 0.70
GetnickName2Function · 0.70
getQLinfoFunction · 0.70
buildLastDespFunction · 0.70
wxpusherNotifyByOneFunction · 0.70
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected