修复店务小程序登录选店弹窗

This commit is contained in:
2026-07-16 14:27:03 +08:00
parent a9a23bfa6d
commit 62a7684e79
2 changed files with 12 additions and 10 deletions
+5 -10
View File
@@ -321,6 +321,10 @@ Page({
async openLoginShopSelector() {
const shopOptions = await this.loadLoginShopOptions()
if (shopOptions.length === 1) {
await this.loginWithSelectedShop(shopOptions[0].id)
return
}
this.setData({
shopOptions,
shopSelectVisible: true,
@@ -336,15 +340,6 @@ Page({
})
},
async tryOpenLoginShopSelector() {
try {
await this.openLoginShopSelector()
return true
} catch (error) {
return false
}
},
async selectLoginShop(event) {
if (this.data.switchingShop) {
return
@@ -437,7 +432,7 @@ Page({
this.saveLoginPreference()
wx.reLaunch({ url: '/pages/planning/index' })
} catch (error) {
if (isShopSelectionRequiredError(error) || await this.tryOpenLoginShopSelector()) {
if (isShopSelectionRequiredError(error)) {
try {
if (!this.data.shopSelectVisible) {
await this.openLoginShopSelector()
+7
View File
@@ -49,3 +49,10 @@
- 原因:`journalctl` 默认会输出提示性文本,直接计数无法区分真实日志和提示行。
- 处理方式:日志计数使用 `journalctl -q ...`,并只输出安全计数或关键词类型,不输出日志正文。
- 以后避免:上线验收中的日志安全计数必须加 `-q`,发现非零后再用脱敏方式定位,不直接打印生产日志全文。
## 2026-07-16 店务小程序登录失败不能触发店铺选择
- 问题:密码错误后登录页仍弹出“选择店铺”,遮挡表单导致无法重新输入。
- 原因:登录失败的通用 catch 分支会继续按账号预查店铺;账号存在但密码错误时也能查到绑定店铺,于是误以为需要选店。
- 处理方式:店铺选择只在登录接口明确返回需要选择登录店铺时触发;只有一个店铺时直接调用选店登录;删除任意错误后的店铺预查兜底。
- 以后避免:登录失败处理不要调用不依赖登录凭证的店铺预查接口;选店弹窗必须由已通过登录校验的响应或明确的选店错误触发。