优化了微店商品上传 优化pdd买手读单
This commit is contained in:
1 parent
6c4f16b897
commit
f360688c43
62 files changed
+5620
-1432
No files matched your search
@@ -27,6 +27,7 @@ using Work.BLL.Tools;
|
||||
using TemuKJD.BLL;
|
||||
using AllBase.Model.Result.PDDResult;
|
||||
using AllBase.Model.Param.PDDProdParam;
|
||||
using TemuKJD.BLL.PddApi;
|
||||
|
||||
namespace TemuKJD.PDDForms.ShopForms
|
||||
{
|
||||
@@ -63,6 +64,8 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
private ShopLoginInfo shop = null;
|
||||
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
|
||||
private string currentUrl = "";
|
||||
// 绑定授权的时候传进来和回调信息封装好传到数据库端
|
||||
public string AuthClientId = "";
|
||||
|
||||
public PDDShopLoginForm(ShopLoginInfo shopInfo)
|
||||
{
|
||||
@@ -754,45 +757,6 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
}
|
||||
}
|
||||
|
||||
//if (responseData.Contains("球球小小店铺55") && responseData.Contains("pdd24873711027"))
|
||||
//{
|
||||
// Task.Run(() =>
|
||||
// {
|
||||
// var data = responseData;
|
||||
// if (this.shop != null && data.Contains("\"success\":true"))
|
||||
// {
|
||||
// var username = BaseRegex.GetStringJson(ref data, "username");
|
||||
// var maskMobile = BaseRegex.GetStringJson(ref data, "mobile");
|
||||
// maskMobile = maskMobile.Split('*').Last();
|
||||
// if (string.IsNullOrWhiteSpace(maskMobile) || string.IsNullOrWhiteSpace(username))
|
||||
// return;
|
||||
|
||||
// if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username)
|
||||
// {
|
||||
// lstShopCompany.Clear();
|
||||
// //var jObj = JObject.Parse(data);
|
||||
// //var jArr = jObj["result"] as JArray;
|
||||
// //if (jArr == null)
|
||||
// // jArr = new JArray();
|
||||
|
||||
// Thread.Sleep(500);
|
||||
|
||||
// ShopCompany sc = new ShopCompany()
|
||||
// {
|
||||
// MallId = BaseRegex.GetStringJson(ref data, "mall_id"),
|
||||
// AccountId = BaseRegex.GetStringJson(ref data, "username"),
|
||||
// AccountName = BaseRegex.GetStringJson(ref data, "mall_name"),
|
||||
// LoginName = shop.LoginName,
|
||||
// UserName = BaseClass.UserName,
|
||||
// LoginStatus = "登录成功",
|
||||
// AntiContent = antiContent,
|
||||
// };
|
||||
// this.lstShopCompany.Add(sc);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
//if (url == "https://mms.pinduoduo.com/janus/api/userinfo" /*|| url == "https://mms.pinduoduo.com/janus/api/new/userinfo"*/)
|
||||
//{
|
||||
// Task.Run(() =>
|
||||
@@ -889,6 +853,47 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (url.Contains("https://xtjpd.jiaotian.vip/") && responseData.Contains("access_token"))
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
var pddClientData = responseData;
|
||||
pddClientData = GetHtml.Unicode2String(pddClientData);
|
||||
// {"id":"2","cid":"2","company_id":"0","site_id":"2","main_sid":"0","shop_id":"490943134","shop_name":"pdd49094313446","mall_name":"阿杰小铺浦哈哈","mall_desc":"您的小店已开启,为了更方便消费者了解您的店铺,快来补充店铺详情吧~","logo":"http:\/\/t16img.yangkeduo.com\/pdd_ims\/img_check\/v2\/E62F2CFFFFFF0720200112155452281\/7a235545414b40deaa2a90ab8eaebfd3.png","merchant_type":"1","mall_character":"2","access_token":"3f66557920e0481697325b46c73299e76e3d9e7e","refresh_token":"aa163da98e944063abbbe57a5365fad2fa90fe50","expires_at":"1776264848","expires_in":"26259","refresh_token_expires_at":"1776264848","refresh_token_expires_in":"26259","buy_sku_id":"435494","spec_name":"服务版本:专业版,周期:15天","spec_value":"专业版","goods_get_time":null,"order_get_time":null,"addtime":"2026-03-31 22:54:29","add_user_id":"2","add_user_name":"授权","update_time":"2026-04-15 15:36:27","update_user_id":"0","delete_user_id":"0"}
|
||||
var access_token = BaseRegex.GetStringJson(ref pddClientData, "access_token");
|
||||
var refresh_token = BaseRegex.GetStringJson(ref pddClientData, "refresh_token");
|
||||
var mall_id = BaseRegex.GetStringJson(ref pddClientData, "shop_id");
|
||||
var shop_id = BaseRegex.GetStringJson(ref pddClientData, "shop_name");
|
||||
var mall_name = BaseRegex.GetStringJson(ref pddClientData, "mall_name"); // 阿杰小铺浦哈哈
|
||||
var expires_at = BaseRegex.GetStringJson(ref pddClientData, "expires_at");
|
||||
if (shop?.MallId == mall_id && !string.IsNullOrWhiteSpace(AuthClientId))
|
||||
{
|
||||
var auth = shop.ApiAuthInfoList.FirstOrDefault(a => a.AppKey == AuthClientId);
|
||||
if (auth == null)
|
||||
{
|
||||
auth = new AuthInfo();
|
||||
shop.ApiAuthInfoList.Add(auth);
|
||||
}
|
||||
auth.ShopId = shop_id;
|
||||
auth.AccessToken = access_token;
|
||||
auth.RefreshToken = refresh_token;
|
||||
auth.AppKey = AuthClientId;
|
||||
auth.ExpiresTime = BaseClass.StampToDateTime(expires_at.ParseToInt());
|
||||
auth.UpdateTime = DateTime.Now;
|
||||
auth.ApiAuthStatus = "授权成功";
|
||||
auth.AppSecret = "";
|
||||
|
||||
var rst = PddApiHelper.SaveShopClientInfo(auth);
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
if (this.Created && !this.IsDisposed && !this.Disposing)
|
||||
this.Close();
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user