From 8aa7a348956f93c40f55e2df6214fa49efca211e Mon Sep 17 00:00:00 2001 From: maoshen Date: Wed, 15 Apr 2026 03:16:38 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=9A=E7=94=A8=E6=88=B7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8F=91=E5=B8=83=EF=BC=88=E7=99=BB=E5=BD=95/?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=20+=20=E6=95=B0=E6=8D=AE=E9=9A=94=E7=A6=BB?= =?UTF-8?q?=20+=20=E7=AE=80=E5=8C=96=E5=89=8D=E7=AB=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy_multiuser.sh | 56 ++++++++++++ frontend-react/public/index.html | 14 +++ frontend/dashboard.html | 125 ++++++++++++++++++++++++++ frontend/login.html | 149 +++++++++++++++++++++++++++++++ 4 files changed, 344 insertions(+) create mode 100644 deploy_multiuser.sh create mode 100644 frontend-react/public/index.html create mode 100644 frontend/dashboard.html create mode 100644 frontend/login.html diff --git a/deploy_multiuser.sh b/deploy_multiuser.sh new file mode 100644 index 0000000..d03fb9c --- /dev/null +++ b/deploy_multiuser.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# 多用户系统 - 部署脚本 + +set -e + +echo "======================================" +echo "🚀 部署多用户日记系统" +echo "======================================" + +cd /home/ubuntu/diary-system + +# 1. 安装依赖 +echo "📦 安装 Python 依赖..." +cd backend +pip3 install -r requirements.txt -q 2>/dev/null || pip3 install -r requirements.txt --break-system-packages -q + +# 2. 数据库迁移 +echo "🗄️ 执行数据库迁移..." +python3 manage.py migrate --run-syncdb + +# 3. 迁移现有数据到默认用户 +echo "📦 迁移现有数据..." +python3 ../migrate_data.py + +# 4. 重启 Gunicorn +echo "⚙️ 重启 Gunicorn..." +sudo systemctl restart diary-system + +# 5. 检查服务状态 +echo "" +echo "🔍 检查服务状态..." +sudo systemctl is-active diary-system > /dev/null && echo " ✅ Gunicorn 运行中" || echo " ❌ Gunicorn 未运行" + +# 6. 测试访问 +echo "" +echo "🧪 测试访问..." +sleep 2 +if curl -s http://127.0.0.1:8002/api/auth/me/ > /dev/null 2>&1; then + echo " ✅ 认证 API 正常" +else + echo " ⚠️ 认证 API 可能有问题" +fi + +echo "" +echo "======================================" +echo "✅ 部署完成!" +echo "======================================" +echo "" +echo "📍 访问地址:http://cssc.datalibstar.com:8001/" +echo "" +echo "📝 默认用户:" +echo " 用户名:beijixing" +echo " 密码:beijixing123" +echo "" +echo "💡 其他用户可以注册新账号使用" +echo "" diff --git a/frontend-react/public/index.html b/frontend-react/public/index.html new file mode 100644 index 0000000..bce28cc --- /dev/null +++ b/frontend-react/public/index.html @@ -0,0 +1,14 @@ + + + + + + + + 码神的日记系统 + + + +
+ + diff --git a/frontend/dashboard.html b/frontend/dashboard.html new file mode 100644 index 0000000..c4e8b2f --- /dev/null +++ b/frontend/dashboard.html @@ -0,0 +1,125 @@ + + + + + + 码神的日记系统 - 仪表盘 + + + +
+
+

⚡ 码神的日记系统

+

记录每天的进步与成长

+
+ + + +
+

🎉 多用户系统已上线!

+

你现在可以:

+
+
+ 📝 写日记 - 记录每天的任务、学到的东西、反思和进步 +
+
+ 📅 日历视图 - 通过日历快速查看历史日记 +
+
+ 💡 经验总结 - 记录遇到的问题和解决方案 +
+
+ 📊 任务管理 - 追踪任务进展和完成率 +
+
+ 🔒 数据隔离 - 每个用户的数据完全独立 +
+
+

+ React 前端正在构建中,当前使用简化版界面
+ 完整功能即将上线... +

+
+
+ + + + diff --git a/frontend/login.html b/frontend/login.html new file mode 100644 index 0000000..95a63d2 --- /dev/null +++ b/frontend/login.html @@ -0,0 +1,149 @@ + + + + + + 码神的日记系统 - 登录 + + + +
+

⚡ 码神的日记系统

+

登录

+ +
+ +
+
+ + +
+ +
+ + +
+ + +
+ +

+ 默认账号:beijixing / beijixing123 +

+
+ + + +