From 6551e3f63f27c5cba9c1c718f7784fd36eaa1a4e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 23 Aug 2022 11:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=A4=A7=E8=84=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_Desktop/DataCollection/DataCollectionService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 0beba6344..5886d116a 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 @@ -44,8 +44,8 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - var refresh_token = _redis.Read("refresh_token"); - var access_token = _redis.Read("access_token"); + var refresh_token = _redis.Read("refresh_token") == "null" ? "" : _redis.Read("refresh_token"); + var access_token = _redis.Read("access_token") == "null" ? "" : _redis.Read("access_token"); if (string.IsNullOrEmpty(refresh_token) || string.IsNullOrEmpty(_redis.Read("access_token"))) { //用户授权 @@ -75,7 +75,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop private void login() { var login_url = InsUrl + "/prod-api/api/web/collect/oauth2/login?grant_type=password&client_id=" + client_id + "&username=" + username + "&password=" + password; - var login_res_str = HttpMethods.Get(login_url); + var login_res_str = HttpMethods.Post(login_url); var login_res = JsonConvert.DeserializeObject(login_res_str); var login_data = login_res.data; string access_token = ((dynamic)login_data)?.access_token; @@ -95,7 +95,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var refresh_url = InsUrl + "/prod-api/api/web/collect/oauth2/refresh?grant_type=refresh_token&client_id=" + client_id + "&client_secret=" + client_secret + "&refresh_token=" + refresh_token; - var refresh_res_str = HttpMethods.Get(refresh_url); + var refresh_res_str = HttpMethods.Post(refresh_url); var refresh_res = JsonConvert.DeserializeObject(refresh_res_str); if (refresh_res == null || ((dynamic)refresh_res)?.code != 200) {