fix: 修复绑定微信二维码生成时未登录用户的异常提示

This commit is contained in:
ccnetcore
2025-08-30 18:02:46 +08:00
parent 1c54e47b9e
commit 1b00e505b7

View File

@@ -140,6 +140,11 @@ public class FuwuhaoService : ApplicationService
[HttpPost("fuwuhao/qrcode")]
public async Task<QrCodeOutput> GetQrCodeAsync([FromQuery] SceneTypeEnum sceneType)
{
if (sceneType == SceneTypeEnum.Bind && CurrentUser.Id is null)
{
throw new UserFriendlyException("绑定微信,需登录用户,请重新登录后重试");
}
//生成一个随机场景值
var scene = Guid.NewGuid().ToString("N");
var qrCodeUrl = await _fuwuhaoManager.CreateQrCodeAsync(scene);