微信校验后登录服务器错误bug
This commit is contained in:
@@ -28,7 +28,7 @@ WX_MCH_PRIVATE_KEY=
|
|||||||
WX_API_V3_KEY=
|
WX_API_V3_KEY=
|
||||||
# 微信平台公钥证书 PEM(生产环境必填,用于回调验签;开发可暂留空)
|
# 微信平台公钥证书 PEM(生产环境必填,用于回调验签;开发可暂留空)
|
||||||
WX_PLATFORM_CERT=
|
WX_PLATFORM_CERT=
|
||||||
WX_PAY_NOTIFY_URL=https://your-domain.com/api/v1/callbacks/wechat/pay
|
WX_PAY_NOTIFY_URL=https://dkapi.runxian.top/api/v1/callbacks/wechat/pay
|
||||||
|
|
||||||
# 阿里云 OSS(ali-oss@6.x;OSS_ENABLED=true 且下方密钥齐全时生效;否则 Mock 占位 URL)
|
# 阿里云 OSS(ali-oss@6.x;OSS_ENABLED=true 且下方密钥齐全时生效;否则 Mock 占位 URL)
|
||||||
# RAM 用户需具备 PutObject 权限;可在控制台 Bucket 授权策略中为该 RAM UID 授予读写
|
# RAM 用户需具备 PutObject 权限;可在控制台 Bucket 授权策略中为该 RAM UID 授予读写
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ WX_MCH_SERIAL_NO=
|
|||||||
WX_MCH_PRIVATE_KEY=
|
WX_MCH_PRIVATE_KEY=
|
||||||
WX_API_V3_KEY=
|
WX_API_V3_KEY=
|
||||||
WX_PLATFORM_CERT=
|
WX_PLATFORM_CERT=
|
||||||
WX_PAY_NOTIFY_URL=https://api.lingshivip.cn/api/v1/callbacks/wechat/pay
|
WX_PAY_NOTIFY_URL=https://dkapi.runxian.top/api/v1/callbacks/wechat/pay
|
||||||
|
|
||||||
OSS_ENABLED=true
|
OSS_ENABLED=true
|
||||||
OSS_ACCESS_KEY_ID=
|
OSS_ACCESS_KEY_ID=
|
||||||
OSS_ACCESS_KEY_SECRET=
|
OSS_ACCESS_KEY_SECRET=
|
||||||
OSS_BUCKET=dukang-prod
|
OSS_BUCKET=dukang-prod
|
||||||
OSS_REGION=oss-cn-beijing
|
OSS_REGION=oss-cn-beijing
|
||||||
OSS_CDN_BASE=https://lingshivip.cn
|
OSS_CDN_BASE=https://dukang-prod.oss-cn-beijing.aliyuncs.com
|
||||||
OSS_UPLOAD_PREFIX=uploads
|
OSS_UPLOAD_PREFIX=uploads
|
||||||
OSS_UPLOAD_EXPIRE_SECONDS=900
|
OSS_UPLOAD_EXPIRE_SECONDS=900
|
||||||
OSS_MAX_UPLOAD_BYTES=10485760
|
OSS_MAX_UPLOAD_BYTES=10485760
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import { SMS_PROVIDER, WECHAT_PROVIDER } from '../../integrations/integrations.c
|
|||||||
import { ISmsProvider } from '../../integrations/sms/sms.interface';
|
import { ISmsProvider } from '../../integrations/sms/sms.interface';
|
||||||
import type { IWechatProvider } from '../../integrations/wechat/wechat.interface';
|
import type { IWechatProvider } from '../../integrations/wechat/wechat.interface';
|
||||||
import { serializeBigInt } from '../../common/decorators/current-user.decorator';
|
import { serializeBigInt } from '../../common/decorators/current-user.decorator';
|
||||||
import type { Prisma } from '@prisma/client';
|
|
||||||
|
|
||||||
import type { User } from '@prisma/client';
|
import type { User } from '@prisma/client';
|
||||||
|
|
||||||
@@ -584,12 +583,12 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const primaryUpdate: Prisma.UserUpdateInput = {};
|
const deviceKeyToTransfer =
|
||||||
if (guest.deviceKey && !primary.deviceKey) {
|
guest.deviceKey && !primary.deviceKey ? guest.deviceKey : null;
|
||||||
primaryUpdate.deviceKey = guest.deviceKey;
|
if (deviceKeyToTransfer) {
|
||||||
}
|
// 先清空访客 deviceKey,避免 uk_user_user_device_key 冲突
|
||||||
if (Object.keys(primaryUpdate).length > 0) {
|
await tx.user.update({ where: { id: guestId }, data: { deviceKey: null } });
|
||||||
await tx.user.update({ where: { id: primaryId }, data: primaryUpdate });
|
await tx.user.update({ where: { id: primaryId }, data: { deviceKey: deviceKeyToTransfer } });
|
||||||
}
|
}
|
||||||
|
|
||||||
await tx.user.update({
|
await tx.user.update({
|
||||||
|
|||||||
Reference in New Issue
Block a user