Bläddra i källkod

Merge branch 'master' into ETA1.4.3

jwyu 1 år sedan
förälder
incheckning
2aa32b7319

+ 0 - 1
index.html

@@ -12,7 +12,6 @@
 	<link rel="icon" type="image/x-icon" href="./static/fa.ico" id="icon"/>
 	<script src="./static/js/vue.js"></script>  <!-- 开发版,开发过程中使用此方案-->
 	<script src="./static/js/main.js"></script>  <!-- 生产版,打包的时候使用此方案 -->
-	<script src="./static/base_config.js"></script>  <!-- key -->
 	<!-- 引入组件库 -->
 	
 	<!-- oss SDK -->

+ 5 - 5
src/api/crypto.js

@@ -1,16 +1,16 @@
-const key = window.key||'6WpHp4vSvLVQK8SLioNZ7WMq'; //eta
-// const key = 'cJ3b1I4YBlTc85vnxy36xip2'; //逸诺
-// const key = 'bvS3kVp7QIZoD70fPk1wk41n'; //试用
+let key = ''; //eta
 
 class CryptoJS {
 	// 3DES加密,CBC/PKCS5Padding
-	static Des3Encrypt (input) {
+	static Des3Encrypt (input,keyVal) {
+		key=keyVal
 		let genKey = genkey(key, 0, 24);
 		return base64encode(des(genKey.key, input, 1, 1, key.substr(0, 8), 1));
 	}
 
 	// 3DES解密,CBC/PKCS5Padding
-	static Des3Decrypt (input) {
+	static Des3Decrypt (input,keyVal) {
+		key=keyVal
 		let genKey = genkey(key, 0, 24);
 		return des(genKey.key, base64decode(input), 0, 1, key.substr(0, 8), 1);
 	}

+ 1 - 1
src/api/http.js

@@ -44,7 +44,7 @@ function checkStatus(response) {
   //处理响应数据
   if (response && response.status === 200) {
     // loading,如果http状态码正常,则直接返回数据
-    let res = bus.$parseData(response.data);
+    let res = bus.$parseData(response);
     if (!res) {
       bus.$message.error("服务器开了个小差");
       return false;

BIN
src/assets/img/icons/ai_Company.png


BIN
src/assets/img/icons/ai_avatar.png


BIN
src/assets/img/icons/gpt-4-turbo.png


BIN
src/assets/img/icons/gpt-4.png


+ 6 - 4
src/utils/parseData.js

@@ -1,8 +1,10 @@
 import ParserData from '@/api/crypto.js';
 /* 解密数据处理 */
-export function parseData(res) {
-  let result = process.env.NODE_ENV === "production"
-  ? JSON.parse(ParserData.Des3Decrypt(res))
-  : res;
+export function parseData(response) {
+  const headKeyStr=response.headers.dk
+  const desKey=ParserData.Des3Decrypt(headKeyStr,'JMCqSoUrTAmyNNIRb0TtlrPk')
+  let result = process.env.NODE_ENV == "production"
+  ? JSON.parse(ParserData.Des3Decrypt(response.data,desKey))
+  : response.data;
   return result
 }

+ 11 - 1
src/views/Home.vue

@@ -105,7 +105,7 @@
                       :style="`display: flex;align-items:center;color:${
                         child.path === activePath ? $setting.theme_color : '#666'
                       }`"
-                      @click="(e) => e.preventDefault()"
+                      @click="handleClickSubMenuItem(child,$event)"
                     >
                       <svg t="1689672247666" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7676" width="30" height="30"><path d="M640 499.2v25.6a21.333333 21.333333 0 0 1-21.333333 21.333333h-213.333334a21.333333 21.333333 0 0 1-21.333333-21.333333v-25.6a21.333333 21.333333 0 0 1 21.333333-21.333333h213.333334a21.333333 21.333333 0 0 1 21.333333 21.333333z"  p-id="7677" :fill="child.path === activePath ? $setting.theme_color : '#666'"></path></svg>
                       <span style="margin-left:15px;">{{ child.name }}</span>
@@ -490,6 +490,16 @@ export default {
     this.getPublicSettings();
   },
   methods: {
+    handleClickSubMenuItem(item,e){
+      e.preventDefault();
+      if(item.path==='AIQA'){
+        e.stopPropagation();
+        let { href } = this.$router.resolve({
+          path:'/'+item.path
+        });
+        window.open(href, '_blank')
+      }
+    },
     // 获取商家Code
     getBusinessCodeFun(){
       getBusinessCode().then(res=>{

+ 4 - 1
src/views/Login.vue

@@ -355,10 +355,13 @@ export default {
         },
         ordinaryModelLogin(){
             const {account,checkPass,checked} = this.$refs.ordinaryModel.form
+            const t=new Date().getTime()
+            const md5key='MiQM9yusNA9T2uIH'
             departInterence.userLogin({
                 LoginType:1,
                 Username:account,
-                Password:md5.hex_md5(checkPass)
+                Password: `${md5.hex_md5(md5.hex_md5(checkPass)+md5key+t)}`,
+                ReqTime:`${t}`
             }).then(res=>{
                 //this.logining = false
                 //账号异常 将accountCheck置为true

+ 1 - 1
src/views/datasheet_manage/customAnalysis/components/createTargetForm.vue

@@ -257,7 +257,7 @@ export default {
   margin-bottom: 20px;
   display: flex;
   flex-wrap: wrap;
-  padding: 20px;
+  padding: 20px 20px 0;
   .el-form-item {
     margin-bottom: 20px;
     /* .select {

+ 1 - 0
src/views/datasheet_manage/customAnalysis/components/rightSection.vue

@@ -73,6 +73,7 @@ export default {
   .create-cont {
     .edb-list {
       padding: 30px;
+      max-height: 640px;
       overflow-y: auto;
       .edb-item {
         display: flex;

+ 54 - 21
src/views/operation_manage/AIQA/AIQA.vue

@@ -3,10 +3,10 @@
         <div class="window-list-wrap">
             <div class="window-title">
                 <div class="title-wrap">
-                    <p style="color: #333333;font-size: 20px;font-weight: 600;">HORIZON INSIGHTS</p>
-                    <span style="color: #666666;font-size: 16px;">弘则研究AI问答小助手</span>
+                    <p class="text-ellipsis" style="color: #333333;font-size: 20px;font-weight: 600;">{{companyName}}</p>
+                    <span style="color: #666666;font-size: 16px;">研究AI问答小助手</span>
                 </div>
-                <div class="icon"><img src="~@/assets/img/icons/horizon.png" /></div>
+                <div class="icon"><img src="~@/assets/img/icons/ai_company.png"/></div>
             </div>
             <div class="add-btn" @click="handleAddNewWindow"><i class="el-icon-circle-plus-outline"></i>新建对话窗口</div>
             <div class="list-wrap hidden-scrollbar">
@@ -28,10 +28,10 @@
             <div class="content-header">
                 <div class="title-wrap">
                     <p>{{activeWindowId<=0?'新对话窗口':activeWindow.TopicName||''}}</p>
-                    <span>{{activeWindowId<=0?'弘则AI助手使用说明':`${historyList.length||0} messages`}}</span>
+                    <span>{{activeWindowId<=0?'AI助手使用说明':`${historyList.length||0} messages`}}</span>
                 </div>
                 <div class="select-box">
-                    <el-select v-model="model" :class="{'hint':showHint}" :disabled="isTyping||(windowContentLoading&&windowContentLoading.visible)" ref="modelSelect" 
+                    <!-- <el-select v-model="model" :class="{'hint':showHint}" :disabled="isTyping||(windowContentLoading&&windowContentLoading.visible)" ref="modelSelect" 
                         @click.native="selectClick"
                         @change="changeModel">
                         <el-option v-for="item in modelList" :key="item.label"
@@ -40,7 +40,7 @@
                             <span style="float:left">{{item.label}}</span>
                             <span style="float:right"><img :src="item.icon" style="margin-top:5px;width:24px;height:24px;"/></span>
                         </el-option>
-                    </el-select>
+                    </el-select> -->
                 </div>
             </div>
             <!-- 仅这一部分滚动 -->
@@ -74,6 +74,7 @@ import NewWindowHint from './components/newWindowHint.vue';
 import WindowListItem from './components/windowListItem';
 /* api */
 import {aiQAInterence} from '@/api/modules/aiApi.js'; 
+import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
 export default {
     components: { WindowListItem,NewWindowHint, MessageItem },
     data() {
@@ -86,17 +87,25 @@ export default {
             /* window-content*/
             historyList:[],//当前窗口历史记录
             inputText:'',
-            model:'',//当前选择的模型
+            model:'GPT-4 Turbo',//当前选择的模型
             modelOldValue:'',
             modelList:[
                 {
-                    label:'gpt-3.5-turbo',
-                    icon:require('@/assets/img/icons/chat-gpt.png'),
+                    label:'GPT-4 Turbo',
+                    icon:require('@/assets/img/icons/gpt-4-turbo.png'),
+                },
+                {
+                    label:'GPT4',
+                    icon:require('@/assets/img/icons/gpt-4.png'),
                 },
                 {
                     label:'gpt-3.5-turbo-16k',
                     icon:require('@/assets/img/icons/chat-gpt-16k.png'),
                 },
+                {
+                    label:'gpt-3.5-turbo',
+                    icon:require('@/assets/img/icons/chat-gpt.png'),
+                },
                 {
                     label:'eta',
                     icon:require('@/assets/img/icons/horizon.png'),
@@ -105,6 +114,8 @@ export default {
             showHint:false,//选择模型提示
             isTyping:false,//是否处于打字动画中
             windowContentLoading:null,
+            answerLoading:false,//回答中
+            companyName:'',
         };
     },
     watch:{
@@ -153,7 +164,7 @@ export default {
                 this.historyList = List||[]
                 this.windowContentLoading&&this.windowContentLoading.close()
                 //使用模型
-                this.model = this.historyList.length?this.historyList[this.historyList.length-1].Model:''
+                this.model = this.historyList.length?this.historyList[this.historyList.length-1].Model:'GPT-4 Turbo'
                 //如果有历史记录,则滚动到底部
                 this.$nextTick(()=>{
                     const windowContentWrap = document.querySelector('.window-content-wrap')
@@ -199,7 +210,7 @@ export default {
             this.activeWindowId=0
             this.activeWindow=null
             this.historyList=[]
-            this.model=''
+            this.model='GPT-4 Turbo'
             //this.inputText=''
             this.isTyping = false
         },
@@ -285,23 +296,24 @@ export default {
                 this.inputText+='\n'
                 return
             }
-            if(this.isTyping){
+            if(this.isTyping||this.answerLoading){
                 this.$message.warning('请等待回答完成')
                 return
             }
             //新建窗口,未选择模型
-            if(this.activeWindowId===0&&this.model===''){
-                this.showHint = true
-                this.$message.error('请选择模型')
-                this.$nextTick(()=>{
-                    this.$refs.modelSelect.focus()
-                })
-                return
-            }
+            // if(this.activeWindowId===0&&this.model===''){
+            //     this.showHint = true
+            //     this.$message.error('请选择模型')
+            //     this.$nextTick(()=>{
+            //         this.$refs.modelSelect.focus()
+            //     })
+            //     return
+            // }
             if(this.inputText.length===0){
                 this.$message.warning('请输入提问')
                 return
             }
+            this.answerLoading=true
             this.activeWindowId===0&&(this.activeWindowId = -1)
             //this.activeWindowId!==0&&this.getWindowDetail()
             //mock 加入到historyList中
@@ -329,8 +341,9 @@ export default {
             aiQAInterence.sendChatMsg({
                 AiChatTopicId:this.activeWindowId<=0?0:this.activeWindowId,
                 Ask:inputText,
-                Model:this.model
+                // Model:this.model
             }).then(res=>{
+                this.answerLoading=false
                 //在回答未获取前切换了新窗口
                 if(this.historyList.length===0){
                     this.getWindowList()
@@ -365,6 +378,8 @@ export default {
                 msg.Model = Model
                 msg.isPlay = true
                 this.historyList.splice(this.historyList.length-1,1,msg)
+            }).catch(()=>{
+                this.answerLoading=false
             })
         },
         //获取窗口列表
@@ -378,10 +393,19 @@ export default {
                 this.windowList = res.Data.List||[]
                 this.listWrapLoading&&this.listWrapLoading.close()
             })
+        },
+
+        getBaseConfig(){
+            etaBaseConfigInterence.getBaseConfig().then(res=>{
+                if(res.Ret===200){
+                    this.companyName=res.Data.CompanyName||''
+                }
+            })
         }
     },
     mounted(){
         this.getWindowList()
+        this.getBaseConfig()
     }
 };
 </script>
@@ -422,10 +446,19 @@ $border-color:#3D52A1;
             display: flex;
             justify-content: space-between;
             align-items: center;
+            // overflow: hidden;
             .icon img{
                 width:58px;
                 height:58px;
             }
+            .title-wrap{
+                overflow: hidden;
+            }
+            .text-ellipsis{
+                overflow: hidden;
+                white-space: nowrap;
+                text-overflow: ellipsis;
+            }
         }
         .add-btn{
             border:2px dashed $border-color;

+ 6 - 4
src/views/operation_manage/AIQA/components/messageItem.vue

@@ -28,10 +28,12 @@ export default {
     data() {
         return {
             iconMap:{
-                'user':require('@/assets/img/set_m/user_img.png'),
+                'user':require('@/assets/img/icons/ai_avatar.png'),
                 'gpt-3.5-turbo':require('@/assets/img/icons/chat-gpt.png'),
                 'gpt-3.5-turbo-16k':require('@/assets/img/icons/chat-gpt-16k.png'),
-                'eta':require('@/assets/img/icons/horizon.png')
+                'eta':require('@/assets/img/icons/horizon.png'),
+                'GPT4':require('@/assets/img/icons/gpt-4.png'),
+                'GPT-4 Turbo':require('@/assets/img/icons/gpt-4-turbo.png'),
             },
             isPlay:false,//是否播放动画
             typingText:'',
@@ -51,13 +53,13 @@ export default {
     computed:{
         IconSrc(){
             const {messageType,modelName} = this.messageInfo
-            const iconType = messageType==='question'?'user':modelName
+            const iconType = messageType==='question'?'user':'GPT-4 Turbo'
             return this.iconMap[iconType]||''
         }
     },
     methods: {
         async playTyping(){
-            const writeText = (text,delay=150)=>{
+            const writeText = (text,delay=20)=>{
                 return new Promise((res,rej)=>{
                     setTimeout(()=>{
                         this.typingText+=text

+ 2 - 3
src/views/operation_manage/AIQA/components/newWindowHint.vue

@@ -1,9 +1,8 @@
 <template>
     <div class="new-window-hint-wrap">
         <p class="title">使用说明:</p>
-        <p>1、每账号每天最高50次问答。</p>
-        <p>2、在同一个对话窗口内提问,选择同一模型可联系上下文回答,切换模型后不支持。</p>
-        <p>3、历史问答默认用该对话窗口内第一个提问命名,可修改。</p>
+        <p>1、每账号每天最高500次问答。</p>
+        <p>2、历史问答默认用该对话窗口内第一个提问命名,可修改。</p>
     </div>
 </template>
 

+ 1 - 1
src/views/operation_manage/AIQA/components/windowListItem.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="list-item" :class="{'active':activeWindowId===item.AiChatTopicId}">
+    <div class="list-item" :class="[activeWindowId===item.AiChatTopicId?'active':'']">
         <template v-if="!isEdit">
             <p>{{item.TopicName}}</p>
             <!-- <span>6 messages </span> -->

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 1
static/js/jquery.min.js


Vissa filer visades inte eftersom för många filer har ändrats