pwa
This commit is contained in:
@@ -28,6 +28,16 @@ async function http(path, { method = 'GET', body } = {}) {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export const article = {
|
||||
search({ target, filter, offset, maxCount } = {}) {
|
||||
const params = new URLSearchParams({ target });
|
||||
if (filter) params.set('filter', filter);
|
||||
if (offset) params.set('offset', String(offset));
|
||||
if (maxCount != null) params.set('maxCount', String(maxCount));
|
||||
return http(`/api/article/search?${params}`);
|
||||
},
|
||||
};
|
||||
|
||||
export const auth = {
|
||||
async me() {
|
||||
try {
|
||||
@@ -66,4 +76,4 @@ export const auth = {
|
||||
},
|
||||
};
|
||||
|
||||
export default { auth };
|
||||
export default { auth, article };
|
||||
|
||||
Reference in New Issue
Block a user