From e30d7757c45afd5405f4150ef41c003bc573b7aa Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 6 Sep 2023 11:33:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=BF=E6=8D=A2=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dict/data.ts | 12 ++++++------ src/api/system/dict/type.ts | 14 +++++++------- src/store/modules/dict.ts | 2 +- src/views/system/dict/data.vue | 14 +++++++------- src/views/system/dict/index.vue | 14 +++++++------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/api/system/dict/data.ts b/src/api/system/dict/data.ts index f4fc8df4..8a0dc229 100644 --- a/src/api/system/dict/data.ts +++ b/src/api/system/dict/data.ts @@ -21,7 +21,7 @@ export function exportData(query: Record) { */ export function listData(query: Record) { return request({ - url: '/system/dict/data/list', + url: '/dictDataManage/v1/dictDatas', method: 'get', params: query, }); @@ -34,7 +34,7 @@ export function listData(query: Record) { */ export function getData(dictCode: string | number) { return request({ - url: `/system/dict/data/${dictCode}`, + url: `/dictDataManage/v1/dictData/${dictCode}`, method: 'get', }); } @@ -46,7 +46,7 @@ export function getData(dictCode: string | number) { */ export function addData(data: Record) { return request({ - url: '/system/dict/data', + url: '/dictDataManage/v1/dictData', method: 'post', data: data, }); @@ -59,7 +59,7 @@ export function addData(data: Record) { */ export function updateData(data: Record) { return request({ - url: '/system/dict/data', + url: '/dictDataManage/v1/dictData', method: 'put', data: data, }); @@ -72,7 +72,7 @@ export function updateData(data: Record) { */ export function delData(dictCode: string | number) { return request({ - url: `/system/dict/data/${dictCode}`, + url: `/dictDataManage/v1/dictData/${dictCode}`, method: 'delete', }); } @@ -84,7 +84,7 @@ export function delData(dictCode: string | number) { */ export function getDictDataType(dictType: string) { return request({ - url: `/system/dict/data/type/${dictType}`, + url: `/dictDataManage/v1/dictData/type/${dictType}`, method: 'get', }); } diff --git a/src/api/system/dict/type.ts b/src/api/system/dict/type.ts index 040b0329..83857f10 100644 --- a/src/api/system/dict/type.ts +++ b/src/api/system/dict/type.ts @@ -21,7 +21,7 @@ export function exportType(query: Record) { */ export function listType(query: Record) { return request({ - url: '/system/dict/type/list', + url: '/dictTypegManage/v1/dictTypes', method: 'get', params: query, }); @@ -34,7 +34,7 @@ export function listType(query: Record) { */ export function getType(dictId: string | number) { return request({ - url: `/system/dict/type/${dictId}`, + url: `/dictTypegManage/v1/dictType/${dictId}`, method: 'get', }); } @@ -46,7 +46,7 @@ export function getType(dictId: string | number) { */ export function addType(data: Record) { return request({ - url: '/system/dict/type', + url: '/dictTypegManage/v1/dictType', method: 'post', data: data, }); @@ -59,7 +59,7 @@ export function addType(data: Record) { */ export function updateType(data: Record) { return request({ - url: '/system/dict/type', + url: '/dictTypegManage/v1/dictType', method: 'put', data: data, }); @@ -72,7 +72,7 @@ export function updateType(data: Record) { */ export function delType(dictId: string | number) { return request({ - url: `/system/dict/type/${dictId}`, + url: `/dictTypegManage/v1/dictType/${dictId}`, method: 'delete', }); } @@ -84,7 +84,7 @@ export function delType(dictId: string | number) { */ export function refreshCache() { return request({ - url: '/system/dict/type/refreshCache', + url: '/dictTypegManage/v1/dictType/refreshCache', method: 'put', }); } @@ -96,7 +96,7 @@ export function refreshCache() { */ export function getDictOptionselect() { return request({ - url: '/system/dict/type/getDictOptionselect', + url: '/dictTypegManage/v1/dictTypes/optionselect', method: 'get', }); } diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index ec183b09..fb0c8259 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -42,7 +42,7 @@ const useDictStore = defineStore('dict', { let disct = this.dicts.get(key); if (disct === undefined || disct.length === 0) { const res = await getDictDataType(key); - if (res.code === 200 && Array.isArray(res.data)) { + if (res.code === 1 && Array.isArray(res.data)) { const dictData: DictType[] = res.data.map(d => ({ label: d.dictLabel, value: d.dictValue, diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 4085c4e7..c15bfbfb 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -286,7 +286,7 @@ function fnModalVisibleByEdit(dictCode?: string | number) { getData(dictCode).then(res => { modalState.confirmLoading = false; hide(); - if (res.code === 200) { + if (res.code === 1) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = '修改字典数据'; modalState.visibleByEdit = true; @@ -312,7 +312,7 @@ function fnModalOk() { message.loading({ content: '请稍等...', key }); dictData .then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `${modalState.title}成功`, key, @@ -363,7 +363,7 @@ function fnRecordDelete(dictCode: string = '0') { const key = 'delData'; message.loading({ content: '请稍等...', key }); delData(dictCode).then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `删除成功`, key, @@ -391,7 +391,7 @@ function fnExportList() { const key = 'exportData'; message.loading({ content: '请稍等...', key }); exportData(toRaw(queryParams)).then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `已完成导出`, key, @@ -425,7 +425,7 @@ function fnGetList() { if (tableState.loading) return; tableState.loading = true; listData(toRaw(queryParams)).then(res => { - if (res.code === 200 && Array.isArray(res.rows)) { + if (res.code === 1 && Array.isArray(res.rows)) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; @@ -448,7 +448,7 @@ onMounted(() => { } if (resArr[1].status === 'fulfilled') { const dicts = resArr[1].value; - if (dicts.code === 200) { + if (dicts.code === 1) { dict.sysDictType = dicts.data; } } @@ -456,7 +456,7 @@ onMounted(() => { // 指定字典id列表数据 if (dictId && dictId !== '0') { getType(dictId).then(res => { - if (res.code === 200 && res.data) { + if (res.code === 1 && res.data) { queryParams.dictType = res.data.dictType; fnGetList(); } else { diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index a895ba30..74d085e4 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -237,7 +237,7 @@ function fnModalVisibleByVive(dictId: string | number) { getType(dictId).then(res => { modalState.confirmLoading = false; hide(); - if (res.code === 200 && res.data) { + if (res.code === 1 && res.data) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = '字典类型信息'; modalState.visibleByView = true; @@ -263,7 +263,7 @@ function fnModalVisibleByEdit(dictId?: string | number) { getType(dictId).then(res => { modalState.confirmLoading = false; hide(); - if (res.code === 200 && res.data) { + if (res.code === 1 && res.data) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = '修改字典类型'; modalState.visibleByEdit = true; @@ -289,7 +289,7 @@ function fnModalOk() { message.loading({ content: '请稍等...', key }); dictType .then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `${modalState.title}成功`, key, @@ -340,7 +340,7 @@ function fnRecordDelete(dictId: string = '0') { const key = 'delType'; message.loading({ content: '请稍等...', key }); delType(dictId).then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `删除成功`, key, @@ -368,7 +368,7 @@ function fnExportList() { const key = 'exportType'; message.loading({ content: '请稍等...', key }); exportType(toRaw(queryParams)).then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `已完成导出`, key, @@ -398,7 +398,7 @@ function fnRefreshCache() { const key = 'refreshCache'; message.loading({ content: '请稍等...', key }); refreshCache().then(res => { - if (res.code === 200) { + if (res.code === 1) { message.success({ content: `刷新缓存成功`, key, @@ -428,7 +428,7 @@ function fnGetList() { queryParams.beginTime = queryRangePicker.value[0]; queryParams.endTime = queryRangePicker.value[1]; listType(toRaw(queryParams)).then(res => { - if (res.code === 200 && Array.isArray(res.rows)) { + if (res.code === 1 && Array.isArray(res.rows)) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = [];