54 lines
2.0 KiB
C#
54 lines
2.0 KiB
C#
using StoreHub.KJDWebService.Commons;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace StoreHub.KJDWebService.Commons
|
|
{
|
|
|
|
public class BaseClass
|
|
{
|
|
public static string BuildPDDObjString(string file, bool IsLoginDef = false)
|
|
{
|
|
string LoginApiUrl = "http://1.13.195.131:9001";
|
|
string MainPath = "kuajingda";
|
|
return LoginApiUrl + "/bxx_" + file + "?obj=" + MainPath + "/bxx_" + file;
|
|
}
|
|
|
|
public static int TimeDifferent = 0;
|
|
public static int VersionCount = 99999999;
|
|
public static int CompanyId = 1;
|
|
public static string CompanyName = "1";
|
|
public static string UserKey = "1";
|
|
public static string Mobile = "18888888888";
|
|
public static string UserName = "18888888888";
|
|
public static string ShopId = "18888888888";
|
|
public static string ShopName = "18888888888";
|
|
}
|
|
|
|
public class UserLogin
|
|
{
|
|
/// <summary>
|
|
/// 获取签名字符串,新版
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static string GetSignaturex()
|
|
{
|
|
return GetSignaturex(BaseClass.ShopId, BaseClass.ShopName);
|
|
}
|
|
public static string GetSignaturex(string shopId, string shopName)
|
|
{
|
|
if (string.IsNullOrEmpty(shopId))
|
|
shopId = "11111111";
|
|
if (string.IsNullOrEmpty(shopName))
|
|
shopName = "wx11111111";
|
|
int time = TimeUtils.DateTimeToTimestampSeconds(DateTime.Now) + BaseClass.TimeDifferent;
|
|
string time1 = EncrypUtil.Encryption(time);
|
|
return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount +
|
|
"&company_id=" + BaseClass.CompanyId + "&company=" + HtmlUtils.UrlEncodeUtf8(BaseClass.CompanyName) +
|
|
"&user_name=" + BaseClass.UserName + "&user_key=" + BaseClass.UserKey + "&mobile=" + BaseClass.Mobile +
|
|
"&sid=" + shopId + "&shop=" + HtmlUtils.UrlEncodeUtf8(shopName);
|
|
}
|
|
}
|
|
}
|