fix: get请求无法接收参数

This commit is contained in:
Xiongxing 2022-08-12 21:10:39 +08:00
parent 63c1f2f132
commit df6225a752

View File

@ -1,7 +1,7 @@
import request from '@/utils/http' import request from '@/utils/http'
export default { export default {
getPosts: (params = {}) => request.get('posts', params), getPosts: (params = {}) => request.get('posts', { params }),
getPostById: (id) => request.get(`/post/${id}`), getPostById: (id) => request.get(`/post/${id}`),
savePost: (id, data = {}) => { savePost: (id, data = {}) => {
if (id) { if (id) {