hookehuyr

fix: 修复评论显示匿名用户和登出时清除cookie问题

- 在课程详情页中,当评论者姓名为空时显示"匿名用户"
- 登出时增加清除currentUser cookie的逻辑
- 移除活动卡片中不再需要的位置信息显示
<!--
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-11 16:28:41
* @LastEditTime: 2025-12-04 10:40:05
* @FilePath: /mlaj/src/components/ui/ActivityCard.vue
* @Description: 文件描述
-->
......@@ -38,13 +38,13 @@
<!-- Location and Time -->
<div class="text-xs text-gray-500 space-y-1">
<div class="flex items-center">
<!-- <div class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
<span>{{ activity.location }}</span>
</div>
</div> -->
<div class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
......
......@@ -179,7 +179,7 @@
<div class="space-y-4">
<div v-for="(item, index) in commentList" :key="index" class="border-b border-gray-100 pb-3">
<div class="flex justify-between">
<div class="font-medium text-gray-800">{{ item.name }}</div>
<div class="font-medium text-gray-800">{{ item.name || '匿名用户' }}</div>
<div class="text-xs text-gray-500">{{ formatDate(item.created_time) }}</div>
</div>
<p class="text-sm text-gray-600 mt-1">
......
<!--
* @Date: 2025-03-24 13:04:21
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-03 11:50:30
* @LastEditTime: 2025-12-04 10:32:03
* @FilePath: /mlaj/src/views/profile/SettingsPage.vue
* @Description: 用户设置页面
-->
......@@ -149,6 +149,7 @@ const handleLogout = () => {
.then(() => {
// 确认退出
document.cookie = 'PHPSESSID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie = 'currentUser=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
logout(); // Clear any other auth state if present
showToast('已退出登录');
router.replace('/');
......