QUICK_START.md 3.23 KB

🚀 快速启动指南

⚡ 一句话启动

macOS/Linux

cd /Users/hexiaodong/Desktop/git/erp2025/Antis.Erp.Plat/sy && python3 -m http.server 8888

Windows

cd C:\Users\hexiaodong\Desktop\git\erp2025\Antis.Erp.Plat\sy && python -m http.server 8888

📱 访问地址

打开浏览器,访问以下地址:

页面 URL
🔐 登录页 http://localhost:8888/login.html
🛒 商品列表 http://localhost:8888/home.html
💳 收银台 http://localhost:8888/settlement.html
👤 会员管理 http://localhost:8888/member.html

🎯 核心功能速记

登录页面

1. 输入用户名
2. 输入密码
3. 选择门店
4. 点击「登录」

收银台快捷键

按键 功能
E 整单折扣
R 整单改价
U 抹零
SPACE 收款
ESC 返回

🔗 后端API

基础地址: https://www.ponggame.cn

核心接口

POST   /api/oauth/Login                      # 登录
GET    /api/oauth/CurrentUser                # 获取当前用户
GET    /api/permission/Users                 # 用户列表
GET    /api/Extend/WtMd                      # 门店列表
GET    /api/Extend/WtSp                      # 商品列表
GET    /api/Extend/wthy/{id}                 # 会员信息
POST   /api/Extend/wtxsckd                   # 提交订单

📊 数据存储

所有数据存储在浏览器 localStorage

localStorage.getItem('token')           // 访问令牌
localStorage.getItem('userId')          // 用户ID
localStorage.getItem('username')        // 用户名
localStorage.getItem('selectedStore')   // 门店信息
localStorage.getItem('addgoodlist')     // 购物清单
localStorage.getItem('hyinfo')          // 会员信息
localStorage.getItem('ckinfo')          // 仓库信息

🐛 调试技巧

查看 localStorage

// 在浏览器控制台输入
JSON.stringify(localStorage, null, 2)

查看网络请求

// F12 打开开发者工具
// 切换到 Network 标签
// 监控所有 API 调用

清空缓存重新登录

// 在浏览器控制台输入
localStorage.clear()
location.reload()

✅ 验证清单

  • [ ] 服务器启动成功(端口 8888)
  • [ ] 能访问 http://localhost:8888/login.html
  • [ ] 后端 API 在线(https://www.ponggame.cn)
  • [ ] 用户名/密码正确
  • [ ] 门店已选择
  • [ ] 登录成功,跳转到商品列表
  • [ ] 能添加商品到购物车
  • [ ] 能进入收银台
  • [ ] 支付方式选择正常
  • [ ] 订单提交成功

💡 常见错误排查

错误 原因 解决方案
无法访问 localhost:8888 服务未启动 重新运行启动命令
CORS 错误 跨域请求被拒 检查后端CORS配置
登录失败 用户名/密码错 确认凭证并重试
商品列表空 API未返回数据 检查网络和后端
localStorage 报错 浏览器禁用存储 检查隐私设置

📞 联系方式


最后更新: 2025-01-01
版本: 1.0.0