Bläddra i källkod

修复 时间戳转换错误的问题

master
JinxChen 1 år sedan
förälder
incheckning
83f1b67d72
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. +6
    -6
      src/views/ai-call-alarm/index.vue

+ 6
- 6
src/views/ai-call-alarm/index.vue Visa fil

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


Laddar…
Avbryt
Spara