diff --git a/apps/admin/src/router/index.ts b/apps/admin/src/router/index.ts index ae2b6d2..5dc7688 100644 --- a/apps/admin/src/router/index.ts +++ b/apps/admin/src/router/index.ts @@ -32,10 +32,15 @@ const router = createRouter({ routes, }) -router.beforeEach((to) => { +router.beforeEach(async (to) => { const authStore = useAuthStore() const isPublic = to.meta?.public === true + // 会话在 HttpOnly cookie 里:刷新后先经 /auth/me 恢复登录态,再判定是否放行 + if (!authStore.isLoggedIn && !isPublic) { + await authStore.ensureSessionChecked() + } + if (!authStore.isLoggedIn && !isPublic) { return { path: '/login', replace: true } } diff --git a/apps/admin/src/views/goods/components/GoodsEditDialog.vue b/apps/admin/src/views/goods/components/GoodsEditDialog.vue index 0303ee2..4136a37 100644 --- a/apps/admin/src/views/goods/components/GoodsEditDialog.vue +++ b/apps/admin/src/views/goods/components/GoodsEditDialog.vue @@ -264,20 +264,6 @@ async function saveMemberPrices(row: { id: string }) { } finally { memberPriceSaving.value = '' } } -async function resetMemberPrice(row: { id: string }, cell: any) { - memberPriceSaving.value = row.id - try { - await productFamiliesApi.deleteOverrides(editFamilyId.value, [ - { sizeId: cell.sizeId, colorId: cell.colorId, craft: cell.craft, logistics: cell.logistics }, - ]) - ElMessage.success('已恢复推导价') - await loadEditFamily() - emit('changed') - } catch (e: any) { - ElMessage.error(e?.response?.data?.message || '恢复失败') - } finally { memberPriceSaving.value = '' } -} - function initEditFamily(family: { familyId?: string; familyCode?: string | null } | null) { editFamilyId.value = family?.familyId ?? '' editFamilyCode.value = family?.familyCode ?? null @@ -610,7 +596,6 @@ async function handleDeleteGood() {
- 尺码 × 颜色 → 价格 保存价格
@@ -621,17 +606,6 @@ async function handleDeleteGood() { - - - - - -
@@ -836,7 +810,7 @@ async function handleDeleteGood() { .member-tags-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .member-tags-edit .md-label { flex-shrink: 0; } .member-price-block { border-top: 1px dashed #e4e7ed; padding-top: 8px; } -.member-price-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; } +.member-price-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 6px; } .member-extra { border-top: 1px dashed #e4e7ed; padding-top: 8px; } .md-empty { display: flex; align-items: center; justify-content: space-between; gap: 8px;