UpstreamService.cs
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Hh.Mes.Common.config;
using Hh.Mes.Common.Json;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.Service.Repository;
using System;
using System.Collections.Generic;
using System.Text;
namespace Hh.Mes.Service.ApiService
{
public partial class UpstreamService : RepositorySqlSugar<sys_user>
{
/// <summary>
/// 删除=1
/// </summary>
public int DeleteFlag = (int)EnumDelete.删除;
/// <summary>
/// 新增或更新=0
/// </summary>
public int AddOrUpdateFlag = (int)EnumDelete.新增或更新;
/// <summary>
/// 获取token true 请求成功 T2是对应的token值,false失败
/// </summary>
/// <returns></returns>
public Tuple<bool, string> GetMomToken()
{
var url = GetDictionaryDictValue("UrlMomToken", "GetUrl");
var jsonData = new
{
username = ConfigRead.GetInstance.GetAppsetConnection().AppCustomExtend2, //"esb@P_SYS_COMPANY_393bb2f058ac4a8ba59510a1a228d383",
password = ConfigRead.GetInstance.GetAppsetConnection().AppCustomExtend3,//"efb03b68f7a0c2a331fc61a491c4b2d7",
verify = "0"
};
var httpResult = HttpMan(url, jsonData, EnumLog.Mom获取Token.ToString());
if (!httpResult.Status) return new Tuple<bool, string>(false, httpResult.Message);
var json = DynamicJson.Parse(httpResult.Result);
return new Tuple<bool, string>(true, json.data.access_token);
}
}
}