feat(frontend): 桌面端首页删除一级「图片」入口——图片已并入视频页(/image-video)二级菜单,首页仅保留 亚马逊/视频,权限计算同步清理 image 分支

This commit is contained in:
2026-09-09 18:32:48 +08:00
parent 02441565a0
commit 9a487ae9a7
@@ -50,14 +50,6 @@
:class="{ disabled: !videoHref }"
data-column-key="wb"
>视频</router-link>
<router-link
v-if="canShow.image"
:to="imageHref"
class="entrance-btn image"
:class="{ disabled: !imageHref }"
data-column-key="image"
>图片</router-link>
</div>
<div class="toast" :class="{ show: Boolean(toastText) }">{{ toastText }}</div>
@@ -80,17 +72,17 @@ const { checking, updating, currentVersion, hasUpdate, canDownload, hint, checke
// 桌面端原 Flask /logout 已随瘦身下线:统一跳登录页并清本地 token/login?logout=1
const logoutHref = computed(() => `${resolvePageHref('/new_web_source/login.html')}?logout=1`)
type PermissionState = { amazon: boolean; video: boolean; image: boolean }
const permissionState = ref<PermissionState>({ amazon: false, video: false, image: false })
// 桌面端首页仅保留一级入口:亚马逊 / 视频;图片已收进视频页(/image-video)二级菜单。
type PermissionState = { amazon: boolean; video: boolean }
const permissionState = ref<PermissionState>({ amazon: false, video: false })
const permissionUnavailable = ref(false)
const permissionReady = ref(false)
const amazonHref = computed(() => resolvePageHref('/new_web_source/amazon-console.html'))
const videoHref = computed(() => resolvePageHref('/new_web_source/image-video.html'))
const imageHref = computed(() => resolvePageHref('/new_web_source/image.html'))
const canShow = computed(() =>
permissionUnavailable.value ? { amazon: true, video: true, image: true } : permissionState.value,
permissionUnavailable.value ? { amazon: true, video: true } : permissionState.value,
)
function getUid() {
@@ -119,15 +111,14 @@ function computePermissionState(items: PermissionMenuItem[]): PermissionState {
;[item.columnKey, item.column_key, item.routePath, item.route_path].forEach((v) => push(allowedKeys, v))
})
const videoVisible = allowedKeys.indexOf('wb') >= 0
const imageVisible = allowedKeys.indexOf('image') >= 0
let amazonVisible =
allowedRootKeys.indexOf('brand_front_tools') >= 0 ||
allowedRootKeys.indexOf('brand_operation_tools') >= 0 ||
allowedRootKeys.indexOf('brand_logistics_tools') >= 0
if (!hasRootMetadata) {
amazonVisible = allowedColumnKeys.some((key) => key !== 'wb' && key !== 'image')
amazonVisible = allowedColumnKeys.some((key) => key !== 'wb')
}
return { amazon: amazonVisible, video: videoVisible, image: imageVisible }
return { amazon: amazonVisible, video: videoVisible }
}
async function loadPermissions() {
@@ -187,16 +178,14 @@ onMounted(() => {
body {
font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
url("/bg.jpg") center/cover no-repeat;
min-height: 100vh;
}
.home-root {
/* 背景直接落到根容器,避免依赖 body SPA 全局样式覆盖导致图不显示 */
/* 背景只挂根容器,不再写全局 body 背景:页面各自的 body 规则会在 SPA 注入顺序上互相覆盖 */
min-height: 100vh;
background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
url("/bg.jpg") center/cover no-repeat;
image-set(url("/bg.webp") 1x, url("/bg.jpg") 1x) center/cover no-repeat #eef3f7;
display: flex;
flex-direction: column;
align-items: center;