diff --git a/src/compontets/common/LoaderWhite.jsx b/src/compontets/common/LoaderWhite.jsx index fe7de008..ba86005f 100644 --- a/src/compontets/common/LoaderWhite.jsx +++ b/src/compontets/common/LoaderWhite.jsx @@ -1,13 +1,13 @@ import styles from './LoaderWhite.module.css' /** 自定义 加载动画 白色圈圈*/ -export default () => { +export default ({loadName = '正在玩命加载中...'}) => { return (
-
正在玩命加载中...
+
{loadName}
) } diff --git a/src/pages/Blog/index.jsx b/src/pages/Blog/index.jsx index 60eb04f9..af2027d5 100644 --- a/src/pages/Blog/index.jsx +++ b/src/pages/Blog/index.jsx @@ -34,7 +34,8 @@ const {Content, Sider} = Layout * */ const Blog = () => { const [content, setContent] = useState('# 欢迎来到仰晨博客'); - const [loading, setLoading] = useState(false) // 加载状态 + const [loading, setLoading] = useState(false) // 加载状态 + const [initLoad, setInitLoad] = useState(true) // 初始加载菜单状态 const [menu, setMenu] = useState(items(blogMenu)) // 菜单项 const [selectKey, setSelectKey] = useState([]) // 菜单选中项【子,父】 @@ -44,7 +45,7 @@ const Blog = () => { /** 页面加载菜单 (和读取URL的菜单) */ useEffect(() => { - (()=> init())() + init() }, []) /** 初始化页面加载菜单 (和读取URL的菜单) */ @@ -52,6 +53,7 @@ const Blog = () => { const blogIconObj = await getBlogItemIconObj(); // 请求获取图标 const blogList = await getBlogList(); // 请求获取最新菜单 setMenu(items(blogList, blogIconObj)) // 生成菜单并设置到state + setInitLoad(false) // ——————————————————————🟡处理带URL进来的情况🟡———————————————————————— const params = window.location.href.split('?')?.[1]; @@ -81,8 +83,8 @@ const Blog = () => { }).finally(() => setLoading(false)) } - - + + return ( {/*------- 页面左侧 -------*/} @@ -92,14 +94,17 @@ const Blog = () => { style={{overflow: 'auto'}} collapsible > - setSelectKey(l => v.length > 0 ? [l[0], v[1]] : [l[0], null])} // 点击展开菜单 - /> + {initLoad ? + + : + setSelectKey(l => v.length > 0 ? [l[0], v[1]] : [l[0], null])} // 点击展开菜单 + />} {/*------ 页面右侧 -------*/} diff --git a/src/pages/MemoDrawer/compontets/FormModal.jsx b/src/pages/MemoDrawer/compontets/FormModal.jsx index 4649823a..c60c1205 100644 --- a/src/pages/MemoDrawer/compontets/FormModal.jsx +++ b/src/pages/MemoDrawer/compontets/FormModal.jsx @@ -7,6 +7,11 @@ import modalStyle from './formModal.module.css' import CommonStore from "../../../store/CommonStore"; const {TextArea} = Input; +/** 外部图片链接列表 */ +const externalImgBedList = [ + {src: 'https://playground.z.wiki/img-cloud/index.html', title: '外部图床1(可能失效,注意信息安全)'}, + {src: 'https://ycimg.pages.dev/', title: '外部图床2(加载缓慢,最大支持5M)'}, +] /** * 新增/编辑备忘录弹窗 * @@ -125,7 +130,26 @@ const FormModal = ({isOpen, setOpen, data, reList, currentMemoType}) => { } }, 100) } - + + /** 打开外部图床弹窗 */ + const openExternalImgModel = (title, src) => + modal.info({ + title, + style: {top: 20}, + wrapClassName:modalStyle.externalImgModel, + width: '100vh', + okText: '关闭', + maskClosable: true, + content: +