diff --git a/mock/_util.ts b/mock/_util.ts index 97c87564fe3e0a6e7759b98f368dc15df6c7de78..324bdfb35af2e46c213c24615da510515643f74b 100644 --- a/mock/_util.ts +++ b/mock/_util.ts @@ -2,7 +2,7 @@ export function resultSuccess(result: T, { message = 'ok' } = {}) { return { - code: 0, + code: 200, result, message, type: 'success', diff --git a/package-lock.json b/package-lock.json index 05256302e0951e7605d533010868cb1c59d64af1..9df9e855616799d1fc5c4c91b783de32793c6dbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13716,12 +13716,6 @@ } } }, - "vite-plugin-monaco-editor-nls": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/vite-plugin-monaco-editor-nls/-/vite-plugin-monaco-editor-nls-1.0.8.tgz", - "integrity": "sha512-5mwbwrTYUPvhlWuZLUkFOEV7C9Q47gbtAghl3rKAkhs+Ed4n9Bo8rOK8vAID8ZBKO8eUhqiCypXKCNuoTHXyGQ==", - "dev": true - }, "vite-plugin-purge-icons": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/vite-plugin-purge-icons/-/vite-plugin-purge-icons-0.8.1.tgz", diff --git a/src/crud/core/init.ts b/src/crud/core/init.ts index 62f8448db6c6c1b4f8b6a5a99d67d256f80f021e..8776774e88007efe1665f0f68f421c9b5a102775 100644 --- a/src/crud/core/init.ts +++ b/src/crud/core/init.ts @@ -52,7 +52,7 @@ const CRUD = (options) => { detailAPI: null, }, /* 成功的状态码 */ - successResCode: [0], + successResCode: [200], /* 自定义属性 */ props: {}, }; diff --git a/src/enums/httpEnum.ts b/src/enums/httpEnum.ts index 61a944a1c401e7d544f5b5d7bc9235cb50ab43de..b48c5e599c0f0cddae49c8c277789b4c529f7c36 100644 --- a/src/enums/httpEnum.ts +++ b/src/enums/httpEnum.ts @@ -2,7 +2,7 @@ * @description: Request result set */ export enum ResultEnum { - SUCCESS = 0, + SUCCESS = 200, ERROR = 1, TIMEOUT = 401, TYPE = 'success', diff --git a/src/utils/http/axios/checkCodes.ts b/src/utils/http/axios/checkCodes.ts index 41578e74946aeef89a3d53678ae574023701baeb..d2e1a829084303a7411a84068e653d2850f85a89 100644 --- a/src/utils/http/axios/checkCodes.ts +++ b/src/utils/http/axios/checkCodes.ts @@ -25,11 +25,11 @@ export function checkCodes(code: number, msg: string, messageMode: ErrorMessageM let successMessage = ''; // 成功消息 switch (code) { - case 0: + case 200: successMessage = `${msg || '操作成功'}`; break; case 500: - errMessage = `${msg || '操作成功'}`; + errMessage = `${msg || '操作失败'}`; break; } diff --git a/src/views/tool/datasource/api/index.ts b/src/views/tool/datasource/api/index.ts index 4d8a31890d3a782fa73203efb7a8965469703973..542c44eb5213690d0790c48c7aaf41a23e6a9f4b 100644 --- a/src/views/tool/datasource/api/index.ts +++ b/src/views/tool/datasource/api/index.ts @@ -91,7 +91,7 @@ export function delAPI(params: delParamsInter) { export function testAPI(params: itemInter) { return defHttp.post( { - url: '/tool/db/test', + url: '/tool/db/edit/test', params, }, { diff --git a/src/views/tool/datasource/index.vue b/src/views/tool/datasource/index.vue index b24685f3ceda76f59617b6e93abc45c4fc461a96..5ab500dc9b8951fb126016f7ed0c67c10d41c6e1 100644 --- a/src/views/tool/datasource/index.vue +++ b/src/views/tool/datasource/index.vue @@ -5,9 +5,9 @@