Ver código fonte

fix model update

tycoding 1 ano atrás
pai
commit
9eba242756

+ 1 - 1
langchat-common/src/main/java/cn/tycoding/langchat/common/exception/AuthException.java

@@ -15,7 +15,7 @@ public class AuthException extends RuntimeException {
     private final int code;
 
     public AuthException() {
-        super(HttpStatus.UNAUTHORIZED.getReasonPhrase());
+        super("没有操作权限");
         this.code = HttpStatus.UNAUTHORIZED.value();
     }
 

+ 4 - 3
langchat-server/src/main/resources/application-dev.yml

@@ -43,7 +43,8 @@ langchat:
       table: vector_1
       dimension: 384
   web-search:
-    google:
-      api-key: <KEY>
-      csi: <CSI>
+    # Google搜索
+#    google:
+#      api-key: <KEY>
+#      csi: <CSI>
 

+ 0 - 6
langchat-ui-client/src/api/prompt.ts

@@ -6,9 +6,3 @@ export function getPrompts(data: any) {
     data: data,
   });
 }
-
-export function getById(id: string) {
-  return http.get({
-    url: '/aigc/prompt/' + id,
-  });
-}

+ 7 - 3
langchat-ui/src/views/aigc/model/edit.vue

@@ -47,12 +47,16 @@
   async function onSubmit(values: any) {
     if (values !== false) {
       isShow.value = false;
-      if (isNullOrWhitespace(values.id)) {
-        await add(values);
+      const data = { ...values };
+      if (data.apiKey.indexOf('****')) {
+        data.apiKey = undefined;
+      }
+      if (isNullOrWhitespace(data.id)) {
+        await add(data);
         emit('reload');
         message.success('新增成功');
       } else {
-        await update(values);
+        await update(data);
         emit('reload');
         message.success('修改成功');
       }