diff --git a/.env.development b/.env.development index fe6f9b3..fd4f4ae 100644 --- a/.env.development +++ b/.env.development @@ -12,7 +12,7 @@ ENV = 'development' # 主服务地址(端口8808) # 用途: 系统管理、用户认证、权限控制、模块开通等原有功能 -VITE_API_URL = 'http://192.168.100.162:8808/' +VITE_API_URL = 'http://192.168.3.11:8808/' # 新功能服务地址(端口8000) # 用途: 资产管理、分类、SKU、订单等新业务模块 -VITE_NEW_API_URL = 'http://192.168.100.162:8000/' +VITE_NEW_API_URL = 'http://192.168.3.11:8000/' diff --git a/src/api/assets/category/index.ts b/src/api/assets/category/index.ts index 40c70ca..357785d 100644 --- a/src/api/assets/category/index.ts +++ b/src/api/assets/category/index.ts @@ -12,11 +12,11 @@ export function getCategoryTree(query?: Object) { } // 获取分类详情 -export function getCategory(id: number) { +export function getCategory(id: number | string) { return newService({ url: '/assets/category/getCategory', method: 'get', - params: { id }, + params: { id: id.toString() }, }); } @@ -56,19 +56,19 @@ export function updateCategory(data: object) { } // 删除分类 -export function deleteCategory(id: number) { +export function deleteCategory(id: number | string) { return newService({ url: '/assets/category/deleteCategory', method: 'delete', - params: { id }, + params: { id: id.toString() }, }); } // 更新分类状态 -export function updateCategoryStatus(id: number, status: number) { +export function updateCategoryStatus(id: number | string, status: number) { return newService({ url: '/assets/category/updateCategoryStatus', method: 'put', - data: { id, status }, + data: { id: id.toString(), status }, }); } diff --git a/src/api/system/config/index.ts b/src/api/system/config/index.ts index c3824c6..fe0ff2a 100644 --- a/src/api/system/config/index.ts +++ b/src/api/system/config/index.ts @@ -9,7 +9,7 @@ export function getConfigList(query:Object) { }) } -export function getConfig(id:number) { +export function getConfig(id:string) { return request({ url: '/api/v1/system/config/get', method: 'get', @@ -33,7 +33,7 @@ export function editConfig(data:any) { }) } -export function deleteConfig(ids:number[]) { +export function deleteConfig(ids:string[]) { return request({ url: '/api/v1/system/config/delete', method: 'delete', diff --git a/src/api/system/monitor/userOnline/index.ts b/src/api/system/monitor/userOnline/index.ts index ed49e1b..bbef96d 100644 --- a/src/api/system/monitor/userOnline/index.ts +++ b/src/api/system/monitor/userOnline/index.ts @@ -9,7 +9,7 @@ export function listSysUserOnline(query:object) { }) } -export function forceLogout(ids:number[]) { +export function forceLogout(ids:string[]) { return request({ url: '/api/v1/system/online/forceLogout', method: 'delete', diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts index f72ed10..46cdcf8 100644 --- a/src/api/system/role/index.ts +++ b/src/api/system/role/index.ts @@ -23,7 +23,7 @@ export function addRole(data:object) { }) } -export function getRole(id:number) { +export function getRole(id:string) { return request({ url: '/api/v1/system/role/get', method: 'get', @@ -41,7 +41,7 @@ export function editRole(data:object) { } -export function deleteRole(id:number) { +export function deleteRole(id:string) { return request({ url: '/api/v1/system/role/delete', method: 'delete', @@ -59,7 +59,7 @@ export function dataScope(data:any) { // 根据角色ID查询部门树结构 -export function roleDeptTreeSelect(roleId:number) { +export function roleDeptTreeSelect(roleId:string) { return request({ url: '/api/v1/system/role/deptTreeSelect', method: 'get', diff --git a/src/views/assets/category/component/editCategory.vue b/src/views/assets/category/component/editCategory.vue index 3eb48a4..9c9c4a3 100644 --- a/src/views/assets/category/component/editCategory.vue +++ b/src/views/assets/category/component/editCategory.vue @@ -129,7 +129,7 @@ import { getDicts } from '/@/api/system/dict/data'; import { createFormDiff } from '/@/utils/diffUtils'; interface CategoryRow { - id: number; + id: string; name: string; level: number; options?: string[]; @@ -163,7 +163,7 @@ interface DictValue { } interface RuleForm { - id: number | ''; + id: string | ''; parentId: string; name: string; sort: number; @@ -324,7 +324,18 @@ const openDialog = (row?: CategoryRow | string, edit?: boolean) => { // 获取分类树数据 getCategoryTree().then((res: any) => { - categoryData.value = res.data?.tree ?? []; + const tree = res.data?.tree ?? []; + + // 递归函数,将所有id字段转换为字符串 + const convertIdsToString = (items: any[]): any[] => { + return items.map(item => ({ + ...item, + id: item.id?.toString(), + children: item.children && item.children.length > 0 ? convertIdsToString(item.children) : [] + })); + }; + + categoryData.value = convertIdsToString(tree); }); if (row && typeof row === 'object' && edit) { diff --git a/src/views/assets/category/index.vue b/src/views/assets/category/index.vue index 0f00dbb..a5f16ae 100644 --- a/src/views/assets/category/index.vue +++ b/src/views/assets/category/index.vue @@ -73,7 +73,7 @@ import OperationLogDialog from '../component/operationLogDialog.vue'; import { getCategoryTree, deleteCategory, updateCategoryStatus,listCategories } from '/@/api/assets/category'; interface CategoryRow { - id: number; + id: string; name: string; level: number; type: string; @@ -102,7 +102,18 @@ const getCategoryList = () => { .then((res: any) => { // 主类目不做展示,直接取主类目的children const tree = res.data?.tree ?? []; - tableData.data = tree.length > 0 && tree[0].children ? tree[0].children : []; + + // 递归函数,将所有id字段转换为字符串 + const convertIdsToString = (items: any[]): any[] => { + return items.map(item => ({ + ...item, + id: item.id?.toString(), + children: item.children && item.children.length > 0 ? convertIdsToString(item.children) : [] + })); + }; + + const processedTree = convertIdsToString(tree); + tableData.data = processedTree.length > 0 && processedTree[0].children ? processedTree[0].children : []; }) .catch(() => { tableData.data = []; diff --git a/src/views/digitalHuman/videoAssets/index.vue b/src/views/digitalHuman/videoAssets/index.vue index d262ee0..2f7cdd4 100644 --- a/src/views/digitalHuman/videoAssets/index.vue +++ b/src/views/digitalHuman/videoAssets/index.vue @@ -111,7 +111,7 @@ import { ref, reactive, onMounted } from 'vue'; import { ElMessage, ElMessageBox } from 'element-plus'; interface VideoItem { - id: number; + id: string; name: string; thumbnail: string; videoType: string; @@ -141,7 +141,7 @@ const previewVideo = ref(null); // 模拟数据 const mockData: VideoItem[] = [ { - id: 1, + id: '1', name: '商务男性数字人-产品介绍', thumbnail: 'https://picsum.photos/400/225?random=10', videoType: 'avatar', @@ -154,7 +154,7 @@ const mockData: VideoItem[] = [ createdAt: '2024-01-15 10:30:00', }, { - id: 2, + id: '2', name: '甜美女性数字人-直播带货', thumbnail: 'https://picsum.photos/400/225?random=11', videoType: 'avatar', @@ -167,7 +167,7 @@ const mockData: VideoItem[] = [ createdAt: '2024-01-14 14:20:00', }, { - id: 3, + id: '3', name: '科技感背景-蓝色粒子', thumbnail: 'https://picsum.photos/400/225?random=12', videoType: 'background', @@ -180,7 +180,7 @@ const mockData: VideoItem[] = [ createdAt: '2024-01-13 09:15:00', }, { - id: 4, + id: '4', name: '办公室场景背景', thumbnail: 'https://picsum.photos/400/225?random=13', videoType: 'background', @@ -193,7 +193,7 @@ const mockData: VideoItem[] = [ createdAt: '2024-01-12 16:45:00', }, { - id: 5, + id: '5', name: '转场特效-渐变', thumbnail: 'https://picsum.photos/400/225?random=14', videoType: 'material', @@ -206,7 +206,7 @@ const mockData: VideoItem[] = [ createdAt: '2024-01-11 11:00:00', }, { - id: 6, + id: '6', name: '知性女性数字人-新闻播报', thumbnail: 'https://picsum.photos/400/225?random=15', videoType: 'avatar', diff --git a/src/views/system/config/component/editConfig.vue b/src/views/system/config/component/editConfig.vue index 6aa6f86..0b0637d 100644 --- a/src/views/system/config/component/editConfig.vue +++ b/src/views/system/config/component/editConfig.vue @@ -1,6 +1,6 @@