|
@@ -46,7 +46,7 @@ namespace WingTokenModule.Common
|
|
|
/// <param name="fileType">上传文件类型</param>
|
|
|
/// <returns>签名字符串</returns>
|
|
|
public static string GetStorageAuthorization(string fileName, WingInterfaceLibrary.Enum.StorageServerEnum serverType, string method = "put",
|
|
|
- List<KeyValuePair<string, string>> _requestParams = null, List<KeyValuePair<string, string>> _headers = null)
|
|
|
+ List<KeyValuePair<string, string>> _requestParams = null, List<KeyValuePair<string, string>> _headers = null, bool isCompleted = false)
|
|
|
{
|
|
|
var storageSettingsParam = ConfigurationManager.StorageSettings;
|
|
|
if (storageSettingsParam == null)
|
|
@@ -54,8 +54,20 @@ namespace WingTokenModule.Common
|
|
|
return string.Empty;
|
|
|
}
|
|
|
var now = DateTimeOffset.Now;
|
|
|
- long startTimeStamp = now.ToUnixTimeSeconds();
|
|
|
- long endTimeStamp = now.AddDays(1).ToUnixTimeSeconds();
|
|
|
+ // long startTimeStamp = now.ToUnixTimeSeconds();
|
|
|
+ // long endTimeStamp = now.AddDays(1).ToUnixTimeSeconds();
|
|
|
+ long startTimeStamp = 0;
|
|
|
+ long endTimeStamp = 0;
|
|
|
+ if (isCompleted)
|
|
|
+ {
|
|
|
+ startTimeStamp = now.AddDays(-1).ToUnixTimeSeconds();
|
|
|
+ endTimeStamp = now.AddDays(2).ToUnixTimeSeconds();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ startTimeStamp = now.ToUnixTimeSeconds();
|
|
|
+ endTimeStamp = now.AddDays(1).ToUnixTimeSeconds();
|
|
|
+ }
|
|
|
var keyTime = $"{startTimeStamp};{endTimeStamp}";
|
|
|
var signKey = HMACSHA1(storageSettingsParam.Sercret, keyTime);
|
|
|
|