mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-13 04:03:42 +08:00
feat(projects): 1.0 beta
This commit is contained in:
18
packages/request/package.json
Normal file
18
packages/request/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@sa/request",
|
||||
"version": "1.0.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./src/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "1.6.2",
|
||||
"ofetch": "1.3.3"
|
||||
}
|
||||
}
|
||||
10
packages/request/src/axios/index.ts
Normal file
10
packages/request/src/axios/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import axios from 'axios';
|
||||
import type { CreateAxiosDefaults } from 'axios';
|
||||
|
||||
export function createAxios(config?: CreateAxiosDefaults) {
|
||||
const instance = axios.create(config);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
export default createAxios;
|
||||
4
packages/request/src/index.ts
Normal file
4
packages/request/src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { createAxios } from './axios';
|
||||
import { createOfetch } from './ofetch';
|
||||
|
||||
export { createAxios, createOfetch };
|
||||
10
packages/request/src/ofetch/index.ts
Normal file
10
packages/request/src/ofetch/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ofetch } from 'ofetch';
|
||||
import type { FetchOptions } from 'ofetch';
|
||||
|
||||
export function createOfetch(options: FetchOptions) {
|
||||
const request = ofetch.create(options);
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
export default createOfetch;
|
||||
20
packages/request/tsconfig.json
Normal file
20
packages/request/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
"lib": ["DOM", "ESNext"],
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"noUnusedLocals": true,
|
||||
"strictNullChecks": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in New Issue
Block a user