feat: 接入ytt
This commit is contained in:
parent
e8f23283a2
commit
462067ca96
@ -39,15 +39,16 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^4.7.0",
|
"@ant-design/icons": "^4.7.0",
|
||||||
|
"@ant-design/pro-components": "^1.1.2",
|
||||||
"@ant-design/pro-layout": "^6.15.4",
|
"@ant-design/pro-layout": "^6.15.4",
|
||||||
"antd": "^4.20.6",
|
"antd": "^4.20.6",
|
||||||
"@ant-design/pro-components": "^1.1.2",
|
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"dayjs": "^1.11.2",
|
"dayjs": "^1.11.2",
|
||||||
"js-cookie": "^2.2.1",
|
"js-cookie": "^2.2.1",
|
||||||
"react": "^17.0.1",
|
"react": "^17.0.1",
|
||||||
"react-dom": "^17.0.1",
|
"react-dom": "^17.0.1",
|
||||||
"umi": "^3.5.15"
|
"umi": "^3.5.15",
|
||||||
|
"yapi-to-typescript": "^3.34.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nicecode/commit-lint": "^0.1.2",
|
"@nicecode/commit-lint": "^0.1.2",
|
||||||
|
36
ytt.config.ts
Normal file
36
ytt.config.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { defineConfig } from 'yapi-to-typescript'
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{
|
||||||
|
serverUrl: 'http://yapi.jzxer.cn',
|
||||||
|
typesOnly: false,
|
||||||
|
target: 'typescript',
|
||||||
|
reactHooks: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
prodEnvName: 'production',
|
||||||
|
outputFilePath: 'src/api/index.ts',
|
||||||
|
requestFunctionFilePath: 'src/utils/request.ts',
|
||||||
|
dataKey: 'data',
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
token: '',
|
||||||
|
categories: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
getRequestFunctionName(interfaceInfo, changeCase) {
|
||||||
|
// 以接口全路径生成请求函数名
|
||||||
|
return changeCase.camelCase(interfaceInfo.path)
|
||||||
|
|
||||||
|
// 若生成的请求函数名存在语法关键词报错、或想通过某个关键词触发 IDE 自动引入提示,可考虑加前缀,如:
|
||||||
|
// return changeCase.camelCase(`api_${interfaceInfo.path}`)
|
||||||
|
|
||||||
|
// 若生成的请求函数名有重复报错,可考虑将接口请求方式纳入生成条件,如:
|
||||||
|
// return changeCase.camelCase(`${interfaceInfo.method}_${interfaceInfo.path}`)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
])
|
Loading…
Reference in New Issue
Block a user