修改url

This commit is contained in:
14651
2025-08-15 16:26:06 +08:00
parent 2462260bb3
commit cbabebc174
3 changed files with 17 additions and 14 deletions

View File

@@ -11,9 +11,9 @@
</view> -->
<!-- 消息列表 -->
<scroll-view scroll-y class="message-list" :scroll-top="scrollTop" scroll-with-animation="true"
show-scrollbar="false" enhanced="true" bounces="true"
@scroll="onScroll" @scrolltoupper="loadMoreHistory" upper-threshold="50">
<scroll-view scroll-y class="message-list" :scroll-top="scrollTop" scroll-with-animation="true"
show-scrollbar="false" enhanced="true" bounces="true" @scroll="onScroll" @scrolltoupper="loadMoreHistory"
upper-threshold="50">
<!-- 加载提示 -->
<view v-if="isLoadingHistory" class="loading-history">
<text>正在加载历史记录...</text>
@@ -245,22 +245,25 @@
if (res) {
console.log('forceScrollToBottom: 获取到scrollOffset', res);
console.log('forceScrollToBottom: 当前scrollTop', this.scrollTop);
// 使用scrollHeight如果没有则使用一个大值
const scrollHeight = res.scrollHeight || 99999;
const targetScrollTop = scrollHeight + 1000;
// 先重置scrollTop然后设置到底部
this.scrollTop = 0;
this.$nextTick(() => {
this.scrollTop = targetScrollTop;
console.log('forceScrollToBottom: 设置scrollTop为', targetScrollTop);
console.log('forceScrollToBottom: 设置scrollTop为',
targetScrollTop);
// 延迟再次确保滚动到底部
setTimeout(() => {
const finalScrollTop = (res.scrollHeight || 99999) + 1000;
const finalScrollTop = (res.scrollHeight ||
99999) + 1000;
this.scrollTop = finalScrollTop;
console.log('forceScrollToBottom: 延迟设置scrollTop完成', finalScrollTop);
console.log('forceScrollToBottom: 延迟设置scrollTop完成',
finalScrollTop);
}, 100);
});
} else {
@@ -656,7 +659,7 @@
});
this.inputMessage = '';
this.saveMessagesToLocal(); // 保存用户消息
// 立即滚动到底部显示用户消息
this.forceScrollToBottom();

View File

@@ -3,12 +3,12 @@ import axios from 'axios'
import {
getToken
} from './auth'
import config from '@/config'
const service = axios.create({
// baseURL: 'http://localhost:9090/dev-api/aitutor/aichat',
// baseURL: 'http://localhost:8088/aitutor/aichat',
// baseURL: 'http://localhost:8080/aitutor/aichat',
baseURL: 'http://localhost:8088',
baseURL: config.baseUrl,
timeout: 15000,
headers: {
'Content-Type': 'application/json'

View File

@@ -2,10 +2,10 @@
import {
getToken
} from '@/utils/auth';
import config from '@/config'
const BASE_URL = (() => {
// #ifdef H5
return 'http://localhost:8088';
return config.baseUrl;
// #endif
// #ifndef H5
// return 'http://192.168.x.x:8088'; // 换成你的电脑 IP