From 83f1b67d722e05c08517cedb46e797b2ba81e688 Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Wed, 7 Jun 2023 14:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai-call-alarm/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/ai-call-alarm/index.vue b/src/views/ai-call-alarm/index.vue index 82c5e85..7bc92c4 100644 --- a/src/views/ai-call-alarm/index.vue +++ b/src/views/ai-call-alarm/index.vue @@ -28,8 +28,8 @@ export default { code: this.code }; let baseUrl = process.env.NODE_ENV === "production" ? 'https://ai.ssjlai.com' : 'https://id.ssjlai.com'; - //let proxyUrl = '/api/id/'; - let reqUrl = `${baseUrl}/watersoutboundapi/getLongLink`; + let reqUrl = '/api/id/getLongLink'; + //let reqUrl = `${baseUrl}/watersoutboundapi/getLongLink`; axios.get(reqUrl, { params: { ...reqParams }, }).then(res =>{ @@ -48,17 +48,17 @@ export default { longLink = data[0].long_link; } const createTime = data[0].create_time; - const nowTime = new Date().getTime(); + // 13位时间戳 除以 1000 再取整 + const nowTime = (new Date().getTime() / 1000).toFixed(); const twoHours = 7200; - if(nowTime - createTime > twoHours) { + if(nowTime - createTime < twoHours) { // 增加过期失效判断,根据接口返回的创建时间与现在时间比较,超过两个小时提示链接过期并且不再跳转 - console.log("::已经超过两个小时"); this.$dialog.confirm({ message: '链接已失效', showCancelButton: false }) } else { - window.location.href = longLink; + window.open(longLink); } } else { this.$dialog.confirm({