fix: 拆分商户新增和编辑权限

This commit is contained in:
richjohnrambo
2026-09-20 17:08:50 +08:00
parent 8675fe333d
commit e5ab79c40d
8 changed files with 76 additions and 15 deletions
+10 -1
View File
@@ -15,7 +15,16 @@ export async function List(params) {
return res;
}
// 添加/编辑IM商户
// 添加IM商户
export function Add(params) {
return http.request({
url: '/imTenant/add',
method: 'POST',
params,
});
}
// 编辑IM商户
export function Edit(params) {
return http.request({
url: '/imTenant/edit',
+3 -2
View File
@@ -126,7 +126,7 @@
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { useDictStore } from '@/store/modules/dict';
import { Edit, View } from '@/api/imTenant';
import { Add, Edit, View } from '@/api/imTenant';
import { newState, rules, State } from './model';
import { useProjectSettingStore } from '@/store/modules/projectSetting';
import { useMessage } from 'naive-ui';
@@ -152,7 +152,8 @@
formRef.value.validate((errors) => {
if (!errors) {
formBtnLoading.value = true;
Edit(formValue.value)
const submit = formValue.value.id > 0 ? Edit : Add;
submit(formValue.value)
.then((_res) => {
message.success('操作成功');
closeForm();
+1 -1
View File
@@ -25,7 +25,7 @@
type="primary"
@click="addTable"
class="min-left-space"
v-if="hasPermission(['/imTenant/edit'])"
v-if="hasPermission(['/imTenant/add'])"
>
<template #icon>
<n-icon>