From 835e1bff4624446e99927499ee0c5b444727778d Mon Sep 17 00:00:00 2001 From: hrx <18603305412@163.com> Date: Thu, 18 Sep 2025 17:17:26 +0800 Subject: [PATCH] uptada BaiDuYun --- .../unsubscribe/BaiduNetdisk.vue/index.vue | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/f/web-kboss/src/views/customer/unsubscribe/BaiduNetdisk.vue/index.vue b/f/web-kboss/src/views/customer/unsubscribe/BaiduNetdisk.vue/index.vue index e5e2f8e..05615d3 100644 --- a/f/web-kboss/src/views/customer/unsubscribe/BaiduNetdisk.vue/index.vue +++ b/f/web-kboss/src/views/customer/unsubscribe/BaiduNetdisk.vue/index.vue @@ -23,13 +23,16 @@ export default { return { userToken: '', url: '', - loading: true + loading: true, } }, async created() { await this.getToken(); }, methods: { + // 点击退订返回个信息 拿着信息请求 百度回调 + // 获取百度云token + // this.userid = sessionStorage.getItem('userId') async getToken() { try { this.loading = true; @@ -48,6 +51,47 @@ export default { } finally { this.loading = false; } + }, + receiveMessage(event) { + // if (event.origin !== "https://example.com") { + // // 确保消息来自预期的源 + // return; + // } + // console.log("iframe中的event是", event); + const data = event.data; + if (data && data.orderInfo && data.orderInfo.orderId) { + // 检查接收到的数据是否包含 orderId 或者 orderIdList + this.loading = true + + const orderId = data.orderInfo.orderId + console.log('接收到订单ID:', orderId); + let ploay = { + order_id: orderId, + userid: this.userid + } + reqBaiduJudgePrice(ploay).then((res) => { + console.log("二级接口是", res) + if (res.status) { + // let lastPloay = { + // orderid: res.orderid, + // product_url: this.$route.params.listUrl ? this.$route.params.listUrl : localStorage.getItem('userRescourseUrl') + // } + this.$router.push({ + name: 'userResource', + params: { + listUrl: this.$route.params.listUrl, + url: this.$route.params.url + } + }) + this.$message.success('退订成功') + } else { + this.loading = false + this.$message.error(res.msg) + } + }) + // 在这里处理接收到的订单ID + const orderLog = data + } } } }