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({