From a64ab5ba7523ba7281115dace4896f45624832da Mon Sep 17 00:00:00 2001
From: wtp <1813748440@qq.com>
Date: Wed, 29 Nov 2023 10:56:11 +0800
Subject: [PATCH] 1
---
GDZZ.Application/Service/Auth/AuthService.cs | 8 ++++++--
GDZZ.Core/ConfigOption/ConfigOptions.cs | 5 +++++
GDZZ.Web.Core/applicationconfig.json | 4 ++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/GDZZ.Application/Service/Auth/AuthService.cs b/GDZZ.Application/Service/Auth/AuthService.cs
index 236a6bf..ab8e5ae 100644
--- a/GDZZ.Application/Service/Auth/AuthService.cs
+++ b/GDZZ.Application/Service/Auth/AuthService.cs
@@ -510,8 +510,12 @@ namespace GDZZ.Application.Service.Auth
value = token.Result.AccessToken;
}
var res = await this._wechatOAuth.GetShareCodeAsync(value,scene, page);
- var fileName = Path.Combine(_options.Default.path+"/"+ UserManager.UserId +".png");
- Console.WriteLine(fileName);
+
+
+ var fileName = Path.Combine("/"+ UserManager.UserId +".png");
+ if (!Directory.Exists(_options.QRCode.path))
+ Directory.CreateDirectory(_options.QRCode.path);
+ Console.WriteLine(_options.QRCode.path + fileName);
try
{
MemoryStream ms = new MemoryStream(res);
diff --git a/GDZZ.Core/ConfigOption/ConfigOptions.cs b/GDZZ.Core/ConfigOption/ConfigOptions.cs
index 95ea335..b578492 100644
--- a/GDZZ.Core/ConfigOption/ConfigOptions.cs
+++ b/GDZZ.Core/ConfigOption/ConfigOptions.cs
@@ -87,6 +87,11 @@ public class UploadFileOptions : IConfigurableOptions
/// 默认
///
public FileDescription Default { get; set; }
+
+ ///
+ /// 默认
+ ///
+ public FileDescription QRCode { get; set; }
}
///
/// 数据库配置
diff --git a/GDZZ.Web.Core/applicationconfig.json b/GDZZ.Web.Core/applicationconfig.json
index 863c5f3..889c56b 100644
--- a/GDZZ.Web.Core/applicationconfig.json
+++ b/GDZZ.Web.Core/applicationconfig.json
@@ -266,6 +266,10 @@
"path": "Upload/Default",
"maxSize": 41943040,
"contentType": [ "image/jpg", "image/png", "image/jpeg", "image/gif", "image/bmp", "text/plain", "application/pdf", "application/msword", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.presentationml.presentation" ]
+ },
+ // 默认
+ "QRCode": {
+ "path": "Upload/QRCode"
}
}
}
\ No newline at end of file