mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 19:04:23 +00:00
* feat(share): record and display share activity * style(share): remove activity entry borders * docs(share): explain share link activity
16 lines
525 B
TypeScript
16 lines
525 B
TypeScript
import { client } from './client'
|
|
|
|
export function requestShareDownload(
|
|
shareId: string,
|
|
fileId: string,
|
|
key: string,
|
|
purpose?: 'download' | 'prepare' | 'clipboard',
|
|
) {
|
|
const password = localStorage.getItem(`share_pwd_${shareId}`)
|
|
const postDownload = client.api.shares[':shareId'].files[':fileId']['download-url'].$post
|
|
const input = { param: { shareId, fileId }, json: { key, purpose } }
|
|
return password
|
|
? postDownload(input, { headers: { 'x-share-password': password } })
|
|
: postDownload(input)
|
|
}
|