diff --git a/README.md b/README.md index 4468e3ce..618a749f 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,19 @@ v0.2.1使用了golang作为服务端重写,目前已经基本实现了0.2.0版 [更多说明](https://discussion.mblog.club/post/pto2hqoFzDKzZMpvoPZKYuP) +[交流TG群](https://t.me/simple_moments) -[0.2.0的README](https://github.com/kingwrcy/moments/blob/master/README.md) \ No newline at end of file +[交流论坛](https://discussion.mblog.club/) + +[0.2.0的README](https://github.com/kingwrcy/moments/blob/master/README.md) + +#### v0.2.4发布说明 + +1. 发言输入框不再支持#号开头的内容识别为标签了,标签改为单独一列,右键输入标签继续可以. +2. 首页默认不自动加载下一页了,后台增加`是否自动加载下一页`的开关,需要的可以手动开启. +3. 增加代码块的支持,支持语法高亮,使用方式是3个`符号之后跟上代码的语言即可. +4. 修复传第二张图片会把前一张图片删除的bug. +5. 尝试修复ios环境下safari浏览图片超宽的bug. +6. 增加`回到顶部`按钮,pc和手机模式下都有. +7. 修复登出按钮在pc无法看到的bug. +8. 代码块增加一键复制按钮. \ No newline at end of file diff --git a/front/utils/index.ts b/front/utils/index.ts index b3c107ef..2c901450 100644 --- a/front/utils/index.ts +++ b/front/utils/index.ts @@ -19,21 +19,21 @@ export async function useMyFetch(url: string, data?: any) { headers: headers }) if (res.code !== 0) { - if (res.code === 3||res.code === 4){ + if (res.code === 3 || res.code === 4) { global.value.userinfo = {} - window.location.href='/' + window.location.href = '/' throw new Error(res.message) } toast.error(res.message || "请求失败") throw new Error(res.message) } return res.data - } finally{ + } finally { } } -async function upload2S3(files: FileList, onProgress: Function|undefined) { +async function upload2S3(files: FileList, onProgress: Function | undefined) { const result = [] for (let i = 0; i < files.length; i++) { const {preSignedUrl, imageUrl} = await useMyFetch<{ @@ -55,7 +55,7 @@ const upload2S3WithProgress = async (preSignedUrl: string, file: File, onProgres const xhr = new XMLHttpRequest(); xhr.upload.addEventListener('progress', e => onProgress(file.name, e.loaded / e.total)); xhr.addEventListener('load', () => { - if(xhr.responseType === 'json'){ + if (xhr.responseType === 'json') { return resolve(JSON.parse(xhr.responseText)) } return resolve(null); @@ -70,7 +70,7 @@ const upload2S3WithProgress = async (preSignedUrl: string, file: File, onProgres } -export async function useUpload(files: FileList | null, onProgress: Function|undefined = undefined) { +export async function useUpload(files: FileList | null, onProgress: Function | undefined = undefined) { const sysConfig = useState('sysConfig') const result = [] if (!files || files.length === 0) { @@ -85,7 +85,7 @@ export async function useUpload(files: FileList | null, onProgress: Function|und } if (sysConfig.value.enableS3) { - return await upload2S3(files,onProgress) + return await upload2S3(files, onProgress) } for (let i = 0; i < files.length; i++) { try { @@ -137,9 +137,11 @@ export const md = markdownit({ breaks: true, }) -md.use(await Shiki({ +Shiki({ themes: { light: 'aurora-x', dark: 'aurora-x', } -})) \ No newline at end of file +}).then((r) => { + md.use(r) +})