好友
阅读权限20
听众
最后登录1970-1-1
|
bin/debug目录里有编译好的exe,可以直接用。
1. 自己写了验证码登录、预约功能,登录的数据可保存。下次登录软件就不用在验证码登录了,直到这个cookie过期。
2. 需要自己把要抢的个人信息先做个配置在userconfig.json,第一次使用费力点,但以后就不用了。
{
"data": [{
"mobile": "13511111111", #手机号码样例
"shopIds": "100330100004@133330100001@100330100002@133330100002@22330100025001@133330121002", #自己身边的茅台店id 优先级从左到右,由高到低
"province": "浙江省",
"deviceId": "21EC2020-3AEA-1069-A2DD-08002B30309D", #设备id 网上可以搜索或者自己生成,说白了就guid的随机码,不知道有没有影响,不同肯定好点
"productIds":"10941@10942", ##需要抢的产品代码
"params":"MT-K:1695430951361@MT-Lng:121.231099@MT-Lat:31.272769" ##经纬度
}
]
}
注:不喜欢的请别下载,下载了觉得不好的请别抱怨,特别是吹毛求疵的朋友还是不要下为好。觉得好的点个赞、评个分,尊重一下别人的劳动成果。下一步开发自动预约的。
iMaoTai.zip
(1.36 MB, 下载次数: 1008)
主要功能代码如下:
[C#] 纯文本查看 复制代码 /// <summary>[/size]
[size=14px] /// 发送验证码[/size]
[size=14px] /// </summary>[/size]
[size=14px] /// <returns></returns>[/size]
[size=14px] public string RequestCode()[/size]
[size=14px] {[/size]
[size=14px] System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));[/size]
[size=14px] long t = (DateTime.Now.Ticks - startTime.Ticks) / 10000;[/size]
[size=14px] [/size]
[size=14px] var timestamp = t;[/size]
[size=14px] JObject param = new JObject{[/size]
[size=14px] { "mobile", this.UserName },[/size]
[size=14px] { "md5", Signature(this.UserName,timestamp) },[/size]
[size=14px] {"timestamp",timestamp+""}[/size]
[size=14px] };[/size]
[size=14px] [/size]
[size=14px] string string_ = param.ToString();[/size]
[size=14px] //Hashtable headers = new Hashtable();[/size]
[size=14px] //headers.Add("firmId","82610");[/size]
[size=14px] this.request.DeviceId = GetDeviceId(this.UserName);[/size]
[size=14px] string result = this.request.RequestCode("https://app.moutai519.com.cn/xhr/front/user/register/vcode", null, string_);[/size]
[size=14px] var jObject = JObject.Parse(result);[/size]
[size=14px] if (jObject.GetValue("code").Value<int>() != 2000)[/size]
[size=14px] {[/size]
[size=14px] throw new InvalidOperationException("发送验证码失败:" + result);[/size]
[size=14px] }[/size]
[size=14px] [/size]
[size=14px] return result;[/size]
[size=14px] }[/size]
[size=14px] [/size]
[size=14px] public string Login()[/size]
[size=14px] {[/size]
[size=14px] JObject param = new JObject{[/size]
[size=14px] { "mobile", this.UserName },[/size]
[size=14px] { "ydToken", "" },[/size]
[size=14px] {"vCode",this.Code},[/size]
[size=14px] {"ydLogId",""}[/size]
[size=14px] };[/size]
[size=14px] string string_ = param.ToString();[/size]
[size=14px] this.request.DeviceId = GetDeviceId(this.UserName);[/size]
[size=14px] string result = this.request.RequestCode("https://app.moutai519.com.cn/xhr/front/user/register/login", null, string_);[/size]
[size=14px] var jObject = JObject.Parse(result);[/size]
[size=14px] if (jObject.GetValue("code").Value<int>() != 2000)[/size]
[size=14px] {[/size]
[size=14px] throw new InvalidOperationException("登录失败:" + result);[/size]
[size=14px] }[/size]
[size=14px] return result;[/size]
[size=14px] }[/size]
[size=14px] [/size]
[size=14px] public RResponse Reservation(UserEntity user, string itemId, string shopId)[/size]
[size=14px] {[/size]
[size=14px] var info = new Dictionary<string, object>[/size]
[size=14px] {[/size]
[size=14px] { "itemId", itemId },[/size]
[size=14px] { "count", 1 }[/size]
[size=14px] };[/size]
[size=14px] var values = new Dictionary<string, object>[/size]
[size=14px] {[/size]
[size=14px] { "itemInfoList", new List<Dictionary<string, object>>() { info } },[/size]
[size=14px] { "sessionId", this.request.Session},[/size]
[size=14px] {"shopId",shopId},[/size]
[size=14px] {"userId",user.UserId + ""}[/size]
[size=14px] };[/size]
[size=14px] [/size]
[size=14px] Hashtable headers = new Hashtable();[/size]
[size=14px] headers.Add("MT-Token", user.Token);[/size]
[size=14px] headers.Add("userId", user.UserId.ToString());[/size]
[size=14px] values.Add("actParam", EncryptAES_CBC(JsonConvert.SerializeObject(values).Replace("\\\"", "\"")));[/size]
[size=14px] var requestBody = JsonConvert.SerializeObject(values);[/size]
[size=14px] System.Console.WriteLine(requestBody);[/size]
[size=14px] // string string_ = param.ToString();[/size]
[size=14px] this.request.DeviceId = GetDeviceId(user.Mobile);[/size]
[size=14px] string result = this.request.RequestCode("https://app.moutai519.com.cn/xhr/front/mall/reservation/add", headers, requestBody);[/size]
[size=14px] System.Console.WriteLine(result);[/size]
[size=14px] var jObject = JObject.Parse(result);[/size]
[size=14px] if (jObject.GetValue("code").Value<int>() == 2000)[/size]
[size=14px] {[/size]
[size=14px] var dataJObject = jObject["data"];[/size]
[size=14px] [/size]
[size=14px] return new RResponse()[/size]
[size=14px] {[/size]
[size=14px] Code = jObject.GetValue("code").Value<int>(),[/size]
[size=14px] Message = dataJObject["successDesc"].Value<string>()[/size]
[size=14px] };[/size]
[size=14px] [/size]
[size=14px] }[/size]
[size=14px] else {[/size]
[size=14px] return new RResponse()[/size]
[size=14px] {[/size]
[size=14px] Code = jObject.GetValue("code").Value<int>(),[/size]
[size=14px] Message = jObject.GetValue("message").Value<string>()[/size]
[size=14px] };[/size]
[size=14px] }[/size]
[size=14px] } |
免费评分
-
查看全部评分
|