chore: add some notes

This commit is contained in:
vben
2021-02-09 23:47:14 +08:00
parent 23657547ab
commit 07c18d602e
22 changed files with 113 additions and 84 deletions

View File

@@ -38,7 +38,7 @@ export function resultError(message = 'Request failed', { code = -1, result = nu
}
export function pagination<T = any>(pageNo: number, pageSize: number, array: T[]): T[] {
let offset = (pageNo - 1) * Number(pageSize);
const offset = (pageNo - 1) * Number(pageSize);
const ret =
offset + Number(pageSize) >= array.length
? array.slice(offset, array.length)

View File

@@ -18,6 +18,7 @@ export default [
timeout: 4000,
method: 'get',
response: ({ query }) => {
console.log(query);
return resultSuccess(demoList);
},
},