Browse Source

Merge branch 'develop' into test

test
JinxChen 1 year ago
parent
commit
8467bc9bed
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/views/ai-call-alarm/index.vue

+ 6
- 6
src/views/ai-call-alarm/index.vue View File

@@ -28,8 +28,8 @@ export default {
code: this.code code: this.code
}; };
let baseUrl = process.env.NODE_ENV === "production" ? 'https://ai.ssjlai.com' : 'https://id.ssjlai.com'; 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, { axios.get(reqUrl, {
params: { ...reqParams }, params: { ...reqParams },
}).then(res =>{ }).then(res =>{
@@ -48,17 +48,17 @@ export default {
longLink = data[0].long_link; longLink = data[0].long_link;
} }
const createTime = data[0].create_time; const createTime = data[0].create_time;
const nowTime = new Date().getTime();
// 13位时间戳 除以 1000 再取整
const nowTime = (new Date().getTime() / 1000).toFixed();
const twoHours = 7200; const twoHours = 7200;
if(nowTime - createTime > twoHours) {
if(nowTime - createTime < twoHours) {
// 增加过期失效判断,根据接口返回的创建时间与现在时间比较,超过两个小时提示链接过期并且不再跳转 // 增加过期失效判断,根据接口返回的创建时间与现在时间比较,超过两个小时提示链接过期并且不再跳转
console.log("::已经超过两个小时");
this.$dialog.confirm({ this.$dialog.confirm({
message: '链接已失效', message: '链接已失效',
showCancelButton: false showCancelButton: false
}) })
} else { } else {
window.location.href = longLink;
window.open(longLink);
} }
} else { } else {
this.$dialog.confirm({ this.$dialog.confirm({


Loading…
Cancel
Save