Open tc-imba opened 3 months ago
Related to #140
相同的openapi.json文件,新版本输出的request浏览器发送的contentType仍然错误
v1.9.1 浏览器发送 Content-Type: application/x-www-form-urlencoded 生成的是
Content-Type: application/x-www-form-urlencoded
/** Auth:Jwt.Login POST /api/v1/auth/jwt/login */ export async function authJwtLoginApiV1AuthJwtLoginPost( body: API.BodyAuthJwtLoginApiV1AuthJwtLoginPost, options?: { [key: string]: any }, ) { const formData = new FormData(); Object.keys(body).forEach((ele) => { const item = (body as any)[ele]; if (item !== undefined && item !== null) { if (typeof item === 'object' && !(item instanceof File)) { if (item instanceof Array) { item.forEach((f) => formData.append(ele, f || '')); } else { formData.append(ele, JSON.stringify(item)); } } else { formData.append(ele, item); } } }); return request<API.BearerResponse>('/api/v1/auth/jwt/login', { method: 'POST', data: formData, ...(options || {}), }); }
v1.11.1 浏览器发送 Content-Type: application/json 生成的是
Content-Type: application/json
/** Auth:Jwt.Login POST /api/v1/auth/jwt/login */ export async function authJwtLoginApiV1AuthJwtLoginPost( body: API.BodyAuthJwtLoginApiV1AuthJwtLoginPost, options?: { [key: string]: any }, ) { return request<API.BearerResponse>('/api/v1/auth/jwt/login', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, data: body, ...(options || {}), }); }
Related to #140
相同的openapi.json文件,新版本输出的request浏览器发送的contentType仍然错误
v1.9.1 浏览器发送
Content-Type: application/x-www-form-urlencoded
生成的是v1.11.1 浏览器发送
Content-Type: application/json
生成的是