diff --git a/Dockerfile b/Dockerfile index 281457c..e014299 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# 使用官方 Node.js 18 Alpine 镜像作为基础镜像 -FROM node:18-alpine AS base +# 使用官方 Node.js 22 Alpine 镜像作为基础镜像 +FROM node:22-alpine AS base # 构建参数 ARG GIT_COMMIT="" @@ -30,7 +30,7 @@ COPY . . RUN npm run build # 生产阶段 -FROM node:18-alpine AS production +FROM node:22-alpine AS production # 设置环境变量 ENV NODE_ENV=production # 创建非root用户 @@ -52,4 +52,4 @@ EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3000/health || exit 1 # 启动应用 -CMD ["node", "dist/main"] +CMD ["node", "dist/src/main"] diff --git a/src/platform/adapters/wechat.adapter.ts b/src/platform/adapters/wechat.adapter.ts index 771cfbc..cc40cee 100644 --- a/src/platform/adapters/wechat.adapter.ts +++ b/src/platform/adapters/wechat.adapter.ts @@ -14,6 +14,7 @@ import { PlatformUserInfo, TokenRefreshResult, } from '../interfaces/platform.interface'; +import crypto from 'crypto'; interface WechatAuthResponse { openid: string; @@ -227,7 +228,6 @@ export class WechatAdapter extends BaseAdapter { ): WechatUserInfo { // 实现微信用户信息解密逻辑 // 使用crypto模块进行AES解密 - const crypto = require('crypto'); const decipher = crypto.createDecipheriv( 'aes-128-cbc', Buffer.from(sessionKey, 'base64'), diff --git a/tsconfig.json b/tsconfig.json index aba29b0..29fdc48 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,7 @@ "forceConsistentCasingInFileNames": true, "noImplicitAny": false, "strictBindCallApply": false, - "noFallthroughCasesInSwitch": false + "noFallthroughCasesInSwitch": false, + "types": ["node"] } }