10. 接入预览的功能

master
YunaiV 3 years ago
parent 88fb0854a9
commit 099263d3d9
  1. 5
      src/views/preview/suspenseIndex.vue
  2. 6
      src/views/preview/utils/storage.ts

@ -50,12 +50,11 @@ const storageList: ChartEditStorageType[] = getSessionStorage(
)
const localStorageInfo = await getSessionStorageInfo() as unknown as ChartEditStorageType
setTitle(`预览-${localStorageInfo.editCanvasConfig.projectName}`)
// @ts-ignore
if(localStorageInfo.isRelease === false) {
if (localStorageInfo.isRelease === false) {
routerTurnByName(PageEnum.REDIRECT_UN_PUBLISH_NAME, true, false)
}
setTitle(`预览-${localStorageInfo?.editCanvasConfig.projectName}`)
const previewRefStyle = computed(() => {
return {

@ -16,10 +16,10 @@ export const getSessionStorageInfo = async () => {
// 是否本地预览
if (!storageList || storageList.findIndex(e => e.id === id.toString()) === -1) {
// 接口调用
const res = await fetchProjectApi({ projectId: id })
const res = await fetchProjectApi({ id: id })
if (res && res.code === ResultEnum.SUCCESS) {
const { content, state } = res.data
if (state === -1) {
const { content, status } = res.data
if (status === 1) {
// 跳转未发布页
return { isRelease: false }
}

Loading…
Cancel
Save