forked from ant-design/ant-design
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use axios instead of request * fix: Optimize the writing of axios Co-authored-by: zhang lay <lay.zhang@shopee.com>
- Loading branch information
1 parent
7be29ca
commit 01255f5
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
const path = require('path'); | ||
const request = require('request'); | ||
const axios = require('axios'); | ||
|
||
const cwd = process.cwd(); | ||
|
||
const { version } = require(path.resolve(cwd, 'package.json')); | ||
const seatalkUrl = 'https://openapi.seatalk.io/webhook/group/_mh_SKGeQruZ49eX4CzqQw'; | ||
|
||
function noticeSeaTalk() { | ||
request({ | ||
url: 'https://openapi.seatalk.io/webhook/group/_mh_SKGeQruZ49eX4CzqQw', | ||
method: 'POST', | ||
json: true, | ||
headers: { | ||
'content-type': 'application/json', | ||
}, | ||
body: { | ||
axios | ||
.post(seatalkUrl, { | ||
tag: 'text', | ||
text: { | ||
content: `Hello, everyone! Infrad has released version ${version}, Please check the update details from https://bolifestudio.com/changelog-cn`, | ||
at_all: true, | ||
}, | ||
}, | ||
}); | ||
}) | ||
.then(res => { | ||
console.log('Successful notice in seatalk.'); | ||
}) | ||
.catch(e => { | ||
console.log(e); | ||
}); | ||
} | ||
|
||
noticeSeaTalk(); |