Ver código fonte

hide info for models

tycoding 1 ano atrás
pai
commit
4b3650d88b

+ 1 - 1
langchat-biz/src/main/java/cn/tycoding/langchat/biz/service/impl/AigcModelServiceImpl.java

@@ -91,7 +91,7 @@ public class AigcModelServiceImpl extends ServiceImpl<AigcModelMapper, AigcModel
             return;
         }
         String sec = StrUtil.hide(model.getSecretKey(), 3, model.getSecretKey().length() - 4);
-        model.setApiKey(sec);
+        model.setSecretKey(sec);
     }
 }
 

+ 6 - 0
langchat-server/src/main/java/cn/tycoding/langchat/server/controller/AigcModelController.java

@@ -67,6 +67,9 @@ public class AigcModelController {
         if (StrUtil.isNotBlank(data.getApiKey()) && data.getApiKey().contains("*")) {
             data.setApiKey(null);
         }
+        if (StrUtil.isNotBlank(data.getSecretKey()) && data.getSecretKey().contains("*")) {
+            data.setSecretKey(null);
+        }
         modelService.save(data);
         SpringContextHolder.publishEvent(new ProviderRefreshEvent(data));
         return R.ok();
@@ -79,6 +82,9 @@ public class AigcModelController {
         if (StrUtil.isNotBlank(data.getApiKey()) && data.getApiKey().contains("*")) {
             data.setApiKey(null);
         }
+        if (StrUtil.isNotBlank(data.getSecretKey()) && data.getSecretKey().contains("*")) {
+            data.setSecretKey(null);
+        }
         modelService.updateById(data);
         SpringContextHolder.publishEvent(new ProviderRefreshEvent(data));
         return R.ok();

+ 1 - 0
langchat-ui/src/views/channel/ModelSelect.vue

@@ -58,6 +58,7 @@
       });
     });
     options.value = data;
+    modelId.value = chatStore.modelId;
   });
 
   function onUpdate(val: any, opt) {

+ 5 - 5
langchat-ui/src/views/dashboard/index.vue

@@ -25,9 +25,9 @@
   const list = ref([
     {
       key: 'req',
-      label: 'AI请求量',
+      label: 'LLM请求量',
       value: 0,
-      totalLabel: 'AI总请求量',
+      totalLabel: 'LLM总请求量',
       totalValue: 0,
       category: '日',
       type: 'success',
@@ -36,7 +36,7 @@
       key: 'token',
       label: 'Token消耗量',
       value: 0,
-      totalLabel: 'AI总消耗Token量',
+      totalLabel: 'Token总消耗量',
       totalValue: 0,
       category: '日',
       type: 'primary',
@@ -52,9 +52,9 @@
     },
     {
       key: 'knowledge',
-      label: 'AI知识库数量',
+      label: '知识库数量',
       value: 0,
-      totalLabel: 'Prompt提示词数量',
+      totalLabel: 'AI应用数量',
       totalValue: 0,
       category: '合',
       type: 'error',