diff --git a/src/api/function.ts b/src/api/function.ts
new file mode 100644
index 0000000..c16e720
--- /dev/null
+++ b/src/api/function.ts
@@ -0,0 +1,49 @@
+import request from '@/utils/request2';
+
+export const FindFunctionService = (Data) => {
+ const params = new URLSearchParams();
+ for (let key in Data) {
+ params.append(key, Data[key])
+ }
+ return request.post('/func/find', params,{
+ headers: {
+ 'token': Data.token, //token
+ }
+ })
+}
+
+export const AddFunctionService = (Data) => {
+ const params = new URLSearchParams();
+ for (let key in Data) {
+ params.append(key, Data[key])
+ }
+ return request.post('/func/create', params,{
+ headers: {
+ 'token': Data.token, //token
+ }
+ })
+}
+
+export const UpdateFunctionService = (Data) => {
+ const params = new URLSearchParams();
+ for (let key in Data) {
+ params.append(key, Data[key])
+ }
+ return request.post('/func/update', params,{
+ headers: {
+ 'token': Data.token, //token
+ }
+ })
+}
+
+export const DelFunctionService = (Data) => {
+ const params = new URLSearchParams();
+ for (let key in Data) {
+ params.append(key, Data[key])
+ }
+ return request.post('/func/delete', params,{
+ headers: {
+ 'token': Data.token, //token
+ }
+ })
+}
\ No newline at end of file
diff --git a/src/components/menu.ts b/src/components/menu.ts
index 3c8b02f..f18a679 100644
--- a/src/components/menu.ts
+++ b/src/components/menu.ts
@@ -31,6 +31,12 @@ export const menuData: Menus[] = [
index: '/manage-model',
title: '模型管理',
},
+ {
+ id: '54',
+ pid: '1',
+ index: '/function',
+ title: '功能管理',
+ }
],
},
diff --git a/src/router/index.ts b/src/router/index.ts
index ef4cd9a..bc2f4d0 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -41,6 +41,15 @@ const routes: RouteRecordRaw[] = [
},
component: () => import(/* webpackChunkName: "system-user" */ '../views/system/manage-model.vue'),
},
+ {
+ path: '/function',
+ name: 'function',
+ meta: {
+ title: '功能管理',
+ permiss: '54',
+ },
+ component: () => import(/* webpackChunkName: "system-user" */ '../views/system/function.vue'),
+ },
{
path: '/manage-session',
name: 'manage-session',
diff --git a/src/store/permiss.ts b/src/store/permiss.ts
index a68eb52..bbe23ab 100644
--- a/src/store/permiss.ts
+++ b/src/store/permiss.ts
@@ -50,6 +50,7 @@ export const usePermissStore = defineStore('permiss', {
'51', //会话管理
'52', //模型管理
'53', //通用人机对话
+ '54', //功能管理
],
user: ['0', '8', '7','9', '61','53'],
},
diff --git a/src/types/function.ts b/src/types/function.ts
new file mode 100644
index 0000000..b30f389
--- /dev/null
+++ b/src/types/function.ts
@@ -0,0 +1,11 @@
+export interface Function{
+ ID: number;
+ CreatedAt: string;
+ UpdatedAt: string;
+ DeletedAt: string;
+ Name: string;
+ Info: string;
+ UserID: number;
+ ModelID: number;
+ Function: string;
+}
\ No newline at end of file
diff --git a/src/views/system/function.vue b/src/views/system/function.vue
new file mode 100644
index 0000000..9677921
--- /dev/null
+++ b/src/views/system/function.vue
@@ -0,0 +1,268 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 8fb2060..2cced4c 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -165,7 +165,6 @@ const updateData = async (data) => {
result = await updateUserInfoService(req)
if (result.code === 0) {
ElMessage.success("更新成功");
- this.updateDialogVisible = false;
} else {
ElMessage.error("更新失败");
}
@@ -174,7 +173,7 @@ const updateData = async (data) => {
console.log(e);
}
closeDialog();
- handleSearch();
+ getData();
};
const getUserInfo = async (id) => {