From dfe13c1a0db6816d960cee9253ec546be6e96541 Mon Sep 17 00:00:00 2001 From: Ctrlcvs <1509167646@qq.com> Date: Fri, 10 Mar 2023 08:18:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=AD=A3cookie=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/mhyTopUpLogin.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/model/mhyTopUpLogin.js b/model/mhyTopUpLogin.js index 465e2ad..c521b9f 100644 --- a/model/mhyTopUpLogin.js +++ b/model/mhyTopUpLogin.js @@ -149,7 +149,7 @@ export default class mysTopLogin { return true; } - async GetCode({render}) { + async GetCode({ render }) { try { let msg = this.e.msg.replace(/,|,|\|/g, ' ').split(' ') if (msg.length != 2) { @@ -162,10 +162,14 @@ export default class mysTopLogin { // return true; // } let goods = (await this.goodsList())[msg[1]] - // let ckData=this.e.user.ckData + if (!this.e.cookie) { + this.e.reply('请先 #绑定cookie') + return true; + } + let ckData =await utils.getCookieMap(this.e.cookie) let device_id = utils.randomString(4) let order = { - "account": "196576671", + "account":ckData?.get('ltuid')||ckData.get('account_id'), "region": utils.getServer(this.e.uid), "uid": this.e.uid, "delivery_url": "", @@ -195,12 +199,12 @@ export default class mysTopLogin { //记录操作日志 logger.mark(`当前操作用户:${this.e.user_id},操作uid:${this.e.uid},操作商品id:${goods?.goods_id},操作商品:${goods?.goods_name + (Number(goods.goods_unit) > 0 ? "×" + goods.goods_unit : "")}`) logger.mark(`支付链接:${res['data']['encode_order']}\n订单号:${res['data']['order_no']}\n 价格:${(res['data']['amount']) / 100}元`) - let r= await Common.render(`pay/index`, { + let r = await Common.render(`pay/index`, { url: res.data.encode_order, - data:res.data,uid:this.e.uid, + data: res.data, uid: this.e.uid, goods, }, { - e:this.e, + e: this.e, render, scale: 1.2, retMsgId: true })