Skip to content

Commit

Permalink
fix: 修复 新版本的依赖和类型问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Mar 12, 2023
1 parent 0013733 commit 8ccc2ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build": "cross-env NODE_ENV=production rollup -c",
"postbuild": "npm run build:type",
"build:type": "api-extractor run",
"postbuild:type": "rimraf \"dist/**/!(*.js?(.map)|index.d.ts)\"",
"postbuild:type": "rimraf \"dist/**/!(*.?(c|m)js?(.map)|index.d.ts)\" --glob",
"analyzer": "cross-env NODE_ENV=production ANALYZER=true rollup -c",
"dev": "cross-env NODE_ENV=development ts-node-dev src/index.ts",
"dev:rollup": "cross-env NODE_ENV=development rollup -c",
Expand Down Expand Up @@ -82,8 +82,8 @@
"lodash": "^4.17.21",
"mocha": "^10.0.0",
"module-alias": "^2.2.2",
"rimraf": "^4.0.4",
"rollup": "^2.67.2",
"rimraf": "^4.4.0",
"rollup": "^2.79.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"semantic-release": "^20.0.2",
Expand Down Expand Up @@ -124,4 +124,4 @@
"git add"
]
}
}
}
5 changes: 3 additions & 2 deletions src/utils/ajax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AjaxConfig {
query?: Record<string, unknown>
data?: Record<string, unknown> | string | Buffer | ArrayBuffer
method?: Method
headers?: AxiosRequestHeaders
headers?: Record<string, unknown>
baseURL?: string
}

Expand All @@ -25,7 +25,8 @@ interface AjaxConfig {
export async function ajax(config: AjaxConfig): Promise<AxiosResponse<any>> {
try {
Debugger('ajax config: %O', config)
const { url, query = {}, method = 'GET', headers = {}, baseURL = '' } = config
const { url, query = {}, method = 'GET', baseURL = '' } = config
const headers = (config.headers || {}) as AxiosRequestHeaders
let { data = {} } = config

if (headers['Content-Type'] === 'application/x-www-form-urlencoded' && typeof data === 'object') {
Expand Down

0 comments on commit 8ccc2ce

Please sign in to comment.