新代理商
This commit is contained in:
1 parent
e37f15737c
commit
0773eaa9fd
34 files changed
+742
-76
No files matched your search
@@ -42,6 +42,32 @@ namespace KJD_Web.BLL.WXXD
|
||||
return true;
|
||||
}
|
||||
|
||||
public static DateTime dtAuthorizationExpireTime = DateTime.Now;
|
||||
public static string e57Authorization = "";
|
||||
public string GetE57Authorization(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
if (dtAuthorizationExpireTime <= DateTime.Now || string.IsNullOrEmpty(e57Authorization))
|
||||
{
|
||||
//{"msg":"username required","code":500}
|
||||
//{"msg":"操作成功","code":200,"token":"eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImIxYTU3OWI2LTM0NWUtNDQwOC05ZjFiLTk0ZTUyOTIxMzlmZCJ9.3qvRXiWeCo_cIOHs6gbCHqDrmfCrH6XDOrMY0BjuUOIu3yVsCwFGVO0hT0A5Wssh_VFPJLouyb1moTcODt0vow"}
|
||||
var url = "https://po.e57.cn/prod-api/api/sys-api/internal/createTokenForUser";
|
||||
var data = "{\"username\":\"admin\"}";
|
||||
var html = HttpUtils.e57PostResponse(url, data, "");
|
||||
e57Authorization = RegexUtils.GetStringJson(ref html, "token").ParseToString();
|
||||
dtAuthorizationExpireTime = DateTime.Now.AddHours(2);
|
||||
//dtAuthorizationExpireTime = DateTime.Now.AddMinutes(10);
|
||||
return html.Replace("token", "authorization");
|
||||
}
|
||||
return "{\"code\":200,\"authorization\":\"" + e57Authorization + "\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string CheckUserLogin(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
|
||||
Reference in new issue
Block a user