MCPcopy Create free account
hub / github.com/6dylan6/jdm / GetnickName

Function GetnickName

function/sendNotify.js:1989–2030  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1987}
1988
1989function GetnickName() {
1990 return new Promise(async resolve => {
1991 const options = {
1992 url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
1993 headers: {
1994 Host: "me-api.jd.com",
1995 Accept: "*/*",
1996 Connection: "keep-alive",
1997 Cookie: cookie,
1998 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42",
1999 "Accept-Language": "zh-cn",
2000 "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
2001 "Accept-Encoding": "gzip, deflate, br"
2002 }
2003 }
2004 $.get(options, (err, resp, data) => {
2005 try {
2006 if (err) {
2007 $.logErr(err)
2008 } else {
2009 if (data) {
2010 data = JSON.parse(data);
2011 if (data['retcode'] === "1001") {
2012 return;
2013 }
2014 if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
2015 $.nickName = data.data.userInfo.baseInfo.nickname;
2016 }
2017
2018 } else {
2019 $.log('京东服务器返回空数据');
2020 }
2021 }
2022 } catch (e) {
2023 $.logErr(e)
2024 }
2025 finally {
2026 resolve();
2027 }
2028 })
2029 })
2030}
2031
2032function GetnickName2() {
2033 return new Promise(async(resolve) => {

Callers 2

sendNotifyFunction · 0.70
sendNotifybyWxPucherFunction · 0.70

Calls 3

getMethod · 0.45
logErrMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected