# 清除旧localStorage数据脚本

echo "=== 清除旧localStorage数据 ==="
echo "已修改token存储方式：从localStorage改为sessionStorage"
echo "现在关闭页面时token会自动清除"

echo -e "\n🔧 清除步骤："
echo "1. 打开浏览器开发者工具 (F12)"
echo "2. 进入 Console 标签页"
echo "3. 执行以下命令清除旧的localStorage数据："
echo ""
echo "localStorage.removeItem('token')"
echo "localStorage.removeItem('user')"
echo "console.log('已清除localStorage中的旧数据')"
echo ""
echo "4. 然后重新登录："
echo "   - 用户名: admin"
echo "   - 密码: admin123"
echo ""
echo "✅ 修改内容："
echo "- token和用户信息现在存储在sessionStorage中"
echo "- 关闭页面时自动清除，提高安全性"
echo "- 刷新页面时保持登录状态"
echo "- 401错误时自动清除sessionStorage"
