From 0ac629ea9f03da17fd4ae5572d6e7d56a4e7a68e Mon Sep 17 00:00:00 2001 From: ren Date: Sat, 29 Mar 2025 09:20:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/axios/index.ts | 3 +-- src/views/daxpay/cashier/Cashier.vue | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 0fbf97a..90222eb 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -87,7 +87,7 @@ const transform: AxiosTransform = { } // 接口请求成功,直接返回相应结果 - if (code) { + if (code==ResultEnum.SUCCESS) { return result } // 接口请求错误,统一提示错误信息 这里逻辑可以根据项目进行修改 @@ -103,7 +103,6 @@ const transform: AxiosTransform = { if (!isUrlStr && joinPrefix) { config.url = `${urlPrefix}${config.url}` } - console.log(config.url) if (!isUrlStr && apiUrl && isString(apiUrl)) { } diff --git a/src/views/daxpay/cashier/Cashier.vue b/src/views/daxpay/cashier/Cashier.vue index 31e0468..a9de1f3 100644 --- a/src/views/daxpay/cashier/Cashier.vue +++ b/src/views/daxpay/cashier/Cashier.vue @@ -99,7 +99,7 @@ function formatTime(time: number) { return time.toString().padStart(2, "0"); } //获取倒计时秒数 -function getDownTotalTime(expiredTime: string) { +function getDownTotalTime(expiredTime: any) { let nowTime = new Date(); //获取当前时间 let excessTime = new Date(expiredTime); //获取失效时间 let interval = excessTime.getTime() - nowTime.getTime(); //获取倒计时毫秒数 @@ -156,8 +156,7 @@ onUnmounted(() => { * 初始化 */ function init() { - getOrderAndConfig(orderNo) - .then(({ data, code, msg }) => { + getOrderAndConfig(orderNo).then(({ data, code, msg }) => { if (code != 0) { //如果异常,跳转异常页面 router.replace({ @@ -167,7 +166,7 @@ function init() { return; } orderAndConfig.value = data; //赋值初始化数据 - getDownTotalTime(data.order?.expiredTime); //计算倒计时 + getDownTotalTime(data.order.expiredTime); //计算倒计时 getMinter(); //先执行一下 解决进入页面一秒后才显示倒计时 resume(); //开启倒计时 })