增加展示选择
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user