diff --git a/cli-traffic.html b/cli-traffic.html index 72b0a3d..8621925 100644 --- a/cli-traffic.html +++ b/cli-traffic.html @@ -393,6 +393,7 @@ Phone 验证码 状态 + 过期时间 操作 @@ -414,6 +415,16 @@ 已使用 过期 + + + + + - + 取消 + 删除 @@ -477,8 +491,12 @@ {{formatDate(data[indextr].expireTime)}} + 取消 + this.cancelSms(row) + }); + }, + cancelSms(row){ + this.showLoading(); + + let data = JSON.stringify({ + id:row.id}); + fetch(requestApi + "/sms-phone/cancel", { + headers: { + Authorization: `Bearer ${this.token}`, + "Content-Type": "application/json", + Accept: "application/json", + }, + method: "PUT", + body: data, + }) + .then((res) => res.json()) + .then((response) => { + if (response.code === 200) { + this.$vs.notify({ + title: "提示", + color: "success", + text: "取消成功", + position: "top-right", + }); + + this.getMyBalance(); + this.getSmsList(); + } else { + this.$vs.notify({ + title: "提示", + color: "danger", + text: response.msg, + position: "top-right", + }); + } + }) + .catch((error) => { + console.log(error); + }) + .finally(() => { + this.hiddenLoading(); + }); + }, }, });