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

@@ -136,7 +136,9 @@ export default {
loadStore(id) {
getStoreById(id).then((res) => {
if (res.success && res.result) this.store = res.result;
}).catch(() => {});
}).catch((err) => {
console.warn('获取店铺信息失败', err);
});
},
// 按销量取店内商品,去掉当前商品,最多 4 个
loadRecommend(id) {
@@ -151,14 +153,18 @@ export default {
this.recommends = records
.filter((item) => String(item.goodsId) !== String(this.goodsId))
.slice(0, 4);
}).catch(() => {});
}).catch(() => {
// 推荐商品为可选数据,加载失败时静默
});
},
// 同时有 token 和用户信息才查收藏,避免残留 userInfo 触发登录跳转
loadCollected(id) {
if (!this.Cookies.getItem("accessToken") || !this.Cookies.getItem("userInfo")) return;
isStoreCollection("STORE", id).then((res) => {
if (res.success && res.result) this.collected = true;
}).catch(() => {});
}).catch(() => {
// 收藏状态为可选数据,失败时静默
});
},
goStore() {
this.$router.push({ path: "/merchant", query: { id: this.storeId } });