fix(c2c): 修复水单上传权限、手机号、卖方ID、资产显示
- Dockerfile: 用 su-exec 模式解决 Docker volume 权限问题 - JWT guard: 从 token 提取 phone 字段 - 订单详情: 新增卖方ID显示 - C2C市场页: 修复资产概览两列重复显示 availableCash, 改为左列显示可用积分股、右列显示可用积分值 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e783661002
commit
f60e3751b8
|
|
@ -22,9 +22,9 @@ FROM node:20-alpine AS runner
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 -G nodejs nestjs
|
adduser --system --uid 1001 -G nodejs nestjs
|
||||||
|
|
||||||
RUN apk add --no-cache curl tzdata openssl
|
RUN apk add --no-cache curl tzdata openssl su-exec
|
||||||
|
|
||||||
RUN mkdir -p /app /app/uploads/c2c-proofs && chown -R nestjs:nodejs /app
|
RUN mkdir -p /app && chown nestjs:nodejs /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
USER nestjs
|
USER nestjs
|
||||||
|
|
@ -37,7 +37,9 @@ RUN DATABASE_URL="postgresql://user:pass@localhost:5432/db" npx prisma generate
|
||||||
|
|
||||||
COPY --chown=nestjs:nodejs --from=builder /app/dist ./dist
|
COPY --chown=nestjs:nodejs --from=builder /app/dist ./dist
|
||||||
|
|
||||||
RUN printf '#!/bin/sh\nset -e\necho "Running database migrations..."\nnpx prisma migrate deploy\necho "Starting application..."\nexec node dist/main.js\n' > /app/start.sh && chmod +x /app/start.sh
|
# entrypoint 以 root 启动 → 修复 volume 权限 → 降权到 nestjs 运行
|
||||||
|
USER root
|
||||||
|
RUN printf '#!/bin/sh\nset -e\n# 修复 Docker volume 挂载权限(volume 首次由 root 创建)\nmkdir -p /app/uploads/c2c-proofs\nchown -R nestjs:nodejs /app/uploads\n# 以 nestjs 用户运行\necho "Running database migrations..."\nsu-exec nestjs npx prisma migrate deploy\necho "Starting application..."\nexec su-exec nestjs node dist/main.js\n' > /app/start.sh && chmod +x /app/start.sh
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
|
||||||
|
|
@ -127,12 +127,12 @@ class _C2cMarketPageState extends ConsumerState<C2cMarketPage>
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'可用积分值',
|
'可用积分股',
|
||||||
style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context)),
|
style: TextStyle(fontSize: 12, color: AppColors.textSecondaryOf(context)),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
formatAmount(availableCash),
|
formatAmount(availableShares),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue