Browse Source

add 线上环境飞书监控

DevYK 2 years ago
parent
commit
1096ddcf68
5 changed files with 9 additions and 3 deletions
  1. 1 1
      app.js
  2. 1 0
      config/dev_config.js
  3. 1 0
      config/prd_config.js
  4. 1 0
      config/test_config.js
  5. 5 2
      model/feishu.js

+ 1 - 1
app.js

@@ -55,5 +55,5 @@ app.on('error', (err, ctx) => {
 });
 
 
-log.log('app start');
+log.error('app start');
 module.exports = app

+ 1 - 0
config/dev_config.js

@@ -16,6 +16,7 @@ const account_config = {
     BNB_GAS_LIMIT: '21000',
     BNB_GAS_PRICE: '13000000000',
     TRANSFER_GAS: true,
+    FEISHU_URL:'https://open.feishu.cn/open-apis/bot/v2/hook/18dfe21f-b1bd-46ca-a8c7-c85e1c84f02d'
 }
 
 const reids_token_config = {

+ 1 - 0
config/prd_config.js

@@ -9,6 +9,7 @@ const account_config = {
     BNB_GAS_LIMIT: '21000',
     BNB_GAS_PRICE: '6000000000',
     TRANSFER_GAS: true,
+    FEISHU_URL:'https://open.feishu.cn/open-apis/bot/v2/hook/9ab2594f-3d27-4f70-a5ed-a6aee0420aa6'
 }
 
 const cryppt_config = {

+ 1 - 0
config/test_config.js

@@ -9,6 +9,7 @@ const account_config = {
     BNB_GAS_LIMIT: '21000',
     BNB_GAS_PRICE: '13000000000',
     TRANSFER_GAS: true,
+    FEISHU_URL:'https://open.feishu.cn/open-apis/bot/v2/hook/18dfe21f-b1bd-46ca-a8c7-c85e1c84f02d'
 }
 
 const cryppt_config = {

+ 5 - 2
model/feishu.js

@@ -1,10 +1,13 @@
 
 const axios = require('axios');
 
-const url = 'https://open.feishu.cn/open-apis/bot/v2/hook/18dfe21f-b1bd-46ca-a8c7-c85e1c84f02d'
+
+var { account_config } = require('../config/config.js')
+
+var url = account_config.FEISHU_URL
 
 const sendMessage = async (...params) => {
-    var log = '环境:'+process.env.NODE_ENV +' ----> ';
+    var log = '环境:' + process.env.NODE_ENV + ' ----> ';
     for (let index = 0; index < params.length; index++) {
         log = log.concat(params[index].toString())
     }