增加项目,分层

This commit is contained in:
chfei committed 2026-09-11 19:11:12 +08:00
1 parent 6e995a5bdb
commit 0a3e5af6a9
234 files changed
+26994 -1

No files matched your search

+121
View File
@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store.Client.Commons
{
///// <summary>
///// 商铺列表信息管理
///// </summary>
//public abstract class ShopManage<T> : ISingletonDependency, ILoginSuccessed where T : ShopBase
//{
// /// <summary>
// /// 日志
// /// </summary>
// [Autowired]
// protected ILog _log { get; set; }
// [Autowired]
// internal ShopService _shopService { get; set; }
// /// <summary>
// /// 私有商铺集合
// /// </summary>
// private List<T> _shopsData = new List<T>();
// /// <summary>
// /// 私有商铺分组
// /// </summary>
// /// <returns></returns>
// private List<string> _shopGroups = new List<string>();
// /// <summary>
// /// 所有商铺
// /// </summary>
// public List<T> Shops
// {
// get
// {
// return _shopsData;
// }
// }
// /// <summary>
// /// 商铺分组
// /// </summary>
// public List<string> ShopGroups
// {
// get => _shopGroups;
// }
// /// <summary>
// /// 获取随机Cookie
// /// </summary>
// /// <returns></returns>
// public Cookies GetRandomCookies()
// {
// return Shops[RandomHelper.GetRandomNumber(Shops.Count - 1)].Cookie;
// }
// /// <summary>
// /// 刷新
// /// </summary>
// public void Refresh()
// {
// LoadServerShops();
// }
// void ILoginSuccessed.LoginSuccess(UserInfo user)
// {
// try
// {
// LoadServerShops();
// }
// catch (Exception ex)
// {
// _log.Error(ex, "加载商铺列表");
// }
// }
// /// <summary>
// /// 加载服务器商铺
// /// </summary>
// private void LoadServerShops()
// {
// _shopsData = _shopService.GetShops<T>();
// _getshopGroup();
// RefreshShopsCookie();
// }
// private void RefreshShopsCookie()
// {
// var shops = Shops.Select(a => a as ShopBase).ToList();
// _shopService.GetShopCookie(shops);
// }
// /// <summary>
// /// 检测商铺登录状态
// /// </summary>
// public abstract void CheckShopStatus(T shop);
// //{
// // //string urlx = "https://myseller.taobao.com/ajaxProxy.do?_ksTS=1548152154745_13&callback=seller_layout_head&action=FrameworkLayoutAction&event_submit_do_layout_data=true";
// // //string refere = "https://myseller.taobao.com";
// // //string htmlx = GetPostTaobaoHtml.GetUrl(urlx, refere, true, "", Shop.Cookies);
// // //Shop.MsgForCookiesLogin = htmlx.Contains("\"shopName\":\"") ? "登录成功" : "会话已过期";
// // //GetTaobaoShops.ShopsTemp.Add(Shop);
// //}
// /// <summary>
// /// 商铺分组
// /// </summary>
// private void _getshopGroup()
// {
// _shopGroups.Clear();
// List<string> list = (from a in _shopsData group a by a.GroupName into b select b.Key).ToList();
// foreach (var item in list)
// {
// _shopGroups.Add(item);
// }
// }
//}
}
+70
View File
@@ -0,0 +1,70 @@
using MAX.Core.Cryptography;
using MAX.Core.Helpers;
using Store.Client;
using Store.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store.Client.Commons
{
/// <summary>
/// 签名工具
/// </summary>
public class SignTool
{
/// <summary>
/// 获取签名
/// </summary>
/// <returns></returns>
public static string GetSign()
{
long time = GetReviseUnix();
string s = Encryption(time);
return "time=" + time + "&code=" + s + "&NbCodeVersion=1";
}
/// <summary>
/// 用户签名
/// </summary>
/// <returns></returns>
public static string GetUserSign()
{
return GetUserSign("", "");
}
/// <summary>
/// 获取当前用户签名
/// </summary>
/// <param name="shopId"></param>
/// <param name="shopName"></param>
/// <returns></returns>
public static string GetUserSign(string shopId, string shopName)
{
long time = GetReviseUnix();
string time1 = Encryption(time);
return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&uid=" + ClientInfo.User.UserId + "&key=" + ClientInfo.User.UserKey +
"&cid=" + ClientInfo.User.CompanyId + "&company=" + UrlHelper.Encode(ClientInfo.User.CompanyName) +
"&sid=" + shopId + "&shop=" + UrlHelper.Encode(shopName);
}
/// <summary>
/// 获取校正后的时间戳
/// </summary>
/// <returns></returns>
public static long GetReviseUnix()
{
return DateHelper.GetCurrentUnixTimestampInSeconds() + ServerConfig.TimeDifferent;
}
/// <summary>
/// 签名算法
/// </summary>
/// <param name="s">随机数</param>
/// <returns>加密签名结果</returns>
public static string Encryption(long s)
{
string value = $"{s}sdhewu*/fhAAue48485ew5+5%@3485esGFFHFD";
return MD5Helper.Md5_32(value);
}
}
}