MCPcopy Create free account
hub / github.com/Semporia/Scripts / getFactoryIdByPin

Function getFactoryIdByPin

jd_dreamFactory.js:908–937  ·  view source on GitHub ↗
(pin)

Source from the content-addressed store, hash-verified

906 })
907}
908function getFactoryIdByPin(pin) {
909 return new Promise((resolve, reject) => {
910 // const url = `/dreamfactory/userinfo/GetUserInfoByPin?zone=dream_factory&pin=${pin}&sceneval=2`;
911 $.get(taskurl('userinfo/GetUserInfoByPin', `pin=${pin}`), (err, resp, data) => {
912 try {
913 if (err) {
914 console.log(`${JSON.stringify(err)}`)
915 console.log(`${$.name} API请求失败,请检查网路重试`)
916 } else {
917 if (safeGet(data)) {
918 data = JSON.parse(data);
919 if (data['ret'] === 0) {
920 if (data.data.factoryList) {
921 //做此判断,有时候返回factoryList为null
922 // resolve(data['data']['factoryList'][0]['factoryId'])
923 $.stealFactoryId = data['data']['factoryList'][0]['factoryId'];
924 }
925 } else {
926 console.log(`异常:${JSON.stringify(data)}`)
927 }
928 }
929 }
930 } catch (e) {
931 $.logErr(e, resp)
932 } finally {
933 resolve();
934 }
935 })
936 })
937}
938async function tuanActivity() {
939 const tuanConfig = await QueryActiveConfig();
940 if (tuanConfig && tuanConfig.ret === 0) {

Callers

nothing calls this directly

Calls 5

taskurlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected