feat: 后端用户密码哈希存储

This commit is contained in:
539943419 committed 2025-02-07 23:02:38 +08:00
1 parent 6e0a416422
commit 315916d027
10 files changed
+50 -31

No files matched your search

+4 -8
View File
@@ -39,7 +39,7 @@ type resType = {
} & postItem
const { post: { getPost, updatePost, uploadPost } } = useFetch()
const { post: { getPost, updatePost, uploadPost, deletePost } } = useFetch()
const route = useRoute()
const router = useRouter()
@@ -86,12 +86,7 @@ const handleClickDelete = async () => {
}
)
try {
const response = await $fetch('/api/posts/deletePost', {
method: 'POST',
body: {
id: id.value
}
})
const response = await deletePost(id.value)
ElMessage({
type: 'success',
message: '删除文章完成',
@@ -99,7 +94,8 @@ const handleClickDelete = async () => {
const store = useDefaultStore()
store.deleteCache('posts')
router.back()
} catch {
} catch(e) {
console.error(e)
ElMessage({
type: 'error',
message: '删除失败',