47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using System.Text;
|
|
using System;
|
|
|
|
public class WebNet
|
|
{
|
|
public static string webIp = "http://124.221.151.193";//121.237.178.115:90 124.221.151.193
|
|
/// <summary>
|
|
/// 登录资源列表接口
|
|
/// </summary>
|
|
public static string assetsUrl = $"{webIp}/api/dev/login";
|
|
/// <summary>
|
|
/// 下载资源接口
|
|
/// </summary>
|
|
public static string DownAssetsUrl = $"{webIp}/storage/resource";
|
|
/// <summary>
|
|
/// 视频观看信息上传
|
|
/// </summary>
|
|
public static string UploadInfoUrl = $"{webIp}/api/dev/uploadUsageInfo";
|
|
/// <summary>
|
|
/// 实时获取设备SN列表接口
|
|
/// </summary>
|
|
public static string getDeviceList = $"{webIp}/api/tablet/getDeviceList";
|
|
/// <summary>
|
|
/// 设备电量信息上传
|
|
/// </summary>
|
|
public static string uploadEQ = $"{webIp}/api/dev/uploadEQ";
|
|
|
|
//public static string deviceSN = "ceshiclient";//设备SN
|
|
public static string password;//密码
|
|
public static string Post_Time;//10位的时间戳
|
|
public static string Authorization;//加密后的md5码
|
|
public static string s;//加密前token
|
|
|
|
/// <summary>
|
|
/// 字节加密
|
|
/// </summary>
|
|
public static void Encrypt(string deviceSN)
|
|
{
|
|
password = EncryptMD5.Encrypt(EncryptMD5.Encrypt(deviceSN, Encoding.UTF8), Encoding.UTF8);
|
|
|
|
Post_Time = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString();
|
|
//字符拼接
|
|
s = $"{deviceSN}VR@NewTech{Post_Time}";
|
|
//双重加密
|
|
Authorization = "Basic " + EncryptMD5.Encrypt(EncryptMD5.Encrypt(s, Encoding.UTF8), Encoding.UTF8);
|
|
}
|
|
} |