mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-26 22:00:28 +08:00
front: finish docx & back: init
This commit is contained in:
19
frontend/vben/mock/page/file.ts
Normal file
19
frontend/vben/mock/page/file.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
import { resultError, resultSuccess, getRequestToken, requestParams } from '../_util'
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/api/dlFile',
|
||||
timeout: 1000,
|
||||
method: 'get',
|
||||
response: (request: requestParams) => {
|
||||
const token = getRequestToken(request)
|
||||
if (!token) return resultError('Invalid token')
|
||||
const id = Number(request.query.id)
|
||||
if (!id || id < 0) return resultError('Invalid id')
|
||||
return resultSuccess({
|
||||
url: '/file/' + id + '.docx',
|
||||
})
|
||||
},
|
||||
},
|
||||
] as MockMethod[]
|
||||
Reference in New Issue
Block a user