|
|
@ -515,21 +515,22 @@ namespace GDZZ.Application.Service.Auth
|
|
|
|
var fileName = Path.Combine("/"+ UserManager.UserId +".png");
|
|
|
|
var fileName = Path.Combine("/"+ UserManager.UserId +".png");
|
|
|
|
if (!Directory.Exists(_options.QRCode.path))
|
|
|
|
if (!Directory.Exists(_options.QRCode.path))
|
|
|
|
Directory.CreateDirectory(_options.QRCode.path);
|
|
|
|
Directory.CreateDirectory(_options.QRCode.path);
|
|
|
|
Console.WriteLine(_options.QRCode.path + fileName);
|
|
|
|
var Imageurl = _options.QRCode.path + fileName;
|
|
|
|
|
|
|
|
Console.WriteLine(Imageurl);
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MemoryStream ms = new MemoryStream(res);
|
|
|
|
MemoryStream ms = new MemoryStream(res);
|
|
|
|
FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate);
|
|
|
|
FileStream fs = new FileStream(Imageurl, FileMode.OpenOrCreate);
|
|
|
|
ms.WriteTo(fs);
|
|
|
|
ms.WriteTo(fs);
|
|
|
|
ms.Close();
|
|
|
|
ms.Close();
|
|
|
|
fs.Close();
|
|
|
|
fs.Close();
|
|
|
|
await this.cacheService.SetQRCodeAsync(UserManager.UserId, fileName);
|
|
|
|
await this.cacheService.SetQRCodeAsync(UserManager.UserId, Imageurl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Oh(e.Message);
|
|
|
|
throw Oops.Oh(e.Message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fileName;
|
|
|
|
return Imageurl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|