Explorar o código

更新红娘签到BUG

wangwenju hai 4 semanas
pai
achega
7f2e1742d0

+ 4 - 4
LiangZhiYUMao/App.vue

@@ -69,7 +69,7 @@ export default {
 					return;
 					return;
 				}
 				}
 				
 				
-				console.log('🚀 开始初始化全局TIM,用户ID:', userId);
+				console.log('?? 开始初始化全局TIM,用户ID:', userId);
 			
 			
 			// 初始化TIM SDK(只在首次初始化)
 			// 初始化TIM SDK(只在首次初始化)
 			const SDKAppID = 1600109674;
 			const SDKAppID = 1600109674;
@@ -91,7 +91,7 @@ export default {
 			
 			
 			// 获取UserSig
 			// 获取UserSig
 			const res = await uni.request({
 			const res = await uni.request({
-				url: `http://localhost:8083/api/im/getUserSig?userId=${userId}`,
+				url: `http://172.20.10.2:8083/api/im/getUserSig?userId=${userId}`,
 				method: 'GET'
 				method: 'GET'
 			});
 			});
 			
 			
@@ -119,7 +119,7 @@ export default {
 		 */
 		 */
 		async initPresenceManager(userId) {
 		async initPresenceManager(userId) {
 			try {
 			try {
-				console.log('🌐 初始化在线状态管理器,用户ID:', userId);
+				console.log('?? 初始化在线状态管理器,用户ID:', userId);
 				
 				
 				// 初始化 TIM + WebSocket 混合状态管理器
 				// 初始化 TIM + WebSocket 混合状态管理器
 				await timPresenceManager.init(String(userId));
 				await timPresenceManager.init(String(userId));
@@ -134,7 +134,7 @@ export default {
 		 * 检查TIM连接状态和WebSocket连接状态
 		 * 检查TIM连接状态和WebSocket连接状态
 		 */
 		 */
 		checkTIMConnection() {
 		checkTIMConnection() {
-			console.log('🔍 ========== 开始检查连接状态 ==========');
+			console.log('?? ========== 开始检查连接状态 ==========');
 			
 			
 			// 获取当前登录用户ID
 			// 获取当前登录用户ID
 			const userId = uni.getStorageSync('userId');
 			const userId = uni.getStorageSync('userId');

+ 1 - 1
LiangZhiYUMao/config/match-config.js

@@ -6,7 +6,7 @@
 const getBaseUrl = () => {
 const getBaseUrl = () => {
 	// 开发环境:使用本地地址
 	// 开发环境:使用本地地址
 	if (process.env.NODE_ENV === 'development') {
 	if (process.env.NODE_ENV === 'development') {
-		return 'http://localhost:8083';
+		return 'http://172.20.10.2:8083';
 	}
 	}
 	
 	
 	// 生产环境:使用服务器地址
 	// 生产环境:使用服务器地址

+ 17 - 29
LiangZhiYUMao/pages/courses/list.vue

@@ -9,20 +9,20 @@
 			<view class="navbar-right"></view>
 			<view class="navbar-right"></view>
 		</view>
 		</view>
 
 
-		<!-- 课程分类标签 - 横向滚动 -->
-		<scroll-view scroll-x class="category-scroll" show-scrollbar="false">
-			<view class="category-list">
-				<view 
-					v-for="(tab, index) in tabs" 
-					:key="index"
-					class="category-item" 
-					:class="{ active: activeTab === tab.type }"
-					@click="switchTab(tab.type)"
-				>
-					{{ tab.name }}
-				</view>
-			</view>
-		</scroll-view>
+		<!-- 课程分类标签 -->
+		<view class="course-tabs">
+			<view class="tab-item" :class="{ active: activeTab === 'all' }" @click="switchTab('all')">全部课程</view>
+			<view class="tab-item" :class="{ active: activeTab === 'basic' }" @click="switchTab('basic')">基础课程</view>
+			<view class="tab-item" :class="{ active: activeTab === 'advanced' }" @click="switchTab('advanced')">进阶课程</view>
+			<view class="tab-item" :class="{ active: activeTab === 'premium' }" @click="switchTab('premium')">精品课程</view>
+		</view>
+
+		<!-- 排序选项 -->
+		<view class="sort-options">
+			<view class="sort-item" :class="{ active: activeSort === 'recommend' }" @click="switchSort('recommend')">推荐排序</view>
+			<view class="sort-item" :class="{ active: activeSort === 'latest' }" @click="switchSort('latest')">最新课程</view>
+			<view class="sort-item" :class="{ active: activeSort === 'popular' }" @click="switchSort('popular')">热门课程</view>
+		</view>
 
 
 		<!-- 课程列表 -->
 		<!-- 课程列表 -->
 		<view class="course-grid">
 		<view class="course-grid">
@@ -71,15 +71,8 @@
 				hasMore: true,
 				hasMore: true,
 				loading: false,
 				loading: false,
 				DEFAULT_IMAGES,
 				DEFAULT_IMAGES,
-				// 顶部分类标签:全部 / 基础 / 进阶 / 精品
-				tabs: [
-					{ name: '全部课程', type: 'all' },
-					{ name: '基础课程', type: 'basic' },
-					{ name: '进阶课程', type: 'advanced' },
-					{ name: '精品课程', type: 'premium' }
-				],
 				activeTab: 'all', // 当前选中的标签页
 				activeTab: 'all', // 当前选中的标签页
-				activeSort: 'recommend', // 当前排序方式(暂保留,可根据需要扩展)
+				activeSort: 'recommend', // 当前排序方式
 				// 模拟数据,当API返回为空时使用
 				// 模拟数据,当API返回为空时使用
 				mockCourses: [
 				mockCourses: [
 					{
 					{
@@ -142,16 +135,11 @@
 
 
 				try {
 				try {
 					console.log('尝试加载精品课程API数据...')
 					console.log('尝试加载精品课程API数据...')
-					// 基础分页参数
-					const params = {
+					const response = await api.course.getList({
 						page: this.pageNum,
 						page: this.pageNum,
 						pageSize: this.pageSize,
 						pageSize: this.pageSize,
 						status: 1
 						status: 1
-					}
-					// 根据当前标签附加一个分类参数,后端可按需使用
-					// all / basic / advanced / premium
-					params.categoryType = this.activeTab
-					const response = await api.course.getList(params)
+					})
 
 
 					console.log('API返回数据:', response)
 					console.log('API返回数据:', response)
 
 

+ 2 - 2
LiangZhiYUMao/pages/matchmaker-workbench/index.vue

@@ -271,10 +271,10 @@ export default {
 					url: '/pages/matchmaker-workbench/quality-resources'
 					url: '/pages/matchmaker-workbench/quality-resources'
 				})
 				})
 			},
 			},
-			// 导航到课程培训(红娘专属)
+			// 导航到课程培训
 			navigateToCourses() {
 			navigateToCourses() {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: '/pages/matchmaker-workbench/courses'
+					url: '/pages/courses/list'
 				})
 				})
 			},
 			},
 			// 导航到积分商城
 			// 导航到积分商城

+ 27 - 131
LiangZhiYUMao/pages/matchmaker-workbench/quality-resources.vue

@@ -59,7 +59,7 @@
 					</view>
 					</view>
 					<view class="action-buttons">
 					<view class="action-buttons">
 						<view class="action-btn add-resource-btn" @click.stop="handleAddToMyResources(index)">添加到我的资源</view>
 						<view class="action-btn add-resource-btn" @click.stop="handleAddToMyResources(index)">添加到我的资源</view>
-						<view class="action-btn chat-btn" @click.stop="handleChat(resource, index)">牵线聊聊</view>
+						<view class="action-btn chat-btn" @click.stop="handleChat(resource)">牵线聊聊</view>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
@@ -171,13 +171,10 @@ export default {
 							console.log('phone:', firstRecord.phone)
 							console.log('phone:', firstRecord.phone)
 						}
 						}
 						
 						
-						// 过滤掉空元素,确保数组中不包含 null 或 undefined
-						const validRecords = pageData.records.filter(record => record !== null && record !== undefined)
-						
 						if (this.pageNum === 1) {
 						if (this.pageNum === 1) {
-							this.resources = validRecords
+							this.resources = pageData.records
 						} else {
 						} else {
-							this.resources = this.resources.concat(validRecords)
+							this.resources = this.resources.concat(pageData.records)
 						}
 						}
 						
 						
 						// 判断是否还有更多数据
 						// 判断是否还有更多数据
@@ -241,73 +238,26 @@ export default {
 			})
 			})
 		},
 		},
 		// 牵线聊聊
 		// 牵线聊聊
-		handleChat(resource, index) {
+		handleChat(resource) {
 			console.log('=== 牵线聊聊 ===')
 			console.log('=== 牵线聊聊 ===')
-			console.log('传入的resource:', resource)
-			console.log('传入的index:', index, '类型:', typeof index)
-			console.log('resources数组长度:', this.resources ? this.resources.length : 'resources未定义')
-			
-			// 优先使用传入的 resource 对象,如果为空则通过 index 获取
-			let targetResource = resource
-			
-			// 如果传入的 resource 为空,尝试通过 index 获取
-			if (!targetResource || targetResource === null || targetResource === undefined) {
-				console.warn('⚠️ 传入的resource为空,尝试通过index获取')
-				
-				// 检查 resources 数组是否存在
-				if (!this.resources || !Array.isArray(this.resources)) {
-					console.error('❌ resources数组不存在或不是数组')
-					uni.showToast({
-						title: '资源列表异常,请刷新重试',
-						icon: 'none'
-					})
-					return
-				}
-				
-				// 检查index是否有效
-				if (index === undefined || index === null || isNaN(index) || index < 0 || index >= this.resources.length) {
-					console.error('❌ index无效:', index, '数组长度:', this.resources.length)
-					console.log('resources数组内容:', JSON.stringify(this.resources, null, 2))
-					uni.showToast({
-						title: '资源索引无效',
-						icon: 'none'
-					})
-					return
-				}
-				
-				// 从数组中获取resource对象
-				targetResource = this.resources[index]
-				console.log('从数组获取的resource对象:', targetResource)
-			}
-			
-			console.log('最终使用的resource对象:', targetResource)
-			console.log('资源信息类型:', typeof targetResource)
-			console.log('资源信息是否为null:', targetResource === null)
-			console.log('资源信息是否为undefined:', targetResource === undefined)
-			console.log('资源信息的所有键:', targetResource ? Object.keys(targetResource) : 'resource为空')
+			console.log('资源信息:', resource)
+			console.log('资源信息类型:', typeof resource)
+			console.log('资源信息的所有键:', resource ? Object.keys(resource) : 'resource为空')
 			
 			
 			// 验证 resource 对象是否存在
 			// 验证 resource 对象是否存在
-			if (!targetResource || targetResource === null || targetResource === undefined) {
+			if (!resource) {
 				console.error('❌ resource对象为空')
 				console.error('❌ resource对象为空')
-				console.error('传入的resource:', resource)
-				console.error('传入的index:', index)
-				console.error('resources数组:', JSON.stringify(this.resources, null, 2))
-				if (index !== undefined && index !== null && !isNaN(index) && index >= 0 && index < (this.resources ? this.resources.length : 0)) {
-					console.error('resources[index]:', this.resources[index])
-				}
 				uni.showToast({
 				uni.showToast({
-					title: '资源信息为空,请刷新重试',
-					icon: 'none',
-					duration: 3000
+					title: '资源信息为空',
+					icon: 'none'
 				})
 				})
 				return
 				return
 			}
 			}
 			
 			
-			// 使用 targetResource 继续后续处理
 			// 检查用户是否已注册(只有已注册用户才能聊天)
 			// 检查用户是否已注册(只有已注册用户才能聊天)
 			// 支持下划线和驼峰两种格式
 			// 支持下划线和驼峰两种格式
-			const isUser = targetResource.isUser !== undefined ? targetResource.isUser : 
-			              (targetResource.is_user !== undefined ? targetResource.is_user : 0)
+			const isUser = resource.isUser !== undefined ? resource.isUser : 
+			              (resource.is_user !== undefined ? resource.is_user : 0)
 			if (isUser !== 1 && isUser !== '1') {
 			if (isUser !== 1 && isUser !== '1') {
 				console.warn('⚠️ 用户未注册,无法聊天')
 				console.warn('⚠️ 用户未注册,无法聊天')
 				uni.showToast({
 				uni.showToast({
@@ -322,25 +272,25 @@ export default {
 			let targetUserId = null
 			let targetUserId = null
 			
 			
 			// 方式1: 使用 userId 字段(驼峰格式)
 			// 方式1: 使用 userId 字段(驼峰格式)
-			if (targetResource.userId !== null && targetResource.userId !== undefined && targetResource.userId !== '') {
-				targetUserId = String(targetResource.userId)
-				console.log('✅ 从 targetResource.userId 获取用户ID:', targetUserId)
+			if (resource.userId !== null && resource.userId !== undefined && resource.userId !== '') {
+				targetUserId = String(resource.userId)
+				console.log('✅ 从 resource.userId 获取用户ID:', targetUserId)
 			}
 			}
 			// 方式2: 使用 user_id 字段(下划线格式)
 			// 方式2: 使用 user_id 字段(下划线格式)
-			else if (targetResource.user_id !== null && targetResource.user_id !== undefined && targetResource.user_id !== '') {
-				targetUserId = String(targetResource.user_id)
-				console.log('✅ 从 targetResource.user_id 获取用户ID:', targetUserId)
+			else if (resource.user_id !== null && resource.user_id !== undefined && resource.user_id !== '') {
+				targetUserId = String(resource.user_id)
+				console.log('✅ 从 resource.user_id 获取用户ID:', targetUserId)
 			}
 			}
 			// 方式3: 使用 id 字段
 			// 方式3: 使用 id 字段
-			else if (targetResource.id !== null && targetResource.id !== undefined && targetResource.id !== '') {
-				targetUserId = String(targetResource.id)
-				console.log('✅ 从 targetResource.id 获取用户ID:', targetUserId)
+			else if (resource.id !== null && resource.id !== undefined && resource.id !== '') {
+				targetUserId = String(resource.id)
+				console.log('✅ 从 resource.id 获取用户ID:', targetUserId)
 			}
 			}
 			
 			
 			// 如果仍然没有获取到用户ID
 			// 如果仍然没有获取到用户ID
 			if (!targetUserId || targetUserId === 'null' || targetUserId === 'undefined' || targetUserId === '') {
 			if (!targetUserId || targetUserId === 'null' || targetUserId === 'undefined' || targetUserId === '') {
 				console.error('❌ 无法获取用户ID')
 				console.error('❌ 无法获取用户ID')
-				console.log('targetResource对象完整内容:', JSON.stringify(targetResource, null, 2))
+				console.log('resource对象完整内容:', JSON.stringify(resource, null, 2))
 				uni.showToast({
 				uni.showToast({
 					title: '无法获取用户ID,请刷新重试',
 					title: '无法获取用户ID,请刷新重试',
 					icon: 'none',
 					icon: 'none',
@@ -350,8 +300,8 @@ export default {
 			}
 			}
 			
 			
 			// 获取其他必要信息(支持下划线和驼峰格式)
 			// 获取其他必要信息(支持下划线和驼峰格式)
-			const targetUserName = targetResource.name || '用户'
-			const targetUserAvatar = targetResource.avatarUrl || targetResource.avatar_url || targetResource.avatar || '/static/default-avatar.svg'
+			const targetUserName = resource.name || '用户'
+			const targetUserAvatar = resource.avatarUrl || resource.avatar_url || resource.avatar || '/static/default-avatar.svg'
 			
 			
 			console.log('跳转参数:')
 			console.log('跳转参数:')
 			console.log('  - targetUserId:', targetUserId)
 			console.log('  - targetUserId:', targetUserId)
@@ -496,63 +446,13 @@ export default {
 			
 			
 			try {
 			try {
 				uni.showLoading({
 				uni.showLoading({
-					title: '检查中...'
+					title: '添加中...'
 				})
 				})
 				
 				
 				const baseUrl = process.env.NODE_ENV === 'development' 
 				const baseUrl = process.env.NODE_ENV === 'development' 
 					? 'http://localhost:8083/api'  // 开发环境 - 通过网关
 					? 'http://localhost:8083/api'  // 开发环境 - 通过网关
 					: 'https://your-domain.com/api'  // 生产环境
 					: 'https://your-domain.com/api'  // 生产环境
 				
 				
-				// 获取要添加的手机号和备用手机号
-				const phone = resource.phone
-				const backupPhone = resource.backupPhone || resource.backup_phone
-				
-				// 检查手机号是否已存在(检查整个my_resource表,不限制红娘)
-				const checkUrl = `${baseUrl}/my-resource/check-phone?phone=${encodeURIComponent(phone || '')}${backupPhone ? '&backupPhone=' + encodeURIComponent(backupPhone) : ''}`
-				const [checkError, checkRes] = await uni.request({
-					url: checkUrl,
-					method: 'GET'
-				})
-				
-				if (checkError) {
-					console.error('检查手机号失败:', checkError)
-					uni.hideLoading()
-					uni.showToast({
-						title: '检查手机号失败,请重试',
-						icon: 'none'
-					})
-					return
-				}
-				
-				if (checkRes.statusCode === 200 && checkRes.data && checkRes.data.code === 200) {
-					const checkResult = checkRes.data.data
-					const existingResource = checkResult.existingResource
-					
-					// 如果发现重复的手机号,提示用户
-					if (checkResult.phoneExists || checkResult.backupPhoneExists || checkResult.phoneAsBackupExists || checkResult.backupPhoneAsMainExists) {
-						let message = '该手机号已经绑定资源啦'
-						
-						// 根据不同的检查结果,显示具体的手机号类型
-						if (checkResult.phoneExists) {
-							message = '该主手机号已经绑定资源啦'
-						} else if (checkResult.phoneAsBackupExists) {
-							message = '该主手机号已经作为备用手机号绑定资源啦'
-						} else if (checkResult.backupPhoneAsMainExists) {
-							message = '该备用手机号已经作为主手机号绑定资源啦'
-						} else if (checkResult.backupPhoneExists) {
-							message = '该备用手机号已经绑定资源啦'
-						}
-						
-						uni.hideLoading()
-						uni.showToast({
-							title: message,
-							icon: 'none',
-							duration: 3000
-						})
-						return
-					}
-				}
-				
 				// 构建要添加的资源数据(复制原资源的所有信息,但使用当前红娘的matchmaker_id)
 				// 构建要添加的资源数据(复制原资源的所有信息,但使用当前红娘的matchmaker_id)
 				const resourceData = {
 				const resourceData = {
 					name: resource.name,
 					name: resource.name,
@@ -568,18 +468,14 @@ export default {
 					domicile: resource.domicile,
 					domicile: resource.domicile,
 					occupation: resource.occupation,
 					occupation: resource.occupation,
 					house: resource.house,
 					house: resource.house,
-					phone: phone,
-					backupPhone: backupPhone,
+					phone: resource.phone,
+					backupPhone: resource.backupPhone || resource.backup_phone,
 					car: resource.car,
 					car: resource.car,
 					mateSelectionCriteria: resource.mateSelectionCriteria || resource.mate_selection_criteria,
 					mateSelectionCriteria: resource.mateSelectionCriteria || resource.mate_selection_criteria,
 					isUser: resource.isUser || resource.is_user || 1,
 					isUser: resource.isUser || resource.is_user || 1,
 					userId: resource.userId || resource.user_id
 					userId: resource.userId || resource.user_id
 				}
 				}
 				
 				
-				uni.showLoading({
-					title: '添加中...'
-				})
-				
 				// 获取标签ID列表
 				// 获取标签ID列表
 				let tagIds = []
 				let tagIds = []
 				
 				

+ 17 - 0
LiangZhiYUMao/pages/message/chat.vue

@@ -464,6 +464,23 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+    /**
+     * 根据语音时长计算语音气泡宽度
+     */
+    getVoiceWidth(duration) {
+      // 基础宽度 + 时长比例计算的宽度
+      // 例如:60px 基础宽度 + 每秒钟 2px 的宽度增量
+      const baseWidth = 60;
+      const perSecondWidth = 2;
+      const maxWidth = 180;
+      
+      // 确保时长是数字类型
+      const durationNum = parseInt(duration) || 0;
+      
+      // 计算宽度并限制最大宽度
+      const width = Math.min(baseWidth + durationNum * perSecondWidth, maxWidth);
+      return width + 'px';
+    },
     /**
     /**
      * 红娘入口:根据当前登录用户ID获取红娘资料并设置头像
      * 红娘入口:根据当前登录用户ID获取红娘资料并设置头像
      */
      */

+ 1 - 1
LiangZhiYUMao/pages/plaza/index.vue

@@ -177,7 +177,7 @@ export default {
 			noMore: false,
 			noMore: false,
 			showMenu: false, // 显示举报菜单
 			showMenu: false, // 显示举报菜单
 			selectedDynamic: null, // 选中的动态
 			selectedDynamic: null, // 选中的动态
-			currentUserId: 1, // 当前用户ID,实际应从存储获取
+			currentUserId: uni.getStorageInfoSync("userId"), // 当前用户ID,实际应从存储获取
 			defaultAvatar: 'https://via.placeholder.com/100x100.png?text=头像',
 			defaultAvatar: 'https://via.placeholder.com/100x100.png?text=头像',
 			likingMap: {},  // 记录正在点赞的动态ID,防止重复点击
 			likingMap: {},  // 记录正在点赞的动态ID,防止重复点击
 			favoritingMap: {}  // 记录正在收藏的动态ID,防止重复点击
 			favoritingMap: {}  // 记录正在收藏的动态ID,防止重复点击

+ 1 - 1
LiangZhiYUMao/pages/vip/index.vue

@@ -141,7 +141,7 @@
 				}
 				}
 				
 				
 				uni.request({
 				uni.request({
-					url: this.gatewayURL + '/api/vip/info',
+					url: this.gatewayURL + '/api/vip/inf',
 					method: 'GET',
 					method: 'GET',
 					data: params,
 					data: params,
 					success: (res) => {
 					success: (res) => {

+ 4 - 4
LiangZhiYUMao/utils/api.js

@@ -5,7 +5,7 @@
 // 开发环境和生产环境的 API 基础地址
 // 开发环境和生产环境的 API 基础地址
 // 所有请求通过网关转发
 // 所有请求通过网关转发
 const BASE_URL = process.env.NODE_ENV === 'development' 
 const BASE_URL = process.env.NODE_ENV === 'development' 
-  ? 'http://localhost:8083/api'  // 开发环境 - 通过网关
+  ? 'http://172.20.10.2:8083/api'  // 开发环境 - 通过网关
   : 'https://your-domain.com/api'  // 生产环境
   : 'https://your-domain.com/api'  // 生产环境
 
 
 /**
 /**
@@ -148,7 +148,7 @@ export default {
     // 密码登录(手机号+密码)
     // 密码登录(手机号+密码)
     loginByPassword: (phone, password) => request({
     loginByPassword: (phone, password) => request({
       // 直连 login 服务(开发环境),避免网关未配置导致未路由
       // 直连 login 服务(开发环境),避免网关未配置导致未路由
-      url: 'http://localhost:8087/api/login/password',
+      url: 'http://172.20.10.2:8087/api/login/password',
       method: 'POST',
       method: 'POST',
       data: { phone, password }
       data: { phone, password }
     }),
     }),
@@ -169,14 +169,14 @@ export default {
 
 
     // 微信登录(直连 login 服务)
     // 微信登录(直连 login 服务)
     wechatLogin: (data) => request({
     wechatLogin: (data) => request({
-      url: 'http://localhost:8087/api/login/wechat/login',
+      url: 'http://172.20.10.2:8087/api/login/wechat/login',
       method: 'POST',
       method: 'POST',
       data: data  // ✅ 传递完整的登录数据对象(包含code, nickname, avatarUrl, phoneCode)
       data: data  // ✅ 传递完整的登录数据对象(包含code, nickname, avatarUrl, phoneCode)
     }),
     }),
 
 
     // 获取微信手机号(直连 login 服务)
     // 获取微信手机号(直连 login 服务)
     wechatPhone: (code) => request({
     wechatPhone: (code) => request({
-      url: 'http://localhost:8087/api/login/wechat/phone',
+      url: 'http://172.20.10.2:8087/api/login/wechat/phone',
       method: 'POST',
       method: 'POST',
       data: { code }
       data: { code }
     })
     })

+ 2 - 2
LiangZhiYUMao/utils/chat-api.js

@@ -2,7 +2,7 @@
  * 聊天相关API接口封装
  * 聊天相关API接口封装
  */
  */
 
 
-const CHAT_BASE_URL = 'http://localhost:8083/api/chat';
+const CHAT_BASE_URL = 'http://172.20.10.2:8083/api/chat';
 
 
 /**
 /**
  * 统一的聊天请求封装
  * 统一的聊天请求封装
@@ -105,7 +105,7 @@ export function checkOnlineStatus(userId) {
 export function uploadChatMedia(filePath) {
 export function uploadChatMedia(filePath) {
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
     uni.uploadFile({
     uni.uploadFile({
-      url: 'http://localhost:8083/api/upload',  // 使用homePage服务的上传接口
+      url: 'http://172.20.10.2:8083/api/upload',  // 使用homePage服务的上传接口
       filePath: filePath,
       filePath: filePath,
       name: 'file',
       name: 'file',
       success: (res) => {
       success: (res) => {

+ 2 - 2
LiangZhiYUMao/utils/tim-presence-manager.js

@@ -20,7 +20,7 @@ class TIMPresenceManager {
     this.userId = null;
     this.userId = null;
     this.statusCallbacks = new Map(); // 存储状态变化回调
     this.statusCallbacks = new Map(); // 存储状态变化回调
     this.onlineStatusCache = new Map(); // 缓存在线状态
     this.onlineStatusCache = new Map(); // 缓存在线状态
-    this.wsUrl = 'ws://localhost:8083/ws/chat';
+    this.wsUrl = 'ws://172.20.10.2:8083/ws/chat';
     
     
     // TIM 状态监听器引用(用于清理)
     // TIM 状态监听器引用(用于清理)
     this.timStatusListener = null;
     this.timStatusListener = null;
@@ -401,7 +401,7 @@ class TIMPresenceManager {
     for (const userId of userIdList) {
     for (const userId of userIdList) {
       try {
       try {
         const [err, res] = await uni.request({
         const [err, res] = await uni.request({
-          url: 'http://localhost:8083/api/online/checkStatus',
+          url: 'http://172.20.10.2:8083/api/online/checkStatus',
           method: 'GET',
           method: 'GET',
           data: { userId }
           data: { userId }
         });
         });

+ 1 - 1
LiangZhiYUMao/utils/websocket.js

@@ -33,7 +33,7 @@ class WebSocketManager {
    * @param {Number} userId 用户ID
    * @param {Number} userId 用户ID
    * @param {String} baseUrl WebSocket服务地址
    * @param {String} baseUrl WebSocket服务地址
    */
    */
-  connect(userId, baseUrl = 'ws://localhost:8083') {
+  connect(userId, baseUrl = 'ws://172.20.10.2:8083') {
     if (this.isConnected) {
     if (this.isConnected) {
       if (DEBUG_WS) console.log('WebSocket已连接');
       if (DEBUG_WS) console.log('WebSocket已连接');
       return;
       return;

+ 1 - 1
gateway/src/main/resources/application.yml

@@ -133,7 +133,7 @@ spring:
         - id: essential-route
         - id: essential-route
           uri: http://localhost:1005
           uri: http://localhost:1005
           predicates:
           predicates:
-            - Path=/api/user/**, /api/checkin/**
+            - Path=/api/user/**, /api/checkin/**, /api/vip/**
           filters:
           filters:
             - StripPrefix=0
             - StripPrefix=0
         
         

+ 1 - 1
service/Essential/src/main/java/com/zhentao/controller/VipController.java

@@ -28,7 +28,7 @@ public class VipController {
      * @param userId 用户ID(可选,不传则默认为1)
      * @param userId 用户ID(可选,不传则默认为1)
      * @return VIP信息
      * @return VIP信息
      */
      */
-    @GetMapping("/info")
+    @GetMapping("/inf")
     public Result<UserVipInfoVO> getVipInfo(@RequestParam(required = false) Long userId) {
     public Result<UserVipInfoVO> getVipInfo(@RequestParam(required = false) Long userId) {
         try {
         try {
             // 如果没有传userId,默认使用1
             // 如果没有传userId,默认使用1

+ 16 - 2
service/websocket/src/main/java/com/zhentao/controller/ChatController.java

@@ -9,6 +9,7 @@ import com.zhentao.service.MatchmakerChatMessageService;
 import com.zhentao.service.OnlineUserService;
 import com.zhentao.service.OnlineUserService;
 import com.zhentao.service.UserVipService;
 import com.zhentao.service.UserVipService;
 import com.zhentao.utils.ContactFilter;
 import com.zhentao.utils.ContactFilter;
+import com.zhentao.dto.BlockDto;
 import com.zhentao.vo.ResultVo;
 import com.zhentao.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -33,6 +34,9 @@ public class ChatController {
     
     
     @Autowired
     @Autowired
     private com.zhentao.repository.ChatConversationMapper conversationMapper;
     private com.zhentao.repository.ChatConversationMapper conversationMapper;
+    
+    @Autowired
+    private com.zhentao.service.ChatConversationService conversationService;
 
 
     @Autowired
     @Autowired
     private UserVipService userVipService;
     private UserVipService userVipService;
@@ -205,8 +209,18 @@ public class ChatController {
             Long userId = params.get("userId");
             Long userId = params.get("userId");
             Long targetUserId = params.get("targetUserId");
             Long targetUserId = params.get("targetUserId");
             
             
-            // TODO: 实现会话删除
-            // conversationService.deleteConversation(userId, targetUserId);
+            // 验证参数
+            if (userId == null || targetUserId == null) {
+                result.put("code", 400);
+                result.put("message", "用户ID和目标用户ID不能为空");
+                return result;
+            }
+            
+            // 调用服务层删除会话
+            BlockDto blockDto = new BlockDto();
+            blockDto.setUserId(userId);
+            blockDto.setTargetUserId(targetUserId);
+            conversationService.deleteChatConversation(blockDto);
             
             
             result.put("code", 200);
             result.put("code", 200);
             result.put("message", "删除成功");
             result.put("message", "删除成功");