From 06554101349a3de916d70da123b25e5499d89881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=B9=E5=B0=BC=E5=B0=94?= Date: Tue, 10 Mar 2026 17:29:22 +0800 Subject: [PATCH] fix:bug --- .env | 3 + .env.example | 5 +- Dockerfile | 10 +- public/index.html | 918 ++++++++++++++++++++++++++++++++++++++++++++++ src/server.ts | 4 + 5 files changed, 935 insertions(+), 5 deletions(-) create mode 100644 .env create mode 100644 public/index.html diff --git a/.env b/.env new file mode 100644 index 0000000..6bdc5f8 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +PORT=3000 +WECHAT_UPSTREAM_BASE_URL=http://113.44.162.180:7006 + diff --git a/.env.example b/.env.example index c171ea3..a8a31d9 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,6 @@ PORT=3000 -WECHAT_UPSTREAM_BASE_URL=http://your-wechat-server-host:port +WECHAT_UPSTREAM_BASE_URL=http://113.44.162.180:7006 + +# KEY = HBpEnbtj9BJZ +# password = 408449830 diff --git a/Dockerfile b/Dockerfile index 43a8997..dd5c2e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine AS build +FROM docker.m.daocloud.io/library/node:20-alpine AS build WORKDIR /app @@ -8,10 +8,11 @@ RUN npm install COPY tsconfig.json ./tsconfig.json COPY src ./src +COPY public ./public RUN npm run build -FROM node:20-alpine AS runtime +FROM docker.m.daocloud.io/library/node:20-alpine AS runtime WORKDIR /app @@ -19,9 +20,10 @@ ENV NODE_ENV=production COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/dist ./dist -COPY .env.example ./ ./ +COPY --from=build /app/public ./public +COPY .env.example ./ EXPOSE 3000 -CMD [\"node\", \"dist/server.js\"] +CMD ["node", "dist/server.js"] diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..e4467d9 --- /dev/null +++ b/public/index.html @@ -0,0 +1,918 @@ + + + + + 微信登录管理面板 + + + + + +
+
+
+
+
+
+ 微信登录控制台 + Admin · iPad / Mac 直登 +
+
+ 按文档流程封装的可视化工具:生成二维码 · 轮询扫码 · 查看在线状态 · 一键退出登录 +
+
+
+
+ + 后端状态:检测中... +
+
+
+ +
+
登录参数
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ +
+ + + + +
+ +
+ 通过 /api/auth/qrcode 代理 swagger 登录接口 + 无需直接暴露 8069 服务 +
+
+ +
+
+ 操作日志 + +
+
+
+
+ + +
+
+ + + + + diff --git a/src/server.ts b/src/server.ts index fb41c34..9029dd5 100644 --- a/src/server.ts +++ b/src/server.ts @@ -2,6 +2,7 @@ import express from 'express'; import cors from 'cors'; import morgan from 'morgan'; import dotenv from 'dotenv'; +import path from 'path'; import { authRouter } from './wechatAuth'; @@ -13,6 +14,9 @@ app.use(cors()); app.use(express.json()); app.use(morgan('dev')); +const publicDir = path.join(__dirname, '../public'); +app.use(express.static(publicDir)); + app.get('/health', (_req, res) => { res.json({ status: 'ok' }); });