diff --git a/common/globalJs/globalJs.js b/common/globalJs/globalJs.js index 53afbf5..7d7038c 100644 --- a/common/globalJs/globalJs.js +++ b/common/globalJs/globalJs.js @@ -2,8 +2,8 @@ // #ifdef APP-PLUS || MP // const baseUrl = "http://116.62.210.143:9002"; // const baseUrl = "http://118.89.79.160:8800/HiatmpPro"; -const baseUrl = "http://49.235.207.167:8800/HiatmpPro"; -// const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro"; +// const baseUrl = "http://49.235.207.167:8800/HiatmpPro"; +const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro"; const chatUrl = "http://219.147.31.25:30001/hitap"; // #endif // #ifdef H5 diff --git a/manifest.json b/manifest.json index 98c10e0..2d21d1f 100644 --- a/manifest.json +++ b/manifest.json @@ -135,8 +135,8 @@ "https" : false, "proxy" : { "/HiatmpPro" : { - "target" : "http://49.235.207.167:8800", - // "target" : "http://219.147.31.25:30001/tht-app-api", + // "target" : "http://49.235.207.167:8800", + "target" : "http://219.147.31.25:30001/tht-app-api", "changeOrigin" : true, "secure" : false, "pathRewrite" : { diff --git a/pages/index/detail.vue b/pages/index/detail.vue index ecb6d29..f6929cc 100644 --- a/pages/index/detail.vue +++ b/pages/index/detail.vue @@ -229,7 +229,7 @@ export default { }; }, onLoad(options) { - console.log(options) + console.log(options); let params = options; // params.deptId = "3702000000"; // params.id = "37020017609"; @@ -243,7 +243,7 @@ export default { str += "路段名:" + params.roadName; this.title = params.roadName + "智能排查"; } - if (params.id) { + if (params.id != "undefined") { str += ",id:" + params.id; //params.id } console.log(params); @@ -251,7 +251,12 @@ export default { this.queryChat("开始隐患排查," + str); } else { // this.SSE("开始隐患排查," + str, "1"); - this.queryChat("开始隐患排查," + str); + if (params.id != "undefined") { + this.queryChat("开始隐患排查," + str); + } else { + + this.$.toast('缺少相关信息'); + } // if(this.msgListA.length==0){ // this.SSE("开始隐患排查," + str, '1') // }else{ @@ -373,7 +378,7 @@ export default { async queryChat(voiceText) { // console.log(voiceText,"voiceText"); this.loading = true; - + const [err, res] = await uni.request({ // url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', url: $.chatUrl + "/chat", @@ -403,7 +408,7 @@ export default { // "history": [] }, }); - + if (res && res.data && res.data.code == 200) { // console.log('request success', res.data) const { result = {} } = res.data; @@ -445,20 +450,17 @@ export default { }; this.msgList.push(newQuestion); // 将问题添加到消息列表 // this.$store.commit('setMSg_List', this.msgList); - }, scrollBottom() { - - this.$nextTick(() => { - // const height = - // this.$refs.scrollView && - // this.$refs.scrollView.$refs && - // this.$refs.scrollView.$refs.content - // ? this.$refs.scrollView.$refs.content.scrollHeight - // : 0; - // this.scrollTop = height; - this.scrollTop = this.scrollTop + 1 + // const height = + // this.$refs.scrollView && + // this.$refs.scrollView.$refs && + // this.$refs.scrollView.$refs.content + // ? this.$refs.scrollView.$refs.content.scrollHeight + // : 0; + // this.scrollTop = height; + this.scrollTop = this.scrollTop + 1; }); }, // 发送 @@ -525,7 +527,6 @@ export default { } clearInterval(timer); } - }, 50); } else { this.msgList = [ @@ -584,7 +585,9 @@ export default { // this.addQuestion(str, "0"); // this.SSE(jsonArr, "0"); this.changeMsgList("0", str); - this.queryChat(jsonArr); + + let j = jsonArr.join(","); + this.queryChat(j); } } }, diff --git a/pages/knowledge/index.vue b/pages/knowledge/index.vue index 3c3ba82..f6221b9 100644 --- a/pages/knowledge/index.vue +++ b/pages/knowledge/index.vue @@ -336,7 +336,8 @@ export default { // this.addQuestion(str, "0"); // this.SSE(jsonArr, "0"); this.changeMsgList("0", str); - this.queryChat(jsonArr); + let j = jsonArr.join(',') + this.queryChat(j); } } },