fix(c2c): 修复水单上传权限、手机号显示、卖方ID显示
- Dockerfile 预创建 /app/uploads/c2c-proofs 并设置正确权限 - JWT guard 从 token payload 提取 phone 字段(之前仅提取 accountSequence) - 订单详情页订单信息组新增卖方ID显示 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
25ea0bf64e
commit
e783661002
|
|
@ -24,7 +24,7 @@ RUN addgroup --system --gid 1001 nodejs && \
|
||||||
|
|
||||||
RUN apk add --no-cache curl tzdata openssl
|
RUN apk add --no-cache curl tzdata openssl
|
||||||
|
|
||||||
RUN mkdir -p /app && chown nestjs:nodejs /app
|
RUN mkdir -p /app /app/uploads/c2c-proofs && chown -R nestjs:nodejs /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
USER nestjs
|
USER nestjs
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,10 @@ export class JwtAuthGuard implements CanActivate {
|
||||||
try {
|
try {
|
||||||
const secret = this.configService.get<string>('JWT_SECRET', 'default-secret');
|
const secret = this.configService.get<string>('JWT_SECRET', 'default-secret');
|
||||||
const payload = jwt.verify(token, secret) as any;
|
const payload = jwt.verify(token, secret) as any;
|
||||||
request.user = { accountSequence: payload.sub };
|
request.user = {
|
||||||
|
accountSequence: payload.sub,
|
||||||
|
phone: payload.phone,
|
||||||
|
};
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
throw new UnauthorizedException('Invalid token');
|
throw new UnauthorizedException('Invalid token');
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,11 @@ class _C2cOrderDetailPageState extends ConsumerState<C2cOrderDetailPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
_buildInfoRow('订单编号', order.orderNo, canCopy: true),
|
_buildInfoRow('订单编号', order.orderNo, canCopy: true),
|
||||||
|
// 卖方收款ID(卖单=maker,买单=taker)
|
||||||
|
if (order.isSell)
|
||||||
|
_buildInfoRow('卖方ID', order.makerAccountSequence, canCopy: true)
|
||||||
|
else if (order.takerAccountSequence != null)
|
||||||
|
_buildInfoRow('卖方ID', order.takerAccountSequence!, canCopy: true),
|
||||||
_buildInfoRow('单价', '${formatPrice(order.price)} 积分值'),
|
_buildInfoRow('单价', '${formatPrice(order.price)} 积分值'),
|
||||||
_buildInfoRow('数量', '${formatAmount(order.quantity)} 积分值'),
|
_buildInfoRow('数量', '${formatAmount(order.quantity)} 积分值'),
|
||||||
_buildInfoRow('总金额', '${formatAmount(order.totalAmount)} 积分值'),
|
_buildInfoRow('总金额', '${formatAmount(order.totalAmount)} 积分值'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue