| 906 | }) |
| 907 | } |
| 908 | function 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 | } |
| 938 | async function tuanActivity() { |
| 939 | const tuanConfig = await QueryActiveConfig(); |
| 940 | if (tuanConfig && tuanConfig.ret === 0) { |