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

Function GetUserComponent

jd_dreamFactory.js:788–814  ·  view source on GitHub ↗
(pin = $.encryptPin, timeout = 0)

Source from the content-addressed store, hash-verified

786 }
787}
788function GetUserComponent(pin = $.encryptPin, timeout = 0) {
789 return new Promise(resolve => {
790 setTimeout(() => {
791 $.get(taskurl('usermaterial/GetUserComponent', `pin=${pin}`, `_time,pin,zone`), (err, resp, data) => {
792 try {
793 if (err) {
794 console.log(`${JSON.stringify(err)}`)
795 console.log(`${$.name} API请求失败,请检查网路重试`)
796 } else {
797 if (safeGet(data)) {
798 data = JSON.parse(data);
799 if (data['ret'] === 0) {
800
801 } else {
802 console.log(`GetUserComponent失败:${JSON.stringify(data)}`)
803 }
804 }
805 }
806 } catch (e) {
807 $.logErr(e, resp)
808 } finally {
809 resolve(data);
810 }
811 })
812 }, timeout)
813 })
814}
815//收取地下随机零件电力API
816
817function PickUpComponent(index, encryptPin) {

Callers 1

PickUpFunction · 0.85

Calls 5

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

Tested by

no test coverage detected