feat(web): 创作者中心「当前创作者」代看下拉 + 未绑定引导页
为什么:超管点进创作者中心原本是一片"未绑定创作者主体"的报错,既没说明原因也没有出路。 这批把两件事做出来:超管能在顶部选一个创作者只读代看;没有创作者身份的账号看到明确的引导页而不是白屏。 - 新增 useCreatorAccess(身份三态:granted / need-target / unbound)+ ImpersonationBar + CreatorAccessGuide, 四个页面用 CreatorCenterPage 统一套壳;身份不满足时不打业务接口,避免一串无意义的报错提示 - 代看目标存 localStorage,由 axios.request 统一给 /admin/creator-center 的请求加 X-Creator-Id 头 (不做查询参数;后端只对具备 impersonate 权限的账号认这个头) - axios 支持 silent 请求:业务码非 0 时不弹全局提示、把 Result 交给调用方判断(引导页据此分流) - 代看只读体验:代看态下「新建作品 / 编辑 / 提交审核 / 撤回」不渲染,编辑页整页禁用并提示原因 - 顶部下拉只在有 impersonate 权限时显示;无权限账号看不到、也不会请求 targets 接口
This commit is contained in:
1 parent
0a2e3e0b81
commit
685c912313
19 files changed
+995
-658
No files matched your search
@@ -8,6 +8,7 @@ import {
|
||||
submitDramaApi,
|
||||
withdrawSubmissionApi
|
||||
} from '@/api/admin/creatorCenter'
|
||||
import { useCreatorAccess } from './useCreatorAccess'
|
||||
|
||||
/** 作品状态:与后端 ContentStatus 一一对应 */
|
||||
export const DRAMA_STATUS = [
|
||||
@@ -70,6 +71,7 @@ export function submitOptions(row) {
|
||||
}
|
||||
|
||||
export function useCreatorWorkspace() {
|
||||
const { ensureAccess } = useCreatorAccess()
|
||||
const profileLoading = ref(false)
|
||||
const profile = ref(null)
|
||||
|
||||
@@ -190,7 +192,9 @@ export function useCreatorWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
// 身份不满足(未绑定 / 未选代看目标)时不打业务接口,交给外层渲染引导页
|
||||
if (!(await ensureAccess())) return
|
||||
loadProfile()
|
||||
loadDramas()
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user