1044 lines
49 KiB
JavaScript
1044 lines
49 KiB
JavaScript
// [author: funyhook]
|
||
// [create_at: 2023-10-08 17:59:18]
|
||
// [version: 11]
|
||
// [title: 茅台]
|
||
// [description: 插件失效了 我也不知道怎麽更新了,會的大佬自己研究吧 茅台版本号:1.5.5<br/>i茅台自动预约申购;使用指令:手动申购指令:mt,茅台;账号管理指令:茅台管理;<br/>依赖"hook.js,请先前往插件市场安装 hook.js]
|
||
// [public: true]
|
||
// [service: funyhook]
|
||
// [price: 3]
|
||
// [icon: https://bbs.autman.cn/assets/files/2023-11-30/1701333649-286935-5bc8824b-8cbe-4263-b5a7-b48877b32170.png]
|
||
//=======================================================
|
||
// [rule: ^茅台$]
|
||
// [rule: mt]
|
||
// [rule: ^茅台管理$]
|
||
// [rule: ^茅台超级管理$]
|
||
// [rule: mtt]
|
||
// [rule: mtfk]
|
||
// [admin: false ]
|
||
// [disable: false]
|
||
// [cron: 1,5 9,18 * * *]每日9点运行
|
||
// [priority: 99999999999]
|
||
//=======================================================
|
||
//[param: {"required":false,"key":"otto.vhook_imt_delay_time","bool":false,"placeholder":"账号申购间隔时间(单位秒)示例一分钟:60","name":"账号申购间隔时间","desc":"账号申购间隔时间(单位秒)示例一分钟:60,填写数字"}]
|
||
//=======================
|
||
//脚本及其中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。 您必须在下载后的24小时内从计算机或手机中完全删除此脚本
|
||
|
||
|
||
|
||
|
||
const app_name = "【i茅台】"
|
||
const plugin_key_pre = "imt_"
|
||
const plugin_name = `【${getTitle()}】`
|
||
const plugin_title = getTitle()
|
||
const title = getTitle()
|
||
const version = getVersion()
|
||
const imType = ImType() === "cron" ? "fake" : ImType();
|
||
const userId = GetUserID();
|
||
const chatId = GetChatID();
|
||
const msg = GetContent();
|
||
const aut_ver = call("version")()["sn"]//获取当前系统版本
|
||
const mt_r = 'clips_OlU6TmFRag5rCXwbNAQ/Tz1SKlN8THcecBp/HGhHdw=='
|
||
let mt_v= '1.5.6'
|
||
const res_list = [
|
||
{"itemCode": "10941", "itemName": "500ml贵州茅台酒(甲辰龙年)"},
|
||
{"itemCode": "2478", "itemName": "贵州茅台酒(珍品)"},
|
||
{"itemCode": "10056", "itemName": "茅台1935"},
|
||
{"itemCode": "10942", "itemName": "375ml×2贵州茅台酒(甲辰龙年)"},
|
||
]
|
||
let res_map = {}
|
||
let choose_items = "";
|
||
res_list.forEach(o => {
|
||
res_map[o.itemCode] = o.itemName
|
||
choose_items += `\n【${o.itemCode}】、${o.itemName}`
|
||
})
|
||
const today = timeFmt('yyyy-MM-dd')
|
||
const dateTime = timeFmt()
|
||
const time = new Date(today.split(" ") + " 00:00:00").getTime()
|
||
const reserveStartTime = new Date(today.split(" ") + " 09:00:00").getTime()
|
||
let pc_map = {}
|
||
let api_url = {}
|
||
let delay_time = get("vhook_imt_delay_time")?get("vhook_imt_delay_time"):10
|
||
|
||
//记录账号
|
||
function recordAccount() {
|
||
try {
|
||
let conntent = `${plugin_name} 请按照下面抓包教程准备数据:`
|
||
conntent += `\n1、抓包app.moutai519.com.cn下请求头部Cookie中的 MT-Token `
|
||
conntent += `\n2、点击小茅运,抓包h5.moutai519.com.cn下请求头部的Cookie中的MT-Token-Wap`
|
||
conntent += `\n3、设备id (点击小茅运,抓包h5.moutai519.com.cn下请求头部的中的MT-Device-ID`
|
||
conntent += `\n4、所在省份:河南省 ;!!!注意: 一定要加上”省“`
|
||
conntent += `\n5、所在城市:洛阳市 ;!!!注意: 一定要加上”市“`
|
||
conntent += `\n5、所在县区:宜阳县 ;!!!注意: 一定要加上”县“或"区"`
|
||
conntent += `\n6、当前位置的经度http://jingweidu.757dy.com)`
|
||
conntent += `\n7、当前位置的纬度(http://jingweidu.757dy.com)`
|
||
sendText(conntent)
|
||
sleep(1000)
|
||
sendText(`${plugin_name}:请在【2分钟】内输入${app_name} MT-Token`);
|
||
let user_data = {};
|
||
let mt_tokenn = input(120000);
|
||
if (!mt_tokenn || mt_tokenn === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.mt_tokenn = mt_tokenn
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入${app_name} MT-Token-Wap:`);
|
||
let mt_token_wap = input(120000)
|
||
if (!mt_token_wap || mt_token_wap === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.mt_token_wap = mt_token_wap;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入${app_name} MT-Device-ID:`);
|
||
let mt_device_id = input(120000)
|
||
if (!mt_device_id || mt_device_id === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.mt_device_id = mt_device_id;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入你所在的省份(例如 河南省):`);
|
||
let province = input(120000)
|
||
if (!province || province === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.province = province;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入你要所在城市(例如 北京市):`);
|
||
let city = input(120000)
|
||
if (!city || city === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.city = city;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入当前位置的所在县或者区(例如,宜阳县)\n\n多个县区,请使用英文逗号分隔(例如:朝阳区,海淀区)`);
|
||
let districtName = input(120000)
|
||
if (!districtName || districtName === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
|
||
}
|
||
user_data.districtName = districtName;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入当前位置的经度(http://jingweidu.757dy.com)`);
|
||
let lot = input(120000)
|
||
if (!lot || lot === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.lot = lot;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入当前位置的纬度(http://jingweidu.757dy.com)`);
|
||
let lat = input(120000)
|
||
if (!lat || lat === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.lat = lat;
|
||
|
||
sendText(`${plugin_name}:请在【2分钟】内输入下方你要申购商品的编号【】中的数字(多个编号,请用英文逗号分隔)\n${choose_items}`);
|
||
let itemCodes = input(120000)
|
||
if (!itemCodes || itemCodes === "q") {
|
||
return sendText(`${plugin_name}:输入有误,自动退出`);
|
||
}
|
||
user_data.itemCodes = itemCodes.split(",");
|
||
mt_v = mt_ver
|
||
sendText('请稍等,正在校验数据是否正确......')
|
||
sleep(1000)
|
||
get_user_id(user_data)
|
||
bucketSet(plugin_key_pre + imType, JSON.stringify(user_data), userId)
|
||
} catch (e) {
|
||
console.error(`${plugin_name}:recordAccount异常:${e.message}`)
|
||
notifyMasters(`${plugin_name}:recordAccount异常:${e.message}`);
|
||
}
|
||
return sendText(`${plugin_name}:恭喜数据校验正确,手动申购请发送命令:茅台,自动申购:默认每日09:00自动运行`);
|
||
}
|
||
|
||
|
||
function get_mt_ver(){
|
||
let res = request({
|
||
url: "https://itunes.apple.com/cn/lookup?id=1600482450",
|
||
method: `get`,
|
||
dataType:"json"
|
||
})
|
||
console.log(`茅台版本号:::${JSON.stringify(res)}`)
|
||
mt_v = res.results[0].version
|
||
}
|
||
|
||
//获取sessionid 和商品code
|
||
function getsessionId(user_data) {
|
||
let header = {
|
||
'mt-device-id': user_data.mt_device_id,
|
||
'mt-user-tag': '0',
|
||
'accept': '*/*',
|
||
'mt-network-type': 'WIFI',
|
||
'mt-token': user_data.mt_tokenn,
|
||
'mt-bundle-id': 'com.moutai.mall',
|
||
'accept-language': 'zh-Hans-CN;q=1',
|
||
'mt-request-id': new Date().getTime(),
|
||
'mt-app-version': mt_v,
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'mt-r': mt_r,
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat
|
||
}
|
||
request({
|
||
url: `https://static.moutai519.com.cn/mt-backend/xhr/front/mall/index/session/get/${time}`,
|
||
method: "get",
|
||
dataType: "json",
|
||
headers: header,
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}:账号【${user_data.mobile} 】获取商品信息:${JSON.stringify(response)}`
|
||
console.error(content)
|
||
if (!error && response.statusCode === 200 && body.code === 2000) {
|
||
user_data.sessionId = body.data.sessionId;
|
||
let itemCodes = []
|
||
body.data.itemList.forEach(o => {
|
||
itemCodes.push(o.itemCode)
|
||
})
|
||
if (!user_data.itemCodes) {
|
||
user_data.itemCodes = itemCodes;
|
||
}
|
||
} else {
|
||
sendText(content);
|
||
}
|
||
|
||
})
|
||
}
|
||
|
||
//根据经纬度获取城市基础数据
|
||
function get_map(user_data) {
|
||
console.log(`当前账号获取城市基础数据信息:${JSON.stringify(user_data)}`)
|
||
let header = {
|
||
'X-Requested-With': 'XMLHttpRequest',
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'Referer': 'https://h5.moutai519.com.cn/gux/game/main?appConfig=2_1_2',
|
||
'Client-User-Agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax',
|
||
'MT-R': mt_r,
|
||
'Origin': 'https://h5.moutai519.com.cn',
|
||
'mt-app-version': mt_v,
|
||
'MT-Request-ID': call("uuid")(),
|
||
'Accept-Language': 'zh-CN,zh-Hans;q=1',
|
||
'MT-Device-ID': user_data.mt_device_id,
|
||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat
|
||
}
|
||
console.log(`当前账号请求headers:${JSON.stringify(header)}`)
|
||
request({
|
||
url: `https://static.moutai519.com.cn/mt-backend/xhr/front/mall/resource/get`,
|
||
method: "get",
|
||
headers: header,
|
||
dataType: "json"
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}:获取城市数据字典:${JSON.stringify(response)}`
|
||
if (!error && response.statusCode === 200 && body.code === 2000) {
|
||
const shops_url = body.data.mtshops_pc.url;
|
||
let shop_res = JSON.parse(request({url: shops_url, method: "get"}))
|
||
for (const value in shop_res) {
|
||
if (!shop_res.hasOwnProperty(value)) {
|
||
continue;
|
||
}
|
||
let shop_info = shop_res[value];
|
||
let provinceName = shop_info.provinceName; //省
|
||
let cityName = shop_info.cityName; //市
|
||
let districtName = shop_info.districtName; //区/县
|
||
if (!pc_map[provinceName]) {
|
||
pc_map[provinceName] = {}
|
||
pc_map[provinceName][cityName] = {}
|
||
pc_map[provinceName][cityName][districtName] = []
|
||
}
|
||
if (!pc_map[provinceName][cityName]) {
|
||
pc_map[provinceName][cityName] = {}
|
||
pc_map[provinceName][cityName][districtName] = []
|
||
}
|
||
if (!pc_map[provinceName][cityName][districtName]) {
|
||
pc_map[provinceName][cityName][districtName] = []
|
||
}
|
||
pc_map[provinceName][cityName][districtName].push(value)
|
||
|
||
}
|
||
} else {
|
||
sendText(`${content}`);
|
||
}
|
||
|
||
})
|
||
}
|
||
|
||
//获取用户信息
|
||
function get_user_id(user_data) {
|
||
try {
|
||
let header = {
|
||
'MT-User-Tag': '0',
|
||
'Accept': '*/*',
|
||
'MT-Network-Type': 'WIFI',
|
||
'MT-Token': user_data.mt_tokenn,
|
||
'MT-Bundle-ID': 'com.moutai.mall',
|
||
'Accept-Language': 'zh-Hans-CN;q=1, en-CN;q=0.9',
|
||
'MT-Request-ID': call("uuid")(),
|
||
'mt-app-version': mt_v,
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'MT-R': mt_r,
|
||
'MT-Device-ID': user_data.mt_device_id,
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat
|
||
}
|
||
request({
|
||
url: `https://app.moutai519.com.cn/xhr/front/user/info`,
|
||
method: "get",
|
||
dataType: "json",
|
||
headers: header,
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}:账号【${user_data.mobile} 】${header} 获取用户信息结果:${JSON.stringify(response)}`
|
||
console.log(content)
|
||
if (!error && response.statusCode === 200 && body.code === 2000) {
|
||
user_data.userName = body.data.userName;
|
||
user_data.userId = body.data.userId;
|
||
user_data.mobile = body.data.mobile
|
||
user_data.status = 200
|
||
} else if (response.statusCode === 401) {
|
||
user_data.status = 401
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, `${user_data.mobile},此账号过期,请发送:茅台登陆,重新登陆`)
|
||
} else {
|
||
user_data.status = response.statusCode
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, `${user_data.mobile},此账号过期,请发送:茅台登陆,重新登陆`)
|
||
}
|
||
|
||
})
|
||
} catch (e) {
|
||
console.error(`${plugin_name}:get_user_id 异常:${e.message}`)
|
||
notifyMasters(`${plugin_name}:get_user_id异常:${e.message}`);
|
||
}
|
||
}
|
||
|
||
//获取商店信息
|
||
function get_shop_item(user_data, itemCode, itemName) {
|
||
let header = {
|
||
'mt-device-id': user_data.mt_device_id,
|
||
'mt-user-tag': '0',
|
||
'accept': '*/*',
|
||
'mt-network-type': 'WIFI',
|
||
'mt-token': user_data.mt_tokenn,
|
||
'mt-bundle-id': 'com.moutai.mall',
|
||
'accept-language': 'zh-Hans-CN;q=1',
|
||
'mt-request-id': new Date().getTime(),
|
||
'mt-r': mt_r,
|
||
'mt-app-version': mt_v,
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat
|
||
}
|
||
let url = `https://static.moutai519.com.cn/mt-backend/xhr/front/mall/shop/list/slim/v3/${user_data.sessionId}/${user_data.province}/${itemCode}/${time}`
|
||
console.log(url)
|
||
request({
|
||
url: `https://static.moutai519.com.cn/mt-backend/xhr/front/mall/shop/list/slim/v3/${user_data.sessionId}/${user_data.province}/${itemCode}/${time}`,
|
||
method: "get",
|
||
dataType: "json",
|
||
headers: header,
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}:账号【${user_data.mobile}】 获取商店信息:${JSON.stringify(response)}`
|
||
if (!error && response.statusCode === 200 && body.code === 2000) {
|
||
let data_shops = body.data.shops
|
||
if (pc_map[user_data.province][user_data.city]) {
|
||
if (!user_data.districtName) {
|
||
let content = `${plugin_name}:`
|
||
content += `【账号】${user_data.mobile}`
|
||
content += `【提示】未配置县区,请发送茅台管理 配置当前账号的县区!`
|
||
return pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
}
|
||
console.log((user_data.districtName_arr.length))
|
||
for (const districtName of user_data.districtName_arr) {
|
||
user_data.districtName = districtName
|
||
let shopIds = pc_map[user_data.province][user_data.city][districtName]
|
||
console.log(`${plugin_name}:账号【${user_data.mobile}】:${user_data.province}:${user_data.city}:${districtName}:${shopIds}`)
|
||
if (!shopIds) {
|
||
let content = `${plugin_name}:发生错误`
|
||
content += `\n【账号】${user_data.mobile}`
|
||
content += `\n【❌】未找到对应${user_data.province - user_data.city - districtName}数据,无法预约!,请填写正确的省份例如:河北省,请填写正确的城市例如:邢台市,请填写正确的县区例如:宜阳县 或者 朝阳区;若配置多个县区,请用英文逗号分隔`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
continue;
|
||
}
|
||
let not_shop = true;
|
||
for (let shop of data_shops) {
|
||
if (shopIds.includes(shop.shopId) && shop.items.some(o => o.itemId === itemCode)) {
|
||
not_shop = false;
|
||
return mt_add(user_data, shop.shopId, itemCode, itemName)
|
||
}
|
||
}
|
||
if (not_shop) {
|
||
let content = `${plugin_name}:发生错误`
|
||
content += `\n【账号】${user_data.mobile}`
|
||
content += `\n【❌】申购失败!`
|
||
content += `\n【提示】打开app 进入申购,找到【${res_map[itemCode]}】,点击【预约申购】按钮,查看您设置的地区【${user_data.province}-${user_data.city}-${districtName}】,是否支持申购!!!`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
}
|
||
}
|
||
} else {
|
||
let content = `${plugin_name}:发生错误`
|
||
content += `\n【账号】${user_data.mobile}`
|
||
content += `\n【❌】申购失败:未找到对应省份城市数据,无法预约!,请填写正确的省份例如:河北省,请填写正确的城市例如:邢台市,请填写正确的县区:宜阳县`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
}
|
||
} else {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content + "\n" + url)
|
||
console.log(`${content}\n${url}`)
|
||
}
|
||
|
||
})
|
||
}
|
||
|
||
//预约
|
||
function mt_add(user_data, shopId, itemCode, itemName) {
|
||
const MT_K = new Date().getTime() * 1000;
|
||
let url = String.format(api_url.mtv_url, user_data.mt_device_id, MT_K, mt_v)
|
||
console.log(url)
|
||
let res = request({
|
||
url: url,
|
||
method: `get`
|
||
})
|
||
console.log(res)
|
||
|
||
let header = {
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'MT-Token': user_data.mt_tokenn,
|
||
'MT-Network-Type': 'WIFI',
|
||
'MT-User-Tag': '0',
|
||
'MT-R': mt_r,
|
||
'MT-Lat': '',
|
||
'MT-K': MT_K,
|
||
'MT-Lng': '',
|
||
'MT-Info': '028e7f96f6369cafe1d105579c5b9377',
|
||
'mt-app-version': mt_v,
|
||
'MT-Request-ID': call("uuid")(),
|
||
'Accept-Language': 'zh-Hans-CN;q=1',
|
||
'MT-Device-ID': user_data.mt_device_id,
|
||
'MT-V': res.text,
|
||
'MT-Bundle-ID': 'com.moutai.mall',
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat
|
||
}
|
||
let d = {
|
||
"itemInfoList": [{
|
||
"count": 1,
|
||
"itemId": itemCode
|
||
}],
|
||
"sessionId": user_data.sessionId,
|
||
"userId": user_data.userId,
|
||
"shopId": shopId
|
||
}
|
||
url = String.format(api_url.param_url, Base64.encode(JSON.stringify(d)))
|
||
//console.log(url)
|
||
let res2 = request({
|
||
url: url,
|
||
method: "get"
|
||
})
|
||
//console.log(`预约sign:${JSON.stringify(res)}预约请求:${JSON.stringify(res2)}`)
|
||
request({
|
||
url: api_url.add_url,
|
||
method: "post",
|
||
dataType: "json",
|
||
headers: header,
|
||
body: {
|
||
'actParam': res2
|
||
}
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}:【预约账号】${user_data.mobile} 【预约商品】:${itemName}【预约省市县区】:${user_data.province}-${user_data.city}-${user_data.districtName}\n【预约结果】:${JSON.stringify(response)}`
|
||
if (body && body.code === 2000) {
|
||
content = `${plugin_name}申购通知\n【预约账号】${user_data.mobile}\n【预约商品】:${itemName}\n【预约省市县区】:${user_data.province}-${user_data.city}-${user_data.districtName}\n【预约结果】:${body.data.successDesc}\n【其他提醒】:${body.data.reservationDetail.desc}`
|
||
|
||
} else {
|
||
content = `${plugin_name}申购通知\n【预约账号】${user_data.mobile} \n【预约商品】:${itemName}\n【预约省市县区】:${user_data.province}-${user_data.city}-${user_data.districtName}\n【预约结果】:${body.message},请发送:mtt 查看预约申购结果`
|
||
|
||
}
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
})
|
||
}
|
||
|
||
/* 定时签到
|
||
* @param {Object} tokenArr
|
||
*/
|
||
function cronTask() {
|
||
|
||
let platFormArr = platformArr(plugin_key_pre)
|
||
for (const p of platFormArr) {
|
||
|
||
let user_data_arr = bucketKeys(p.platform)
|
||
console.log(`${plugin_name}:${p.platform}:${JSON.stringify(user_data_arr)}`)
|
||
if (user_data_arr) {
|
||
for (let i = 0; i < user_data_arr.length; i++) {
|
||
let slee = Math.random() * delay_time
|
||
sleep(slee)
|
||
try {
|
||
let user_data = JSON.parse(user_data_arr[i])
|
||
user_data = removeSpecialChars(user_data)
|
||
user_data.push_user_id = bucketGet(p.platform, user_data_arr[i]);
|
||
user_data.push_user_imType = p.imType
|
||
user_data.mt_v = mt_v
|
||
if (!user_data.province || !user_data.city || !user_data.districtName || !user_data.lot || !user_data.lat) {
|
||
notifyMasters(`茅台用户数据未配置完成,已跳过申购,请联系该用户${user_data.push_user_imType}:${user_data.push_user_id}`)
|
||
continue
|
||
}
|
||
if (user_data.mt_source) {
|
||
if (user_data.expires && user_data.expires < getTimestamp()) {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, "授权到期,请发送茅台登陆,续费!")
|
||
continue;
|
||
}
|
||
check_denpcy("茅台sms登陆.js")
|
||
user_data.mt_tokenn = Base64.decode(user_data.mt_tokenn)
|
||
user_data.mt_token_wap = Base64.decode(user_data.mt_token_wap)
|
||
}
|
||
user_data.districtName_arr = user_data.districtName.split(",")
|
||
get_map(user_data)
|
||
sleep(1000)
|
||
getsessionId(user_data)
|
||
sleep(1000)
|
||
get_user_id(user_data)
|
||
if (user_data.status!==200){
|
||
continue
|
||
}
|
||
sleep(1000)
|
||
for (let itemCode of user_data.itemCodes) {
|
||
if (res_map[itemCode]) {
|
||
sleep(2000)
|
||
get_shop_item(user_data, itemCode, res_map[itemCode]);
|
||
}
|
||
}
|
||
|
||
sleep(5000)
|
||
} catch (e) {
|
||
console.log(e.message)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/* 申购结果查询
|
||
* @param {Object} tokenArr
|
||
*/
|
||
function notifyMtResult() {
|
||
|
||
let platFormArr = platformArr(plugin_key_pre)
|
||
for (const p of platFormArr) {
|
||
let user_data_arr = bucketKeys(p.platform)
|
||
if (user_data_arr) {
|
||
for (let i = 0; i < user_data_arr.length; i++) {
|
||
let user_data = JSON.parse(user_data_arr[i])
|
||
user_data.push_user_id = bucketGet(p.platform, user_data_arr[i]);
|
||
user_data.push_user_imType = p.imType
|
||
user_data.push_user_imType = p.imType
|
||
if (user_data.mt_source) {
|
||
if (user_data.expires && user_data.expires < getTimestamp()) {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, "授权到期,请发送茅台登陆,续费!")
|
||
continue;
|
||
}
|
||
check_denpcy("茅台sms登陆.js")
|
||
user_data.mt_tokenn = Base64.decode(user_data.mt_tokenn)
|
||
user_data.mt_token_wap = Base64.decode(user_data.mt_token_wap)
|
||
}
|
||
getReservationList(user_data)
|
||
sleep(3000)
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
function getReservationList(user_data) {
|
||
let header = {
|
||
'X-Requested-With': 'XMLHttpRequest',
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'Referer': 'https://h5.moutai519.com.cn/gux/game/main?appConfig=2_1_2',
|
||
'Client-User-Agent': 'iOS;15.0.1;Apple;iPhone 12 ProMax',
|
||
'MT-R': mt_r,
|
||
'Origin': 'https://h5.moutai519.com.cn',
|
||
'mt-app-version': mt_v,
|
||
'MT-Request-ID': call("uuid")(),
|
||
'MT-Token': user_data.mt_tokenn,
|
||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||
'MT-Device-ID': user_data.mt_device_id,
|
||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||
}
|
||
|
||
request({
|
||
url: `https://app.moutai519.com.cn/xhr/front/mall/reservation/list/pageOne/query`,
|
||
method: "get",
|
||
dataType: "json",
|
||
headers: header,
|
||
}, function (error, response, header, body) {
|
||
//sendText(JSON.stringify(body))
|
||
if (!error && response.statusCode === 200 && body.code === 2000 && body.data && body.data.reservationItemVOS) {
|
||
let reservationItemVOS = body.data.reservationItemVOS.filter(o => {
|
||
console.log(`${reserveStartTime},${o.reserveStartTime}`)
|
||
return o.reserveStartTime === reserveStartTime
|
||
})
|
||
console.log(JSON.stringify(reservationItemVOS))
|
||
if (reservationItemVOS.length > 0) {
|
||
reservationItemVOS.forEach(o => {
|
||
user_data.reservationId = o.reservationId;
|
||
queryMtResult(user_data)
|
||
})
|
||
} else {
|
||
let content = `${plugin_name}申购结果通知\n【任务账号】:${user_data.mobile}\n`
|
||
content += `今日无申购记录,待申购之后再来查询吧!`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
}
|
||
} else {
|
||
let content = `${plugin_name}申购结果通知\n【任务账号】:${user_data.mobile}\n`
|
||
content += `今日无申购记录,待申购之后再来查询吧!`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
function queryMtResult(user_data) {
|
||
let header = {
|
||
'X-Requested-With': 'XMLHttpRequest',
|
||
'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 moutaiapp/${mt_v} device-id/${user_data.mt_device_id}`,
|
||
'Referer': 'https://h5.moutai519.com.cn/gux/game/main?appConfig=2_1_2',
|
||
'Client-User-Agent': 'iOS;15.4.1;Apple;iPhone 12 ProMax',
|
||
'MT-R': mt_r,
|
||
'Origin': 'https://h5.moutai519.com.cn',
|
||
'mt-app-version': mt_v,
|
||
'MT-Request-ID': call("uuid")(),
|
||
'MT-Token-Wap': user_data.mt_token_wap,
|
||
'MT-Token': user_data.mt_tokenn,
|
||
'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
|
||
'MT-Device-ID': user_data.mt_device_id,
|
||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||
'mt-lng': user_data.lot,
|
||
'mt-lat': user_data.lat,
|
||
'Cookie': `MT-Device-ID-Wap=${user_data.mt_device_id};MT-Token-Wap=${user_data.mt_token_wap};YX_SUPPORT_WEBP=1`
|
||
}
|
||
|
||
request({
|
||
url: `https://app.moutai519.com.cn/xhr/front/mall/reservation/detail/query?reservationId=${user_data.reservationId}`,
|
||
method: "get",
|
||
dataType: "json",
|
||
headers: header,
|
||
}, function (error, response, header, body) {
|
||
let content = `${plugin_name}申购结果通知 【任务账号】:${user_data.mobile} 【申购结果】:${JSON.stringify(response)}`
|
||
console.log(content)
|
||
if (!error && response.statusCode === 200 && body.code === 2000 && body.data) {
|
||
let shopVO = body.data.shopVO;
|
||
let itemVOList = body.data.itemVOList;
|
||
let shopContent = `【自提店铺】:${shopVO.name}\n【自提地址】:${shopVO.fullAddress}\n【销售单位】:${shopVO.ownerName}`
|
||
let item = ``
|
||
itemVOList.forEach(o => {
|
||
item += `\n【商品名称】:${o.title}\n【商品价格】:${o.price}\n【商品数量】:${o.count}\n`
|
||
})
|
||
let statusVal = ''
|
||
switch (body.data.status) {
|
||
case 2:
|
||
statusVal = "【申购结果】:✅恭喜!!!,申购成功!";
|
||
user_data.qq_masters = bucketGet("qq", 'masters')
|
||
user_data.wx_masters = bucketGet("wx", 'masters')
|
||
user_data.tg_masters = bucketGet("qq", 'masters')
|
||
request({url: `${server_url}/notify`, method: "post", json: true, body: JSON.stringify(user_data)})
|
||
break;
|
||
case 1:
|
||
statusVal = "【申购结果】:❌哦哦......,申购失败了,明天继续努力!"
|
||
break;
|
||
case 0:
|
||
statusVal = "【申购结果】:稍安勿躁,申购结果当日18:00公布!"
|
||
}
|
||
content = `${plugin_name}申购结果通知\n【任务账号】:${user_data.mobile}\n${shopContent}${item}${statusVal}`
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, content)
|
||
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
//编辑用户信息
|
||
function edit_user_mt(user_data) {
|
||
let content = `${app_name}请选择要编辑的属性序号(q:退出)`
|
||
content += `\n⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️`
|
||
content += `\n⚠️看三遍之后有问题再找我咨询⚠️️`
|
||
content += `\n⚠️输入序号,会提示你怎么填写⚠️`
|
||
content += `\n⚠️只需要修改"请填写"的,其他不用管⚠️`
|
||
content += `\n⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️`
|
||
if (!user_data.timestamp) {
|
||
user_data.timestamp = getTimestamp();
|
||
}
|
||
if (!user_data.expires) {
|
||
user_data.expires = getNextMonthTimestamp(new Date());
|
||
}
|
||
content += `\n1. 登陆时间:${getDateTime(new Date(user_data.timestamp))}`
|
||
content += `\n1. 授权到期:${getDateTime(new Date(user_data.expires))}`
|
||
content += `\n1. 登陆账号:${user_data.mobile}`
|
||
content += `\n2. 预约省份:${user_data.province ? user_data.province : "请填写"}`
|
||
content += `\n3. 预约城市:${user_data.city ? user_data.city : "请填写"}`
|
||
content += `\n4. 预约县区:${user_data.districtName ? user_data.districtName : "请填写"}`
|
||
content += `\n5. 经 度:${user_data.lot ? user_data.lot : "请填写"}`
|
||
content += `\n6. 纬 度:${user_data.lat ? user_data.lat : "请填写"}`
|
||
content += `\n7. 设备id:${user_data.mt_device_id}`
|
||
content += `\n8. token:******`
|
||
content += `\n9. 小茅运token:******`
|
||
content += `\n10. 商品编号:${user_data.itemCodes ? user_data.itemCodes : "请填写"}`
|
||
content += `\n11. app版本号:${mt_v}`
|
||
sendText(content)
|
||
const p = input(120000)
|
||
if (!p || p === "q") {
|
||
bucketSet(plugin_key_pre + imType, JSON.stringify(user_data), userId)
|
||
return sendText(`${app_name}:已退出`)
|
||
}
|
||
switch (p) {
|
||
case "1":
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "2":
|
||
sendText("请在【2分钟】内预约省份(例如 河南省):")
|
||
const province = input(120000);
|
||
if (province && province !== "q") {
|
||
user_data.province = province
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "3":
|
||
sendText("请在【2分钟】内预约省份(例如 洛阳市):")
|
||
const city = input(120000);
|
||
if (city && city !== "q") {
|
||
user_data.city = city
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "4":
|
||
sendText(`请在【2分钟】内输入当前位置的所在县或者区(例如,宜阳县)\n\n多个县区,请使用英文逗号分隔(例如:朝阳区,海淀区)`);
|
||
const districtName = input(120000);
|
||
if (districtName && districtName !== "q") {
|
||
user_data.districtName = districtName
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "5":
|
||
sendText("请在【2分钟】内输入所在地的经度:(打开网址http://jingweidu.757dy.com复制经度)")
|
||
const lot = input(120000);
|
||
if (lot && lot !== "q") {
|
||
user_data.lot = lot
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "6":
|
||
sendText("请在【2分钟】内输入所在地的纬度:(打开网址http://jingweidu.757dy.com,复制纬度)")
|
||
const lat = input(120000);
|
||
if (lat && lat !== "q") {
|
||
user_data.lat = lat
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
case "10":
|
||
sendText(`${plugin_name}:请在【2分钟】内输入你要申购商品的编号,【】中的数字(多个编号,请用英文逗号分隔)\n${choose_items}`);
|
||
const itemCodes = input(120000);
|
||
if (itemCodes && itemCodes !== "q") {
|
||
user_data.itemCodes = itemCodes.split(",")
|
||
}
|
||
edit_user_mt(user_data)
|
||
break;
|
||
// case "11":
|
||
// sendText(`${plugin_name}:请在【2分钟】内输入你设备上的【i茅台】app 版本号 查看路径打开app-我的-设置-关于APP (示例:1.3.7)`);
|
||
// const mt_ver = input(120000);
|
||
// if (mt_ver && mt_ver !== "q") {
|
||
// mt_v = mt_ver
|
||
// }
|
||
// edit_user_mt(user_data)
|
||
// break;
|
||
default:
|
||
bucketSet(plugin_key_pre + imType, JSON.stringify(user_data), userId)
|
||
breakIn("q")
|
||
break;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
function check_denpcy(plugin){
|
||
try {
|
||
if(aut_ver>"2.6.5" && get("env") !== "dev"){
|
||
plugin = `funyhook:${plugin}`
|
||
}
|
||
importJs(plugin)
|
||
} catch (e) {
|
||
let content = `${getTitle()}请检查是否安装以下依赖插件:`
|
||
content += `\n【${plugin}】`
|
||
content += `\n请前往autman面板-市场管理-应用市场-【funyhook】-安装缺失插件`
|
||
console.log(content)
|
||
throw new Error(content)
|
||
}
|
||
}
|
||
|
||
|
||
function main() {
|
||
check_denpcy("hook.js")
|
||
console.log(update)
|
||
if (update){
|
||
return
|
||
}
|
||
get_mt_ver()
|
||
let checkRes = check("imt_sms_")
|
||
if (checkRes === null || !checkRes.api) return;
|
||
console.log(checkRes)
|
||
api_url = checkRes.api
|
||
if (imType === "fake" || msg === "mtfk") {
|
||
console.log(dateTime.split(" ")[1].split(":")[0])
|
||
if (dateTime.split(" ")[1].split(":")[0] === "18") {
|
||
console.log(`${plugin_name}: ${timeFmt()}:开始自动推送预约申购结果......`)
|
||
notifyMtResult()
|
||
} else {
|
||
console.log(`${plugin_name}: ${timeFmt()}:开始自动预约......`)
|
||
cronTask();
|
||
}
|
||
} else {
|
||
if (msg === "茅台" || msg === "mt") {
|
||
let user_data_arr = bucketKeys(plugin_key_pre + imType, userId)
|
||
if (user_data_arr.length === 0) {
|
||
return sendText("请发送:茅台登陆/茅台登录")
|
||
}
|
||
// if (9 !== getHour()) {
|
||
// return sendText(`${plugin_name}:当前非申购时间(09:00-10:00)!`)
|
||
// }
|
||
sendText(`${plugin_name}:开始申购,请稍后......`)
|
||
try {
|
||
console.log(user_data_arr)
|
||
for (let i = 0; i < user_data_arr.length; i++) {
|
||
let slee = Math.random() * delay_time
|
||
sleep(slee)
|
||
let user_data = JSON.parse(user_data_arr[i])
|
||
user_data = removeSpecialChars(user_data)
|
||
user_data.push_user_id = userId
|
||
user_data.push_user_imType = imType
|
||
user_data.mt_v=mt_v
|
||
if (!user_data.province || !user_data.city || !user_data.districtName || !user_data.lot || !user_data.lat) {
|
||
notifyMasters(`茅台用户数据未配置完成,已跳过申购,请联系该用户${user_data.push_user_imType}:${user_data.push_user_id}`)
|
||
continue
|
||
}
|
||
if (user_data.mt_source) {
|
||
if (user_data.expires && user_data.expires < getTimestamp()) {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, "授权到期,请发送茅台登陆,续费!")
|
||
continue;
|
||
}
|
||
check_denpcy("茅台sms登陆.js")
|
||
user_data.mt_tokenn = Base64.decode(user_data.mt_tokenn)
|
||
user_data.mt_token_wap = Base64.decode(user_data.mt_token_wap)
|
||
}
|
||
get_map(user_data)
|
||
sleep(1000)
|
||
getsessionId(user_data)
|
||
sleep(1000)
|
||
get_user_id(user_data)
|
||
if (user_data.status!==200){
|
||
continue
|
||
}
|
||
user_data.districtName_arr = user_data.districtName.split(",")
|
||
if (!user_data.itemCodes || user_data.itemCodes.length === 0) {
|
||
return sendText(`${plugin_name}:警告:不配置商品,申购个鸡毛?!`)
|
||
}
|
||
for (let itemCode of user_data.itemCodes) {
|
||
console.error("商品编码::::=>"+itemCode)
|
||
if (res_map[itemCode]) {
|
||
sleep(2000)
|
||
get_shop_item(user_data, itemCode, res_map[itemCode]);
|
||
} else {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, "沙雕,茅台商品编号配置错了!!!,请发送:茅台管理,重新编辑你的申购商品编号!!!")
|
||
}
|
||
|
||
}
|
||
sleep(Math.round(Math.random() * 5000))
|
||
|
||
}
|
||
} catch (e) {
|
||
console.log(`${plugin_name}:::发生错误:${e}`)
|
||
notifyMasters(`${plugin_name}:::发生错误:${e},请联系插件作者!!!`)
|
||
}
|
||
}
|
||
if (msg === "茅台管理") {
|
||
let user_data_arr = bucketKeys(plugin_key_pre + imType, userId)
|
||
console.log(user_data_arr)
|
||
let content = `${plugin_name}:请选择${app_name}账号查看详情:(-删除,0增加, q退出)`
|
||
for (let i = 0; i < user_data_arr.length; i++) {
|
||
let user_data = JSON.parse(user_data_arr[i]);
|
||
if (user_data.mobile) {
|
||
user_data.mobile = user_data.mobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
||
user_data.id = i
|
||
//return bucketSet(plugin_key_pre + imType, JSON.stringify(user_data), userId)
|
||
}
|
||
content += "\n" + (i + 1) + "." + user_data.mobile
|
||
}
|
||
sendText(content)
|
||
let q = input(120000)
|
||
if (!q || q === "q") {
|
||
return sendText(`${plugin_name}:已退出`)
|
||
}
|
||
if (q.substr(0, 1) === "-") {
|
||
bucketDel(plugin_key_pre + imType, user_data_arr[q["1"] - 1])
|
||
user_data_arr = bucketKeys(plugin_key_pre + imType)
|
||
if (isAdmin()) {
|
||
user_data_arr = bucketKeys(plugin_key_pre + imType)
|
||
}
|
||
if (!user_data_arr || user_data_arr.length < 0) {
|
||
return sendText(`${plugin_name}:未设置${app_name}账户信息,请发送:茅台`)
|
||
} else {
|
||
breakIn("茅台管理")
|
||
}
|
||
} else if (q === "0") {
|
||
if (user_data_arr.length >= 10) {
|
||
return sendText(`${plugin_name}:警告:本插件防黑,自动限制每位用户添加10个账户,如有特殊需求,请联系插件作者!`)
|
||
} else {
|
||
return sendText("请发送:茅台登陆/茅台登录")
|
||
}
|
||
} else if (!isNaN(q)) {
|
||
if (q <= user_data_arr.length) {
|
||
let user_data = JSON.parse(user_data_arr[q - 1])
|
||
if (!user_data.mobile) {
|
||
get_user_id(user_data)
|
||
}
|
||
bucketDel(plugin_key_pre + imType, JSON.stringify(user_data))
|
||
edit_user_mt(user_data)
|
||
} else {
|
||
breakIn("茅台管理")
|
||
}
|
||
}
|
||
|
||
}
|
||
if (msg === "mtt") {
|
||
if (getHour() > 0 && getHour() < 18) {
|
||
return sendText(`${plugin_name}:今日申购未开始/结束,请在当日18:00后查询!!`)
|
||
}
|
||
sendText(`${plugin_name}:申购结果查询中,请稍后......`)
|
||
let slee = Math.random() * delay_time
|
||
sleep(slee)
|
||
let user_data_arr = bucketKeys(plugin_key_pre + imType, userId)
|
||
for (let i = 0; i < user_data_arr.length; i++) {
|
||
let user_data = JSON.parse(user_data_arr[i])
|
||
user_data.push_user_id = userId;
|
||
user_data.push_user_imType = imType
|
||
if (user_data.mt_source) {
|
||
if (user_data.expires && user_data.expires < getTimestamp()) {
|
||
pushMsg(user_data.push_user_id, user_data.push_user_imType, chatId, "授权到期,请发送茅台登陆,续费!")
|
||
continue;
|
||
}
|
||
check_denpcy("茅台sms登陆.js")
|
||
user_data.mt_tokenn = Base64.decode(user_data.mt_tokenn)
|
||
user_data.mt_token_wap = Base64.decode(user_data.mt_token_wap)
|
||
}
|
||
console.log(`${plugin_name}: 用户【${user_data.mobile}】信息${JSON.stringify(user_data)}`)
|
||
//getXiaoMaoYun(user_data)
|
||
getReservationList(user_data)
|
||
}
|
||
}
|
||
if (msg === "茅台超级管理" && isAdmin()) {
|
||
let user_data_arr = []
|
||
let content = `i茅台上车用户,输入序号查看详情:(-删除;例如 -1 就是删除第一个)`
|
||
let index = 1
|
||
for (const plat of platformArr(plugin_key_pre)) {
|
||
let arr = bucketKeys(plat.platform)
|
||
console.log(`${plat.platform}::${arr.length}`)
|
||
if (arr) {
|
||
for (let i = 0; i < arr.length; i++) {
|
||
let user_data = JSON.parse(arr[i])
|
||
user_data.plat_id = bucketGet(plugin_key_pre + plat.imType, arr[i])
|
||
user_data.index = i
|
||
user_data.plat = plat.imType
|
||
if (user_data.mobile) {
|
||
user_data.mobile = user_data.mobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
||
user_data.id = i
|
||
}
|
||
user_data.str = arr[i]
|
||
user_data.key = plat.platform
|
||
user_data_arr.push(user_data)
|
||
if (!user_data.expires) {
|
||
user_data.expires = getNextMonthTimestamp(new Date())
|
||
}
|
||
content += `\n${index}.[${user_data.plat}]${user_data.mobile} 到期:${getDateTime(new Date(user_data.expires)).split(" ")[0]}`
|
||
index++
|
||
}
|
||
|
||
}
|
||
}
|
||
if (user_data_arr.length > 0) {
|
||
sendText(content)
|
||
} else {
|
||
sendText("暂无韭菜上车!")
|
||
}
|
||
// console.log(user_data_arr)
|
||
let no = input(12000)
|
||
if (no.startsWith("-")){
|
||
let del = user_data_arr[no["1"]-1];
|
||
if (del){
|
||
bucketDel(del.key,del.str)
|
||
breakIn("茅台超级管理")
|
||
return
|
||
}
|
||
}
|
||
if (!no || no === "q") {
|
||
return sendText("已退出!")
|
||
}
|
||
if (isNaN(no)) {
|
||
return sendText("输入有误,已退出!")
|
||
}
|
||
if (no < 0 || no > user_data_arr.length) {
|
||
return breakIn("茅台超级管理")
|
||
}
|
||
let user_data = user_data_arr[no - 1]
|
||
if (!user_data.mobile) {
|
||
get_user_id(user_data)
|
||
if (user_data.status!==200){
|
||
return
|
||
}
|
||
}
|
||
if (!user_data.timestamp) {
|
||
user_data.timestamp = getTimestamp();
|
||
}
|
||
if (!user_data.expires) {
|
||
user_data.expires = getNextMonthTimestamp(new Date());
|
||
}
|
||
user_data.mobile = user_data.mobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
||
content = `-----${app_name}用户详情:-----`
|
||
content += `\n绑定平台:${user_data.plat}`
|
||
content += `\n绑定账号:${user_data.plat_id}`
|
||
content += `\n登陆时间:${getDateTime(new Date(user_data.timestamp))}`
|
||
content += `\n授权到期:${getDateTime(new Date(user_data.expires))}`
|
||
content += `\n输入0,修改授权到期时间`
|
||
content += `\n----------------`
|
||
content += `\n1. 登陆账号:${user_data.mobile}`
|
||
content += `\n2. 预约省份:${user_data.province ? user_data.province : "请填写"}`
|
||
content += `\n3. 预约城市:${user_data.city ? user_data.city : "请填写"}`
|
||
content += `\n4. 预约县区:${user_data.districtName ? user_data.districtName : "请填写"}`
|
||
content += `\n5. 预约经度:${user_data.lot ? user_data.lot : "请填写"}`
|
||
content += `\n6. 预约纬度:${user_data.lat ? user_data.lat : "请填写"}`
|
||
content += `\n7. 预约商品:${user_data.itemCodes ? user_data.itemCodes : "请填写"}`
|
||
content += `\n8. app版本:${mt_v ? mt_v : "请填写"}`
|
||
content += `\n9. 设备id:******`
|
||
content += `\n10. mt-token:******`
|
||
content += `\n11. 小茅运token:******`
|
||
sendText(content)
|
||
let ze = input(12000)
|
||
if (!ze || ze === "q" ) {
|
||
return sendText("已退出!")
|
||
}
|
||
if (ze !== "0") {
|
||
return sendText("输入有误,已退出!")
|
||
}
|
||
sendText("请输入延期数字(单位:月)只需输入数字即可(q:退出)")
|
||
let month = input(12000)
|
||
if (!month || month === "q" ) {
|
||
return sendText("已退出!")
|
||
}
|
||
if (isNaN(month)) {
|
||
return sendText("格式错误,已退出!")
|
||
}
|
||
console.log(user_data.expires)
|
||
console.log(new Date(user_data.expires))
|
||
for (let index = 0; index <= month; index++) {
|
||
user_data.expires = getNextMonthTimestamp(new Date(user_data.expires))
|
||
}
|
||
sendText(`是否将用户的授权到期时间延迟至:${getDateTime(new Date(user_data.expires))},请输入y/n(q:退出)`)
|
||
let confirm = input(12000)
|
||
if (!confirm || confirm === "q" |confirm === "n") {
|
||
return sendText("未保存,已退出!")
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
main()
|