From 63c6ad0ec0ff86f79d964b668e06dbf694d31960 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Fri, 5 Feb 2021 23:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E4=BA=AB=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=9C=AA=E6=AD=A3=E7=A1=AE=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Share.vue | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/components/Share.vue b/src/components/Share.vue index 90a1767..fa12777 100644 --- a/src/components/Share.vue +++ b/src/components/Share.vue @@ -76,27 +76,23 @@ export default { info: {} } }, - async getUrl (dl, index) { - const t = dl.dd._t - if (t) { - return t.split('#')[index].split('$')[1] - } else { - const id = this.share.info.ids || this.share.info.id - const cacheKey = this.share.key + '@' + id - let res = this.DetailCache[cacheKey] - if (!this.DetailCache[cacheKey]) { - res = await zy.detail(this.share.key, id) - this.DetailCache[cacheKey] = res - } - if (res) { - return res.fullList[0].list[index] - } + async getUrl (index) { + const id = this.share.info.ids || this.share.info.id + const cacheKey = this.share.key + '@' + id + let res = this.DetailCache[cacheKey] + if (!this.DetailCache[cacheKey]) { + res = await zy.detail(this.share.key, id) + this.DetailCache[cacheKey] = res + } + if (res) { + const url = res.fullList[0].list[index] + return url.includes('$') ? url.split('$')[1] : url } }, async getDetail () { this.loading = true const index = this.share.index || 0 - const url = await this.getUrl(this.share.info.dl, index) + const url = await this.getUrl(index) this.link = 'http://hunlongyu.gitee.io/zy-player-web?url=' + url + '&name=' + this.share.info.name this.loading = false this.$nextTick(() => {