yuanhao
2025-06-04 a9d82ee818e96249634927847060177aa7dafe6a
fix: 根据后端修改验证
1个文件已添加
5个文件已修改
105 ■■■■■ 已修改文件
common/config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/aiQuestions/aiQuestions.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/icons/add.svg 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/config.js
@@ -1,8 +1,8 @@
/* 各种请求url配置 */
// 开发
const dev = {
    baseUrl: 'http://172.16.60.115:8089',
    VITE_APP_BASE: 'http://172.16.60.115:8001',
    baseUrl: 'http://172.16.60.119:8069',
    VITE_APP_BASE: 'http://172.16.60.119:8061',
    sftp: '',
}
// 线上
index.html
@@ -9,7 +9,7 @@
        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
    </script>
    <title>问答智能体平台</title>
    <title>财政AI助手</title>
    <!--preload-links-->
    <!--app-context-->
  </head>
manifest.json
@@ -1,7 +1,7 @@
{
    "name" : "问答智能体app",
    "name" : "财政AI助手",
    "appid" : "__UNI__EFB10A3",
    "description" : "问答智能体平台app",
    "description" : "财政AI助手",
    "versionName" : "1.0.0",
    "versionCode" : "100",
    "transformPx" : false,
pages.json
@@ -4,6 +4,17 @@
    },
    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
        {
            "path" : "pages/aiQuestions/aiQuestions",
            "style" :
            {
                "navigationBarTitleText" : "",
                "app-plus": {
                    "titleNView": false
                },
                "navigationStyle": "custom"
            }
        },
        {
            "path": "pages/index/index",
            "style": {
                "navigationBarTitleText": "",
@@ -37,17 +48,6 @@
            "path": "pages/search-list/knowlage-details/knowlage-details",
            "style": {
                "navigationBarTitleText": "知识检索"
            }
        },
        {
            "path" : "pages/aiQuestions/aiQuestions",
            "style" :
            {
                "navigationBarTitleText" : "",
                "app-plus": {
                    "titleNView": false
                },
                "navigationStyle": "custom"
            }
        }
    ],
pages/aiQuestions/aiQuestions.vue
@@ -2,7 +2,7 @@
    <view class="content">
        <view class="head" :class="{'isOn':showSet||showHistory}">
            <view class="box">
                <image class="back-img" @click='toBack' src="/static/back.png" mode=""></image>
                <!--  <image class="back-img" @click='toBack' src="/static/back.png" mode=""></image> -->
                <image v-if='details.appImg' class="logo" :src="baseUrl+details.appImg" mode="aspectFill" alt="">
                </image>
                <image v-else class="logo" src="/static/question/logo.png" mode="aspectFill" alt=""></image>
@@ -11,18 +11,19 @@
                        {{ details.appName }}
                    </view>
                    <view class="f">
                        问答
                        财政AI助手
                    </view>
                </view>
            </view>
            <view class="box-right">
                <image src="/static/question/mute.png" mode=""></image>
                <image style="width:40rpx;height:40rpx;" @click="showHistory=!showHistory;showSet=false"
                <!--  <image src="/static/question/mute.png" mode=""></image> -->
                <image style="width:40rpx;height:40rpx;" @click="getTalkList();showHistory=!showHistory;showSet=false; "
                    src="/static/time.png" mode=""></image>
                <image @click="showSet=!showSet;showHistory=false" src="/static/question/set.png" mode=""></image>
                    <!-- <image @click="" src="/static/icons/add.svg" mode=""></image> -->
                <!-- <image @click="showSet=!showSet;showHistory=false" src="/static/question/set.png" mode=""></image>-->
            </view>
        </view>
        <scroll-view class="ltbox" scroll-y="true" :scroll-into-view="intoView" v-if="msgList">
        <scroll-view class="ltbox" scroll-y="true" :scroll-into-view="intoView" v-if="msgList.length">
            <block v-if="details.appId">
                <view v-if="msgList&&msgList.length===0" class="wbox">
                    <image src="/static/exam/bg02.png" mode="widthFix" class="bg2" alt=""></image>
@@ -72,15 +73,8 @@
                                <view class="copy" @click='clickCopy(item.aiLog)'>
                                    <image src="/static/question/copy.png" mode=""></image>
                                </view>
                                <view class="copy" @click="clickPlay(item)">
                                    <image src="/static/question/sount1.png" v-if="item.isPlay==0"></image>
                                    <u-loading v-if="item.isPlay==1" mode="flower" size="34"></u-loading>
                                    <image src="/static/question/sount2.png" v-if="item.isPlay==2"></image>
                                    <!-- <u-icon v-if="item.isPlay==0" name="volume" size="34"></u-icon>
                                    <u-loading v-if="item.isPlay==1" mode="flower" size="34"></u-loading>
                                    <u-icon v-if="item.isPlay==2" name="pause-circle" size="34"></u-icon> -->
                                </view>
                            </view>
                            <!--
                            <view class="function-right">
                                <u-icon name="thumb-up-fill" @click='clickLikes(item)' v-if="item.isLike"
                                    color="#2468F2" size="40"></u-icon>
@@ -91,6 +85,7 @@
                                <u-icon name="thumb-down" @click="clickDislikes(item)" v-else color="#98a1b2"
                                    size="40"></u-icon>
                            </view>
                            -->
                        </view>
                    </view>
                </view>
@@ -102,6 +97,10 @@
            </view>
            <view id="bot"></view>
        </scroll-view>
        <view v-else class="tips">
            我是财政AI助手,很高兴见到你!我可以回答项目文档中的各种问题,输入问题快来体验吧!
        </view>
        <audio id="audio" src=""></audio>
        <view class="btmbox" :class="{'isOn':showKnow}">
            <view v-if="!voiceFlg" class="know-btn" :class="{'active-btn':showKnow}" @click="showKnow=true">
@@ -114,8 +113,8 @@
                <block v-if="!recording">
                    <image v-if="voiceFlg" src="/static/wd/i03.png" mode="widthFix" class="btnimg2" @click="clickType"
                        alt=""></image>
                    <image v-else src="/static/wd/i04.png" mode="widthFix" class="btnimg2" @click="clickType" alt="">
                    </image>
                    <!--  <image v-else src="/static/wd/i04.png" mode="widthFix" class="btnimg2" @click="clickType" alt="">
                    </image> -->
                </block>
                <view @touchstart="touchstartVoice" @touchmove.stop.prevent="touchmoveVoice" @touchend="touchendVoice"
                    @touchcancel="touchcancelVoice" class="u-flex-1 u-text-center tap-btn" v-if="voiceFlg">
@@ -199,12 +198,12 @@
        <u-popup v-model="showKnow" mode='bottom' border-radius="20">
            <view class="know-box">
                <view class="title">
                    <view>选择知识库 </view>
                    <view>选择项目 </view>
                    <image @click='showKnow=false;'  src="/static/wd/close.png"></image>
                </view>
                <view class="sbox">
                    <u-search @search="search" @custom="toSearch" height="80" bg-color="#F9FAFB" @clear="search"
                        v-model="keyword" :show-action="true" shape="round" placeholder="搜索知识库">
                        v-model="keyword" :show-action="true" shape="round" placeholder="搜索项目">
                    </u-search>
                </view>
                <view class='all-know'>
@@ -383,8 +382,12 @@
            }
        },
        onLoad(options) {
            this.appId = options.id
            this.toCheck(this.appId)
            this.appId = options.id || 1
            this.userId = options.userId || 1
            // this.toCheck(this.appId)
            this.openRecord();
            this.getDetails()
            this.getTalkList();
        },
        onReady() {
            this.con = document.getElementById('bot');
@@ -502,9 +505,10 @@
                })
            },
            getDetails() {
                getInfo(this.appId).then(val => {
                    this.details = val.data
                    this.knowIds = this.details.knowIds;
                // getInfo(this.appId).then(val => {
                //     this.details = val.data
                //     this.knowIds = this.details.knowIds;
                // })
                    getAppKnowList(this.appId).then(res => {
                        this.knowList = res.data;
                        this.knowList.forEach(item => {
@@ -513,7 +517,6 @@
                            } else {
                                item.isCheck = false
                            }
                        })
                    })
                })
            },
@@ -540,7 +543,7 @@
                    // 会话 ID
                    sessionId: log.sessionId,
                    // 当前用户的 ID
                    userId: this.userInfo.userId
                    userId: this.userId || 1
                }
                // 调用 qaFeedBack 接口提交点赞反馈
                updSessionLogFeedBack({
@@ -559,7 +562,7 @@
                    isOverall: 0,
                    sessionLogId: log.sessionLogId,
                    sessionId: log.sessionId,
                    userId: this.userInfo.userId
                    userId: this.userId
                }
                updSessionLogFeedBack({
                    sessionLogId: log.sessionLogId,
@@ -653,7 +656,7 @@
                    let addTalkInfor = await addTalk({
                        "appId": this.appId,
                        "sessionName": this.msg,
                        "userId": this.userInfo.userId
                        "userId": this.userId
                    })
                    this.sessionId = addTalkInfor.data.sessionId
                }
@@ -662,7 +665,7 @@
                let item = {
                    sessionLogId: '',
                    sessionId: this.sessionId,
                    userId: this.userInfo.userId,
                    userId: this.userId,
                    userLog: this.msg,
                    userSound: '',
                    docInfo: [],
@@ -701,7 +704,7 @@
                            "question": item.userLog,
                            "llm_name": this.chooseLlm.value,
                            "app_id": this.appId,
                            "user_id": this.userInfo.userId,
                            "user_id": this.userId,
                            "session_id": item.sessionId,
                            "session_log_id": item.sessionLogId,
                            "param_key": "know_id",
@@ -1494,14 +1497,19 @@
        box-sizing: border-box;
        padding: 20rpx 20rpx 0;
    }
    .tips{
        padding: 48rpx;
        background: #fff;
        border-radius: 24rpx;
        margin: 40rpx;
    }
    .msgbox1 {
        margin-bottom: 20rpx;
        .function-box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            justify-content: flex-end;
            margin-top: 24rpx;
            .function-left {
static/icons/add.svg
New file
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" class="design-iconfont" width="128" height="128">
  <path d="M7.25098 12.665V8.74902H3.33398C2.91988 8.74902 2.58416 8.41309 2.58398 7.99902C2.58398 7.58481 2.91977 7.24902 3.33398 7.24902H7.25098V3.33203C7.25098 2.91782 7.58676 2.58203 8.00098 2.58203C8.41504 2.58221 8.75098 2.91793 8.75098 3.33203V7.24902H12.667L12.7441 7.25293C13.1222 7.29142 13.417 7.61076 13.417 7.99902C13.4168 8.38716 13.1222 8.70667 12.7441 8.74512L12.667 8.74902H8.75098V12.665C8.75098 13.0791 8.41504 13.4149 8.00098 13.415C7.58676 13.415 7.25098 13.0793 7.25098 12.665Z" fill="#101828"></path>
</svg>