From c42a49786bff2c2257f90f58716ae9456fa24711 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 23 Aug 2022 10:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=A4=A7=E8=84=91=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataCollection/DataCollectionService.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs index c24eb19b4..0beba6344 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs @@ -78,9 +78,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var login_res_str = HttpMethods.Get(login_url); var login_res = JsonConvert.DeserializeObject(login_res_str); var login_data = login_res.data; - _redis.Write($"access_token", ((dynamic)login_data)?.access_token, TimeSpan.FromSeconds(200)); - _redis.Write($"client_secret", ((dynamic)login_data)?.client_secret, TimeSpan.FromSeconds(160000)); - _redis.Write($"refresh_token", ((dynamic)login_data)?.refresh_token, TimeSpan.FromSeconds(250)); + string access_token = ((dynamic)login_data)?.access_token; + string client_secret = ((dynamic)login_data)?.client_secret; + string refresh_token = ((dynamic)login_data)?.refresh_token; + _redis.Write($"access_token", access_token, TimeSpan.FromSeconds(200)); + _redis.Write($"client_secret", client_secret, TimeSpan.FromSeconds(160000)); + _redis.Write($"refresh_token", refresh_token, TimeSpan.FromSeconds(250)); } /// /// 刷新token @@ -101,8 +104,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop login(); return; } - _redis.Write($"access_token", ((dynamic)refresh_res)?.access_token, TimeSpan.FromSeconds(200)); - _redis.Write($"refresh_token", ((dynamic)refresh_res)?.refresh_token, TimeSpan.FromSeconds(250)); + string atoken = ((dynamic)refresh_res)?.access_token; + string rtoken = ((dynamic)refresh_res)?.refresh_token; + _redis.Write($"access_token", atoken, TimeSpan.FromSeconds(200)); + _redis.Write($"refresh_token", rtoken, TimeSpan.FromSeconds(250)); } /// /// 校区基础数据