Skip to content

Commit

Permalink
修改readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Aug 9, 2024
1 parent 69ced20 commit 7c9d436
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
[交流论坛](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. 代码块增加一键复制按钮.
20 changes: 11 additions & 9 deletions front/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ export async function useMyFetch<T>(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<{
Expand All @@ -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);
Expand All @@ -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<SysConfigVO>('sysConfig')
const result = []
if (!files || files.length === 0) {
Expand All @@ -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 {
Expand Down Expand Up @@ -137,9 +137,11 @@ export const md = markdownit({
breaks: true,
})

md.use(await Shiki({
Shiki({
themes: {
light: 'aurora-x',
dark: 'aurora-x',
}
}))
}).then((r) => {
md.use(r)
})

0 comments on commit 7c9d436

Please sign in to comment.