ソースを参照

feat(task): 添加 cowboy 数据接口请求

wuyi 1 年間 前
コミット
d0179a0400
1 ファイル変更24 行追加1 行削除
  1. 24 1
      src/task/task.service.ts

+ 24 - 1
src/task/task.service.ts

@@ -666,7 +666,8 @@ export class TaskService implements OnModuleInit {
             cloud033: 0,
             cloud034: 0,
             cloud037: 0,
-            xyz: 0
+            xyz: 0,
+            cowboy: 0
         }
         const cloudInstance = axios.create({
             baseURL: 'http://52.77.17.214:9001/api/'
@@ -697,6 +698,28 @@ export class TaskService implements OnModuleInit {
                 } catch (e) {
                 }
             })(),
+            (async () => {
+                try {
+                    const cowboyRes = await axios
+                        .create({
+                            baseURL: 'http://8.218.211.187/',
+                            headers: {
+                                uhost: 'api.cowboymsg.com',
+                                uprotocol: 'http'
+                            }
+                        })
+                        .get('getUserInfo', {
+                            params: {
+                                name: 'launch',
+                                ApiKey: 'NUdVcVMxelBQTXlpcTBwbk1XQUhzQT09'
+                            }
+                        })
+                    if (cowboyRes.data.code === 200) {
+                        res.cowboy = cowboyRes.data.data.score
+                    }
+                } catch (e) {
+                }
+            })(),
             (async () => {
                 try {
                     const xyz = await xyzInstance.get('v1', {