Browse Source

智慧大脑推送数据修改

临城职教中职
zhangli 2 years ago
parent
commit
c42a49786b
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs

+ 10
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs View File

@@ -78,9 +78,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop
var login_res_str = HttpMethods.Get(login_url);
var login_res = JsonConvert.DeserializeObject<InsResult>(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));
}
/// <summary>
/// 刷新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));
}
/// <summary>
/// 校区基础数据


Loading…
Cancel
Save