chore(buyer): 落地 ESLint 9 并清理调试代码

- 新增 eslint.config.js(flat config, vue3-essential),移除废弃的 .eslintrc.js/.eslintignore(引用已废弃的 babel-eslint),package.json 增加 lint/lint:fix 脚本
- 清理 17 处调试 console.log;修复 24 处空 catch(15 处补 console.warn 业务提示,9 处加注释说明可安全忽略)
- 修复存量 lint error:9 处 prop 默认值改为函数形式、3 处未使用组件、1 处 v-if/v-for 同级、1 处空 else
- vue.config.js 生产环境 terser 开启 drop_console 兜底
This commit is contained in:
pikachu1995@126.com
2026-10-09 09:45:59 +08:00
parent 3ec3f11d5b
commit 89711af0e6
40 changed files with 630 additions and 98 deletions

View File

@@ -186,7 +186,6 @@ export default {
this.buynow(item.skuId, item.goodsId)
},
buynow(skuId, goodsId,storeId) { // 跳转详情
console.log(this.params.type)
let url
if (this.params.type === 'STORE') {
url = this.$router.resolve({

View File

@@ -156,7 +156,9 @@ export default {
try {
const userInfo = JSON.parse(rawUserInfo);
if (userInfo && userInfo.mobile) this.mobile = userInfo.mobile;
} catch (e) {}
} catch {
// 缓存的用户信息解析失败时忽略,改走接口获取
}
}
if (!storage.getItem('accessToken')) return;
getMemberMsg().then(res => {
@@ -164,7 +166,9 @@ export default {
storage.setItem('userInfo', res.result);
this.mobile = res.result.mobile || '';
}
}).catch(() => {});
}).catch((err) => {
console.warn('获取会员信息失败', err);
});
},
normalizePwdError (message) {
if (!message) return '修改失败,请稍后重试';

View File

@@ -54,7 +54,9 @@ export default {
this.detail = res.result
sessionStorage.setItem(CACHE_KEY, JSON.stringify(res.result))
}
}).catch(() => {}).finally(() => {
}).catch((err) => {
console.warn('获取消息详情失败', err)
}).finally(() => {
this.loaded = true
this.markRead()
})
@@ -76,7 +78,9 @@ export default {
this.detail.status = 'ALREADY_READY'
refreshUnreadMessage()
}
}).catch(() => {})
}).catch(() => {
// 标记已读为尽力而为操作,失败可忽略
})
},
goBack () {
this.$router.push({ name: 'MsgList' })

View File

@@ -111,7 +111,6 @@ export default {
// 获取地址详情
getAddrDetail(id).then((res) => {
if (res.success) {
console.log(res);
const data = res.result;
data.address = res.result.consigneeAddressPath.replace(/,/g, " ");
this.formData = data;

View File

@@ -113,7 +113,6 @@ export default {
data () {
const checkNum = (rule, value, callback) => {
if (value === '') {
console.log(RegExp);
callback(new Error('请填写提交数量'));
} else if (value > this.info.num) {
callback(new Error('提交数量不能大于购买数量'));

View File

@@ -78,7 +78,6 @@ export default {
getAddrList () {
// 获取地址列表
memberAddress().then((res) => {
console.log(res);
if (res.success) {
this.list = res.result.records;
}

View File

@@ -260,7 +260,9 @@ export default {
this.getList();
}
})
.catch(() => {})
.catch((err) => {
console.warn('激活礼品卡失败', err);
})
.finally(() => {
this.activatingId = "";
});