feat: 新增预览接口数据动态获取功能

This commit is contained in:
MTrun
2022-03-24 14:19:07 +08:00
parent 0d1c24c536
commit 66373a427b
16 changed files with 82 additions and 33 deletions
+4
View File
@@ -128,6 +128,10 @@ export const openGiteeSourceCode = () => {
openNewWindow(giteeSourceCodePath)
}
export const isPreview = () => {
return document.location.hash.includes('preview')
}
/**
* * 获取当前路由下的参数
* @returns object
+8
View File
@@ -4,6 +4,14 @@ import screenfull from 'screenfull'
import throttle from 'lodash/throttle'
import Image_404 from '../assets/images/exception/image-404.png'
/**
* * 判断是否是开发环境
* @return { Boolean }
*/
export const isDev = () => {
return import.meta.env.DEV
}
/**
* * 生成一个不重复的ID
* @param { Number } randomLength