refactor(js): rename and adjust login auth check function

调整了微信小程序端的登录授权判断逻辑,重命名函数并优化代码结构,补充其他平台的TODO注释
This commit is contained in:
2026-05-19 11:56:21 +08:00
parent 70fbdce641
commit 3a310f0b98

View File

@@ -66,19 +66,20 @@ export default {
this.$refs.officialAccountsPopup.close();
},
// 判断是否需要登录授权
_needLoginAuth() {
_requireHomeAuth() {
// #ifdef MP-WEIXIN
// 检查 index_login_auth 都开启时才需要登录授权
return this.shopInfo?.index_login_auth == 1;
return this.shopInfo?.index_login_auth === 1;
// #endif
// TODO: 其他平台, 后面可以根据平台类型判断
return false;
},
// 统一处理点击及触摸事件
_handleDiyGroupInteractionEvent(payload) {
// #ifdef H5
// 如果是 H5 环境,直接返回 true 继续传播
return true;
// #endif
// 如果不需要登录授权,直接返回 true 继续传播
if (!this._needLoginAuth()) {
if (!this._requireHomeAuth()) {
return true;
}