调整开发环境API服务地址至192.168.100.84,修改分类管理接口参数类型从string改为number,优化新增分类提交逻辑移除id字段传递,调整分类详情parentId字段映射为bid
This commit is contained in:
@@ -5,14 +5,14 @@ ENV = 'development'
|
||||
# 后端服务地址配置
|
||||
# 切换环境时,修改下面两个地址的 IP 即可
|
||||
# 当前环境: 192.168.3.11(本地开发地址)
|
||||
# 当前环境: 192.168.3.94(本地开发地址)王楠
|
||||
# 备用环境: 192.168.3.200(服务器地址)
|
||||
# 备用环境: 116.204.74.41(公网开发地址)
|
||||
# 备用环境: 172.20.10.7(张哥)
|
||||
# ============================================================
|
||||
|
||||
# 主服务地址(端口8808)
|
||||
# 用途: 系统管理、用户认证、权限控制、模块开通等原有功能
|
||||
VITE_API_URL = 'http://192.168.3.11:8808/'
|
||||
VITE_API_URL = 'http://192.168.100.84:8808/'
|
||||
# 新功能服务地址(端口8000)
|
||||
# 用途: 资产管理、分类、SKU、订单等新业务模块
|
||||
VITE_NEW_API_URL = 'http://192.168.3.11:8000/'
|
||||
VITE_NEW_API_URL = 'http://192.168.100.84:8000/'
|
||||
@@ -12,7 +12,7 @@ export function getCategoryTree(query?: Object) {
|
||||
}
|
||||
|
||||
// 获取分类详情
|
||||
export function getCategory(id: string) {
|
||||
export function getCategory(id: number) {
|
||||
return newService({
|
||||
url: '/assets/category/getCategory',
|
||||
method: 'get',
|
||||
@@ -56,7 +56,7 @@ export function updateCategory(data: object) {
|
||||
}
|
||||
|
||||
// 删除分类
|
||||
export function deleteCategory(id: string) {
|
||||
export function deleteCategory(id: number) {
|
||||
return newService({
|
||||
url: '/assets/category/deleteCategory',
|
||||
method: 'delete',
|
||||
@@ -65,7 +65,7 @@ export function deleteCategory(id: string) {
|
||||
}
|
||||
|
||||
// 更新分类状态
|
||||
export function updateCategoryStatus(id: string, status: number) {
|
||||
export function updateCategoryStatus(id: number, status: number) {
|
||||
return newService({
|
||||
url: '/assets/category/updateCategoryStatus',
|
||||
method: 'put',
|
||||
|
||||
@@ -129,7 +129,8 @@ import { getDicts } from '/@/api/system/dict/data';
|
||||
import { createFormDiff } from '/@/utils/diffUtils';
|
||||
|
||||
interface CategoryRow {
|
||||
id: string;
|
||||
id: number;
|
||||
bid: string;
|
||||
name: string;
|
||||
level: number;
|
||||
options?: string[];
|
||||
@@ -163,7 +164,7 @@ interface DictValue {
|
||||
}
|
||||
|
||||
interface RuleForm {
|
||||
id: string;
|
||||
id: number | '';
|
||||
parentId: string;
|
||||
name: string;
|
||||
sort: number;
|
||||
@@ -332,7 +333,7 @@ const openDialog = (row?: CategoryRow | string, edit?: boolean) => {
|
||||
getCategory(row.id).then((res: any) => {
|
||||
const data = res.data;
|
||||
ruleForm.id = data.id || '';
|
||||
ruleForm.parentId = data.parentId || '';
|
||||
ruleForm.parentId = data.bid || '';
|
||||
ruleForm.name = data.name || '';
|
||||
ruleForm.sort = data.sort || 0;
|
||||
// 处理 attrs 中的 options 字段
|
||||
@@ -469,8 +470,9 @@ const onSubmit = () => {
|
||||
submitLoading.value = false;
|
||||
});
|
||||
} else {
|
||||
// 新增模式:传递所有字段
|
||||
addCategory(submitData)
|
||||
// 新增模式:不传id
|
||||
const { id, ...rest } = submitData;
|
||||
addCategory(rest)
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
closeDialog();
|
||||
|
||||
@@ -73,7 +73,8 @@ import OperationLogDialog from '../component/operationLogDialog.vue';
|
||||
import { getCategoryTree, deleteCategory, updateCategoryStatus,listCategories } from '/@/api/assets/category';
|
||||
|
||||
interface CategoryRow {
|
||||
id: string;
|
||||
id: number;
|
||||
bid: string;
|
||||
name: string;
|
||||
level: number;
|
||||
type: string;
|
||||
|
||||
Reference in New Issue
Block a user