Skip to content

Commit

Permalink
fix: 移除 qs,迁移到原生 URLSearchParams;修复 Qmsg 文档链接
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Oct 30, 2024
1 parent 4c5adc4 commit 447fe60
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"@types/module-alias": "^2.0.0",
"@types/node": "^22.0.0",
"@types/nodemailer": "^6.4.7",
"@types/qs": "^6.9.5",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"commitizen": "^4.2.3",
Expand Down Expand Up @@ -107,7 +106,6 @@
"debug": "^4.3.1",
"https-proxy-agent": "5.0.1",
"nodemailer": "^6.9.1",
"qs": "^6.10.3",
"socks-proxy-agent": "^5.0.1"
},
"config": {
Expand Down
19 changes: 0 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/push/qmsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { ajax } from '@/utils/ajax'
const Debugger = debug('push:qmsg')

/**
* 推送类型,见 [Qmsg](https://qmsg.zendee.cn/api.html)。
* 推送类型,见 [Qmsg](https://qmsg.zendee.cn/docs)。
*/
export type QmsgPushType = 'send' | 'group'

/**
* Qmsg酱。使用说明见 [Qmsg酱](https://qmsg.zendee.cn/api.html)
* Qmsg酱。使用说明见 [Qmsg酱](https://qmsg.zendee.cn/docs)
*
* @author CaoMeiYouRen
* @date 2022-02-17
Expand Down
3 changes: 1 addition & 2 deletions src/utils/ajax.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import axios, { AxiosResponse, Method, AxiosRequestHeaders } from 'axios'
import qs from 'qs'
import debug from 'debug'
import HttpsProxyAgent from 'https-proxy-agent'
import SocksProxyAgent from 'socks-proxy-agent'
Expand Down Expand Up @@ -34,7 +33,7 @@ export async function ajax<T = any>(config: AjaxConfig): Promise<AxiosResponse<T
let { data = {} } = config

if (headers['Content-Type'] === 'application/x-www-form-urlencoded' && typeof data === 'object') {
data = qs.stringify(data)
data = new URLSearchParams(data as Record<string, string>).toString()
}

let httpAgent = null
Expand Down

0 comments on commit 447fe60

Please sign in to comment.