sy-api-pro 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,12 +1,13 @@
1
- var M=(b,j,f)=>new Promise((S,x)=>{var c=h=>{try{n(f.next(h))}catch(I){x(I)}},l=h=>{try{n(f.throw(h))}catch(I){x(I)}},n=h=>h.done?S(h.value):Promise.resolve(h.value).then(c,l);n((f=f.apply(b,j)).next())});(function(b,j){typeof exports=="object"&&typeof module!="undefined"?j(require("axios")):typeof define=="function"&&define.amd?define(["axios"],j):j((b=typeof globalThis!="undefined"?globalThis:b||self).axios)})(this,function(b){"use strict";function j(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var f=j(b);const S=e=>{var o;const r=(e||"").toLowerCase(),d={int:"number",integer:"number",long:"number",bigdecimal:"number",float:"number",double:"number",localdatetime:"string",date:"string",char:"string",byte:"string",short:"string",character:"string",string:"string",multipartfile:"string",boolean:"boolean",void:"void"},{listType:s}=((o=/^list<(?<listType>.+)>$/.exec(r))==null?void 0:o.groups)||{};return s?`Array<${d[s]||"any"}>`:d[r]||"any"},x=Object.freeze({_getDesc(e){const r=(e.title||"").trim();return r?` // ${r}`:""},getInterface:function({list:e,config:{ignoreParamsDTO:r,deleteParentDTO:d}}){const s=e.filter(o=>!o.id);return e.filter(o=>o.id&&!r.includes(o.type)).map(o=>{if(o.id&&o.json){const t=o.json.split(`
2
- `);return t.forEach((a,i)=>{var $;const u=/(?<space>\s*)"(?<name>[a-zA-Z0-9]+)"\s?:\s*"(?<desc>.*)".*$/;if(u.test(a)){const{space:w,name:P,desc:p}=(($=u.exec(a))==null?void 0:$.groups)||{},y=(P||"").trim(),g=(p||"").trim(),q=s.filter(B=>(B.name||"").trim()+(B.title||"").trim()===y+g);if(q.length>=1){const[{type:B}]=q,A=o.required?"?":"";t[i]=a.replace(u,`${w+P+A}: ${S(B)};${g?` // ${g}`:""}`)}}/\s*"[a-zA-Z0-9]+"\s*:\s*.+$/.test(a)&&(t[i]=t[i].replace(/(\s*)"([a-zA-Z0-9]+)"\s?(:\s*.+)$/,"$1$2$3")),t[i]=t[i].replace(/(.*)\[\s+{$/,"$1Array<{").replace(/(.*)}\s*].*$/,"$1}>")}),d.some(a=>{const i=Object.prototype.toString.call(a);return i==="[object RegExp]"?a.test(o.type):i==="[object String]"?a===o.type:void 0})?t.slice(1,-1).join(`
3
- `):[` ${o.name}${o.required?"":"?"}: {${this._getDesc(o)}`,...t.slice(1,-1).map(a=>` ${a}`)," }"].join(`
4
- `)}return` ${o.name}${o.required?"":"?"}: ${S(o.type)};${this._getDesc(o)}`})}}),c=require("fs"),l=require("path"),n=require("chalk");f.default.interceptors.response.use(e=>{var r,d;return((d=(r=e.data)==null?void 0:r.head)==null?void 0:d.successful)?e:Promise.reject(e)},e=>{throw e});const h=require("path"),{program:I}=require("commander"),D=require("chalk");I.version(require(h.resolve(__dirname,"../package.json")).version).requiredOption("-i, --id <id>","methodId").option("-n, --name <name>","customMethodName").requiredOption("--config <filePath>","configFilePath").requiredOption("--project-id <id>","projectId").parse();const{id:O,name:N,config:R,projectId:v}=I.opts();if(!O||!/^\d+$/.test(O))throw D.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 id");const F=require(h.resolve(process.cwd(),R)),m=(F.projects||[]).find(e=>+e.projectId==+v);if(m){if(!m.branchId)throw D.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 branchId");if(!F.api)throw D.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 api");new class{constructor(e){this.config={api:"",creatBaseFile:!0,customMethodName:"",projectId:void 0,branchId:void 0,methodId:void 0,outputPath:"",outputDirName:"",apiBaseName:"",ignoreParamsDTO:[],deleteParentDTO:[]},this.apiList=[],this.enums=[],Object.assign(this.config,e),this.getApiData()}getApiData(){return M(this,null,function*(){const{api:e,branchId:r,projectId:d,outputDirName:s,outputPath:o,methodId:t,creatBaseFile:a}=this.config;try{const{data:i}=yield f.default.get(`${e}/api/project/getProjectWithBranchById?id=${d}`);this.config.outputPath=l.join(process.cwd(),o,s||i.body.name);const u=i.body.branchList.find(w=>w.id===r);if(!u)throw n.red(`\u3010error\u3011branchId ${r} \u4E0D\u5B58\u5728`);console.log(n.blueBright(`\u3010info\u3011\u6B63\u5728\u4F7F\u7528 branchName: ${u.name} branchId: ${r} methodId: ${t}`));const $=yield f.default.get(`${e}/api/method/getMethodById?id=${t}`);this.apiList=[$.data.body]}catch(i){return console.log(n.red("\u3010error\u3011: \u63A5\u53E3\u83B7\u53D6\u5F02\u5E38")),void console.log(i)}try{yield this.checkApiOutputDir()}catch(i){return console.log(n.red("\u3010error\u3011: \u68C0\u67E5\u8F93\u51FA\u76EE\u5F55\u5F02\u5E38")),void console.log(i)}a&&(yield this.creatBaseFile());try{yield this.createFile()}catch(i){console.log(n.red("\u3010error\u3011: createFile \u5F02\u5E38")),console.log(i)}})}checkApiOutputDir(){const{outputPath:e}=this.config;console.log(n.blueBright(`\u3010info\u3011\u8F93\u51FA\u76EE\u5F55 ${e}`));try{c.statSync(e,{bigint:!0})}catch(r){c.mkdirSync(e,{recursive:!0})}}creatBaseFile(){return M(this,null,function*(){const{outputPath:e}=this.config,r=l.join(__dirname,"../template"),d=c.readdirSync(r),s=c.readdirSync(e);for(const o of d)if(!s.includes(o))try{const t=c.readFileSync(l.join(r,o));c.writeFileSync(l.join(e,o),t)}catch(t){console.log(n.red("\u3010error\u3011: \u57FA\u7840\u6587\u4EF6\u751F\u6210\u5F02\u5E38")),console.log(t)}})}createFile(){return M(this,null,function*(){const{apiBaseName:e,outputPath:r,customMethodName:d}=this.config;this.apiList.forEach(s=>{var P;const o=p=>p.replace(/(-[a-z])|(^[a-z])/g,y=>y.replace("-","").toLocaleUpperCase()),t=s.path.replace(e,"").split("/")[1],a=d||s.name,i=o(`${t}-`+a);try{c.statSync(l.join(r,t)).isDirectory()}catch(p){c.mkdirSync(l.join(r,t))}const u=(P=s.paramList)==null?void 0:P.length;let $=[];try{$=["/**************************************************/",...u?[`/** ${s.title} RequestModel */`,`export interface ${i}ReqModel {`,...x.getInterface({list:s.paramList||[],config:this.config}),"}",""]:[],`/** ${s.title} ResponseModel */`,`export interface ${i}ResModel {`,...x.getInterface({list:s.returnList||[],config:this.config}),"}",""]}catch(p){throw console.log(n.red(`\u3010error\u3011\u7C7B\u578B\u751F\u6210\u5931\u8D25 projectId: ${this.config.projectId} methodId: ${s.id} path: ${s.path}`)),n.red(p)}try{c.readFileSync(l.join(r,t,"models.ts")).toString().includes(`export interface ${i}ReqModel {`)?console.log(n.yellowBright(`\u3010warning\u3011./${t}/models.ts \u5DF2\u5B58\u5728 ${i}ReqModel`)):(c.appendFileSync(l.join(r,`./${t}/models.ts`),[""].concat($).join(`
5
- `)),console.log(n.greenBright(`\u3010success\u3011./${t}/models.ts \u6210\u529F\u6DFB\u52A0 ${i}ReqModel`)))}catch(p){c.writeFileSync(l.join(r,`./${t}/models.ts`),$.join(`
6
- `)),console.log(n.greenBright(`\u3010success\u3011./${t}/models.ts \u6210\u529F\u6DFB\u52A0 ${i}ReqModel`))}const w=[` /** ${s.title} */`,` ${a}(${u?`params: M.${i}ReqModel`:""}) {`,` return axios.${s.method.toLowerCase()}<ApiResponse<M.${i}ResModel>>(`,` \`\${ApiPrefix}/${s.path}\`,`,u&&` ${["post","put","patch"].includes(s.method.toLowerCase())?"params":"{ params }"},`," );"," },"].filter(Boolean);/^[a-zA-Z]+$/.test((s.method||"").trim())||console.log(n.yellowBright(`\u3010warning\u3011\u63A5\u53E3\u8BF7\u6C42\u7C7B\u578B\u5F02\u5E38\uFF0C\u8BF7\u624B\u52A8\u8865\u5168 method\uFF1A${s.method} path: ${s.path} methodId: ${this.config.methodId} projectId: ${this.config.projectId}`));try{const p=c.readFileSync(l.join(r,t,"api.ts")).toString();if(p.includes(` ${a}(`))console.log(n.yellowBright(`\u3010warning\u3011./${t}/api.ts \u5DF2\u5B58\u5728 ${a}`));else{const y=p.split(`
7
- `);y.splice(y.map(g=>g.includes("}")).lastIndexOf(!0),0,w.join(`
8
- `)),c.writeFileSync(l.join(r,`./${t}/api.ts`),y.join(`
9
- `)),console.log(n.greenBright(`\u3010success\u3011./${t}/api.ts \u6210\u529F\u6DFB\u52A0 ${a}`))}}catch(y){c.writeFileSync(l.join(r,`./${t}/api.ts`),["import axios from 'axios';","","import * as M from './models';","import { ApiResponse } from '../responseModel';","import { ApiPrefix } from '../apiPrefix';","","export * from './models';","",`export const ${o(t)}Api = {`,...w,"};"].join(`
10
- `)),console.log(n.greenBright(`\u3010success\u3011./${t}/api.ts \u6210\u529F\u6DFB\u52A0 ${a}`));const p=c.readFileSync(l.join(r,"index.ts")).toString();if(!p.includes(`export * from './${t}/api'`)){const g=p.split(`
11
- `);g.push(`export * from './${t}/api';`);const q=g.slice(1).filter(Boolean);q.sort((B,A)=>B.localeCompare(A)),c.writeFileSync(l.join(r,"index.ts"),[g[0]||"","",...q,""].join(`
12
- `))}}})})}}({api:F.api,creatBaseFile:m.creatBaseFile||!0,methodId:O,customMethodName:N,outputPath:F.outputPath||"./src/apis",projectId:m.projectId,branchId:+m.branchId,outputDirName:m.outputDirName||"",apiBaseName:m.apiBaseName||"",ignoreParamsDTO:m.ignoreParamsDTO||[],deleteParentDTO:m.deleteParentDTO||[]})}else console.log(D.red(`\u3010error\u3011config \u914D\u7F6E\u6587\u4EF6\u4E2D projects \u672A\u5305\u542B\u4F20\u5165\u7684 projectId ${v}`))});
1
+ var R=(j,y,m)=>new Promise((D,B)=>{var a=g=>{try{n(m.next(g))}catch(b){B(b)}},d=g=>{try{n(m.throw(g))}catch(b){B(b)}},n=g=>g.done?D(g.value):Promise.resolve(g.value).then(a,d);n((m=m.apply(j,y)).next())});(function(j,y){typeof exports=="object"&&typeof module!="undefined"?y(require("axios")):typeof define=="function"&&define.amd?define(["axios"],y):y((j=typeof globalThis!="undefined"?globalThis:j||self).axios)})(this,function(j){"use strict";function y(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var m=y(j);const D=e=>{var r;const o=(e||"").toLowerCase(),h={int:"number",integer:"number",long:"number",bigdecimal:"number",float:"number",double:"number",localdatetime:"string",date:"string",char:"string",byte:"string",short:"string",character:"string",string:"string",multipartfile:"string",boolean:"boolean",void:"void"},{listType:i}=((r=/^list<(?<listType>.+)>$/.exec(o))==null?void 0:r.groups)||{};return i?`Array<${h[i]||"any"}>`:h[o]||"any"},B=Object.freeze({_getDesc(e){const o=(e.title||"").trim();return o?` // ${o}`:""},getInterface:function({list:e,config:{ignoreParamsDTO:o,deleteParentDTO:h}}){const i=e.filter(r=>!r.id);return e.filter(r=>r.id&&!o.includes(r.type)).map(r=>{if(r.id&&r.json){const p=r.json.split(`
2
+ `);return p.forEach((t,s)=>{var f;const l=/(?<space>\s*)"(?<name>[a-zA-Z0-9]+)"\s?:\s*"(?<desc>.*)".*$/;if(l.test(t)){const{space:I,name:w,desc:F}=((f=l.exec(t))==null?void 0:f.groups)||{},O=(w||"").trim(),x=(F||"").trim(),P=i.filter(c=>(c.name||"").trim()+(c.title||"").trim()===O+x);if(P.length>=1){const[{type:c}]=P,$=r.required?"?":"";p[s]=t.replace(l,`${I+w+$}: ${D(c)};${x?` // ${x}`:""}`)}}/\s*"[a-zA-Z0-9]+"\s*:\s*.+$/.test(t)&&(p[s]=p[s].replace(/(\s*)"([a-zA-Z0-9]+)"\s?(:\s*.+)$/,"$1$2$3")),p[s]=p[s].replace(/(.*)\[\s+{$/,"$1Array<{").replace(/(.*)}\s*].*$/,"$1}>")}),h.some(t=>{const s=Object.prototype.toString.call(t);return s==="[object RegExp]"?t.test(r.type):s==="[object String]"?t===r.type:void 0})?p.slice(1,-1).join(`
3
+ `):[` ${r.name}${r.required?"":"?"}: {${this._getDesc(r)}`,...p.slice(1,-1).map(t=>` ${t}`)," }"].join(`
4
+ `)}return` ${r.name}${r.required?"":"?"}: ${D(r.type)};${this._getDesc(r)}`})}}),a=require("fs"),d=require("path"),n=require("chalk");m.default.interceptors.response.use(e=>{var o,h;return((h=(o=e.data)==null?void 0:o.head)==null?void 0:h.successful)?e:Promise.reject(e)},e=>{throw e});const g=require("path"),{program:b}=require("commander"),M=require("chalk");b.version(require(g.resolve(__dirname,"../package.json")).version).requiredOption("-i, --id <id>","methodId").option("-n, --name <name>","customMethodName").requiredOption("--config <filePath>","configFilePath").requiredOption("--project-id <id>","projectId").parse();const{id:A,name:L,config:T,projectId:N}=b.opts();if(!A||!/^\d+$/.test(A))throw M.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 id");const S=require(g.resolve(process.cwd(),T)),u=(S.projects||[]).find(e=>+e.projectId==+N);if(u){if(!u.branchId)throw M.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 branchId");if(!S.api)throw M.red("\u3010error\u3011\u8BF7\u4F20\u5165\u6B63\u786E\u7684 api");new class{constructor(e){this.config={api:"",creatBaseFile:!0,customMethodName:"",projectId:void 0,branchId:void 0,methodId:void 0,outputPath:"",outputDirName:"",apiBaseName:"",ignoreParamsDTO:[],deleteParentDTO:[]},this.apiList=[],this.enums=[],Object.assign(this.config,e),this.getApiData()}getApiData(){return R(this,null,function*(){const{api:e,branchId:o,projectId:h,outputDirName:i,outputPath:r,methodId:p,creatBaseFile:t}=this.config;try{const{data:s}=yield m.default.get(`${e}/api/project/getProjectWithBranchById?id=${h}`);this.config.outputPath=d.join(process.cwd(),r,i||s.body.name);const l=s.body.branchList.find(I=>I.id===o);if(!l)throw n.red(`\u3010error\u3011branchId ${o} \u4E0D\u5B58\u5728`);console.log(n.blueBright(`\u3010info\u3011\u6B63\u5728\u4F7F\u7528 branchName: ${l.name} branchId: ${o} methodId: ${p}`));const f=yield m.default.get(`${e}/api/method/getMethodById?id=${p}`);this.apiList=[f.data.body]}catch(s){return console.log(n.red("\u3010error\u3011: \u63A5\u53E3\u83B7\u53D6\u5F02\u5E38")),void console.log(s)}try{yield this.checkApiOutputDir()}catch(s){return console.log(n.red("\u3010error\u3011: \u68C0\u67E5\u8F93\u51FA\u76EE\u5F55\u5F02\u5E38")),void console.log(s)}t&&(yield this.creatBaseFile());try{yield this.createFile()}catch(s){console.log(n.red("\u3010error\u3011: createFile \u5F02\u5E38")),console.log(s)}})}checkApiOutputDir(){const{outputPath:e}=this.config;console.log(n.blueBright(`\u3010info\u3011\u8F93\u51FA\u76EE\u5F55 ${e}`));try{a.statSync(e,{bigint:!0})}catch(o){a.mkdirSync(e,{recursive:!0})}}creatBaseFile(){return R(this,null,function*(){const{outputPath:e}=this.config,o=d.join(__dirname,"../template"),h=a.readdirSync(o),i=a.readdirSync(e);for(const r of h)if(!i.includes(r))try{const p=a.readFileSync(d.join(o,r));a.writeFileSync(d.join(e,r),p)}catch(p){console.log(n.red("\u3010error\u3011: \u57FA\u7840\u6587\u4EF6\u751F\u6210\u5F02\u5E38")),console.log(p)}})}createFile(){return R(this,null,function*(){const{apiBaseName:e,outputPath:o,customMethodName:h}=this.config;this.apiList.forEach(i=>{var O,x,P;const r=c=>c.replace(/(-[a-z])|(^[a-z])/g,$=>$.replace("-","").toLocaleUpperCase()),p=new RegExp(`(${e})?(/)?(?<apiDirName>[a-zA-Z0-9_]+)/.*$`),{apiDirName:t}=((O=p.exec(i.path))==null?void 0:O.groups)||{},s=h||i.name,l=r(`${t}-`+s);try{a.statSync(d.join(o,t)).isDirectory()}catch(c){a.mkdirSync(d.join(o,t))}const f=(x=i.paramList)==null?void 0:x.length;let I=[],w=[];try{I=["/**************************************************/",...f?[`/** ${i.title} RequestModel */`,`export interface ${l}ReqModel {`,...B.getInterface({list:i.paramList||[],config:this.config}),"}",""]:[],""],w=[...((P=i.returnList)==null?void 0:P.length)?[`/** ${i.title} ResponseModel */`,`export interface ${l}ResModel {`,...B.getInterface({list:i.returnList||[],config:this.config}),"}"]:[],""]}catch(c){throw console.log(n.red(`\u3010error\u3011\u7C7B\u578B\u751F\u6210\u5931\u8D25 projectId: ${this.config.projectId} methodId: ${i.id} path: ${i.path}`)),n.red(c)}try{const c=a.readFileSync(d.join(o,t,"models.ts")).toString();c.includes(`export interface ${l}ReqModel {`)?console.log(n.yellowBright(`\u3010warning\u3011./${t}/models.ts \u5DF2\u5B58\u5728 ${l}ReqModel`)):(a.appendFileSync(d.join(o,`./${t}/models.ts`),[""].concat(I).join(`
5
+ `)),console.log(n.greenBright(`\u3010success\u3011./${t}/models.ts \u6210\u529F\u6DFB\u52A0 ${l}ReqModel`))),c.includes(`export interface ${l}ResModel {`)?console.log(n.yellowBright(`\u3010warning\u3011./${t}/models.ts \u5DF2\u5B58\u5728 ${l}ResModel`)):(a.appendFileSync(d.join(o,`./${t}/models.ts`),[""].concat(w).join(`
6
+ `)),console.log(n.greenBright(`\u3010success\u3011./${t}/models.ts \u6210\u529F\u6DFB\u52A0 ${l}ResModel`)))}catch(c){a.writeFileSync(d.join(o,`./${t}/models.ts`),w.join(`
7
+ `)),console.log(n.greenBright(`\u3010success\u3011./${t}/models.ts \u6210\u529F\u6DFB\u52A0 ${l}ReqModel`))}const F=[i.title&&` /** ${i.title} */`,` ${s}(${f?`params: M.${l}ReqModel`:""}) {`,` return axios.${i.method.toLowerCase()}<ApiResponse<M.${l}ResModel>>(`,` \`\${ApiPrefix}/${i.path}\`,`,f&&` ${["post","put","patch"].includes(i.method.toLowerCase())?"params":"{ params }"},`," );"," },"].filter(Boolean);/^[a-zA-Z]+$/.test((i.method||"").trim())||console.log(n.yellowBright(`\u3010warning\u3011\u63A5\u53E3\u8BF7\u6C42\u7C7B\u578B\u5F02\u5E38\uFF0C\u8BF7\u624B\u52A8\u8865\u5168 method\uFF1A${i.method} path: ${i.path} methodId: ${this.config.methodId} projectId: ${this.config.projectId}`));try{const c=a.readFileSync(d.join(o,t,"api.ts")).toString();if(c.includes(` ${s}(`))console.log(n.yellowBright(`\u3010warning\u3011./${t}/api.ts \u5DF2\u5B58\u5728 ${s}`));else{const $=c.split(`
8
+ `);$.splice($.map(q=>q.includes("}")).lastIndexOf(!0),0,F.join(`
9
+ `)),a.writeFileSync(d.join(o,`./${t}/api.ts`),$.join(`
10
+ `)),console.log(n.greenBright(`\u3010success\u3011./${t}/api.ts \u6210\u529F\u6DFB\u52A0 ${s}`))}}catch($){a.writeFileSync(d.join(o,`./${t}/api.ts`),["import axios from 'axios';","","import * as M from './models';","import { ApiResponse } from '../responseModel';","import { ApiPrefix } from '../apiPrefix';","","export * from './models';","",`export const ${r(t)}Api = {`,...F,"};",""].join(`
11
+ `)),console.log(n.greenBright(`\u3010success\u3011./${t}/api.ts \u6210\u529F\u6DFB\u52A0 ${s}`));const c=a.readFileSync(d.join(o,"index.ts")).toString();if(!c.includes(`export * from './${t}/api'`)){const q=c.split(`
12
+ `);q.push(`export * from './${t}/api';`);const v=q.slice(1).filter(Boolean);v.sort((z,_)=>z.localeCompare(_)),a.writeFileSync(d.join(o,"index.ts"),[q[0]||"","",...v,""].join(`
13
+ `))}}})})}}({api:S.api,creatBaseFile:u.creatBaseFile||!0,methodId:A,customMethodName:L,outputPath:S.outputPath||"./src/apis",projectId:u.projectId,branchId:+u.branchId,outputDirName:u.outputDirName||"",apiBaseName:u.apiBaseName||"",ignoreParamsDTO:u.ignoreParamsDTO||[],deleteParentDTO:u.deleteParentDTO||[]})}else console.log(M.red(`\u3010error\u3011config \u914D\u7F6E\u6587\u4EF6\u4E2D projects \u672A\u5305\u542B\u4F20\u5165\u7684 projectId ${N}`))});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sy-api-pro",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "main": "./bin/index.ts",
5
5
  "types": "./bin/model.d.ts",
6
6
  "bin": {
@@ -2,9 +2,12 @@ import axios, { AxiosResponse } from 'axios';
2
2
 
3
3
  import { ApiPrefix } from './apiPrefix';
4
4
 
5
- axios.interceptors.request.use(config => config, error => Promise.reject(error));
5
+ axios.interceptors.request.use(config => {
6
+ return config;
7
+ }, error => Promise.reject(error));
8
+
6
9
  axios.interceptors.response.use((response: AxiosResponse) => {
7
- if (!response.config.url?.startsWith(ApiPrefix)) return;
10
+ if (!response.config.url?.startsWith(ApiPrefix)) return response;
8
11
  //
9
12
  // if (response.data?.success) {
10
13
  // return response;