diff --git a/src/views/consume/gold/addCoinConsume.vue b/src/views/consume/gold/addCoinConsume.vue index dde1b15..4ff8467 100644 --- a/src/views/consume/gold/addCoinConsume.vue +++ b/src/views/consume/gold/addCoinConsume.vue @@ -225,16 +225,7 @@ const add = async function () { console.log("addConsume.value", addConsume.value) - //存一下 用户的jwcode - // 拼接 jwcode:permanentGold:freeGold - WriteCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName.value}` - //value 为当前消耗时间 - WriteCookiesTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss"); - // 设置cookies,用户jwcode为key,value也是jwcode,过期时间为1天 - Cookies.set(WriteCookies.value, WriteCookiesTime.value, { - expires: - 1, path: '/' - }); + addDisabled.value = true // 发送POST请求 @@ -269,6 +260,16 @@ const add = async function () { function handleResponse(result) { console.log("响应结果", result) if (result.code === 200) { + //存一下 用户的jwcode + // 拼接 jwcode:permanentGold:freeGold + WriteCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName.value}` + //value 为当前消耗时间 + WriteCookiesTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss"); + // 设置cookies,用户jwcode为key,value也是jwcode,过期时间为1天 + Cookies.set(WriteCookies.value, WriteCookiesTime.value, { + expires: + 1, path: '/' + }); ElMessage.success("添加成功"); console.log("请求成功", result); } else {