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

Function getUserInfo

jd_factory_component.js:92–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90}
91
92function getUserInfo() {
93 return new Promise(resolve => {
94 $.get(taskUrl('userinfo/GetUserInfo'), async (err, resp, data) => {
95 try {
96 const { ret, data: { factoryList = [], productionList = [], user = {} } = {}, msg } = JSON.parse(data);
97 $.log(`\n获取用户信息:${msg}\n${$.showLog ? data : ''}`);
98 $.info = {
99 ...$.info,
100 factoryInfo: factoryList[0],
101 productionInfo: productionList[0],
102 user,
103 };
104 resolve({
105 factoryInfo: factoryList[0],
106 productionInfo: productionList[0],
107 user,
108 });
109 } catch (e) {
110 $.logErr(e, resp);
111 } finally {
112 resolve();
113 }
114 });
115 });
116}
117
118async function getMyComponent() {
119 let meStatus = [false];

Callers 1

Calls 4

taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected