From 4128cd8c7b25b83d489129dc694ba5f9f50784a3 Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Fri, 28 Nov 2025 18:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.ts | 2 +- .../customerService/account/component/editRole.vue | 3 --- .../customerService/product/component/editRole.vue | 10 +++------- .../customerService/script/component/editRole.vue | 6 ++---- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index 5461303..fc3b8de 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -18,7 +18,7 @@ const service: AxiosInstance = axios.create({ // 配置新建第二个 axios 实例(新功能服务) const newService: AxiosInstance = axios.create({ - baseURL: 'http://192.168.3.49:8000/', // 新后端地址 + baseURL: 'http://192.168.3.95:8000/', // 新后端地址 timeout: 50000, // 50秒超时 headers: { 'Content-Type': 'application/json' }, // 默认JSON格式 paramsSerializer: { diff --git a/src/views/customerService/account/component/editRole.vue b/src/views/customerService/account/component/editRole.vue index 1626ae8..7eaf645 100644 --- a/src/views/customerService/account/component/editRole.vue +++ b/src/views/customerService/account/component/editRole.vue @@ -39,7 +39,6 @@ import { ref, reactive, toRefs, nextTick } from 'vue'; import { ElMessage, type FormInstance, type FormRules } from 'element-plus'; import { getaccountAdd, updateaccount } from '/@/api/customerService/account'; -import { Session } from '/@/utils/storage'; interface DialogFormData { id?: string; @@ -134,13 +133,11 @@ const onSubmit = async () => { customerServiceId: state.formData.customerServiceId, platform: state.formData.platform, // 注意:修改时不传递status,状态通过单独的开关控制\ - modifier: Session.get('userInfo').userNickname, }; await updateaccount(updateData); ElMessage.success('修改成功'); } else { // 新增操作 - state.formData.creator = Session.get('userInfo').userNickname; await getaccountAdd(state.formData); ElMessage.success('添加成功'); } diff --git a/src/views/customerService/product/component/editRole.vue b/src/views/customerService/product/component/editRole.vue index dc40eae..d089451 100644 --- a/src/views/customerService/product/component/editRole.vue +++ b/src/views/customerService/product/component/editRole.vue @@ -127,7 +127,7 @@ const handleEditMode = async (id: number) => { const res = await getproductOne({ id: id }); if (res.data) { // 填充表单数据 - // state.formData = res.data; + // state.formData.content= console.log(res.data, 'for'); } } catch (error) { @@ -173,13 +173,10 @@ const onSubmit = async () => { // 根据ID判断是新增还是修改 if (state.formData.id === 0) { // 新增产品 - state.formData.creator = Session.get('userInfo').userNickname; await getproductAdd(state.formData); ElMessage.success('产品添加成功'); } else { // 修改产品 - state.formData.modifier = Session.get('userInfo').userNickname; - await updateProduct(state.formData); ElMessage.success('产品修改成功'); } @@ -203,10 +200,9 @@ const resetForm = () => { state.formData = { id: 0, name: '', - status: 1, - listOrder: 0, - remark: '', content: '', + creator: '', + modifier: '', }; // 在下一个DOM更新周期后清除表单验证 diff --git a/src/views/customerService/script/component/editRole.vue b/src/views/customerService/script/component/editRole.vue index 7c47029..0893e95 100644 --- a/src/views/customerService/script/component/editRole.vue +++ b/src/views/customerService/script/component/editRole.vue @@ -33,7 +33,6 @@ import { ref, reactive, toRefs, nextTick } from 'vue'; import { ElMessage, type FormInstance, type FormRules } from 'element-plus'; import Editor from '/@/components/editor/index.vue'; import { getscriptAdd, updatescript } from '/@/api/customerService/script'; -import { Session } from '/@/utils/storage'; // console.log(Session.get('userInfo').userNickname, 'user'); // 定义类型接口 @@ -49,6 +48,7 @@ interface DialogRow { tag: string; creator: string; content: string; + modifier: ''; } // 定义事件 @@ -134,14 +134,11 @@ const onSubmit = async () => { state.loading = true; if (state.formData.id === 0) { - state.formData.creator = Session.get('userInfo').userNickname; - // 新增模式 await getscriptAdd(state.formData); console.log(state.formData); ElMessage.success('添加成功'); } else { - state.formData.modifier = Session.get('userInfo').userNickname; // 编辑模式 await updatescript(state.formData); ElMessage.success('修改成功'); @@ -170,6 +167,7 @@ const resetForm = () => { tag: '', content: '', creator: '', + modifier: '', }; // 重置表单验证状态