增加展示选择

This commit is contained in:
2026-06-12 10:16:27 +08:00
parent 389c22c627
commit 81f3e1d3b6
28 changed files with 5983 additions and 131 deletions

View File

@@ -150,6 +150,7 @@ import { getCurrentUser, logout, setIsLoggedIn, setUserProfile } from '@/utils/s
import { checkMerchantAccount, clearAuth, goMerchantHome, isMerchantRole, requireMerchantAuth, setMerchantInfo } from '@/utils/merchantAuth.uts'
import { clearDeliveryAuth, goDeliveryHome, requireDeliveryAuth, saveDeliverySession } from '@/utils/deliveryAuth.uts'
import { loginDelivery } from '@/services/deliveryService.uts'
import { loadCurrentAkUser } from '@/utils/akUserMapping.uts'
import type { UserProfile } from '@/types/mall-types.uts'
import { AkReq } from '@/uni_modules/ak-req/index.uts'
@@ -498,6 +499,15 @@ const handleLogin = async () => {
clearDeliveryAuth()
const result = await loginDelivery({ account: account.value.trim(), password: password.value.trim() })
saveDeliverySession(result.token, result.userInfo, result.deliveryInfo)
// 加载 ak_users 映射Supabase Auth ID -> 业务用户 ID
try {
await loadCurrentAkUser()
console.log('[Login] ak_users 映射加载成功')
} catch (akErr) {
console.warn('[Login] ⚠️ ak_users 映射加载失败(不影响登录):', akErr)
}
const authResult = await requireDeliveryAuth({ redirectOnFail: false, toastOnFail: false })
if (!authResult.ok) {
clearDeliveryAuth()