17 lines
438 B
TypeScript
17 lines
438 B
TypeScript
import { Base64 } from "js-base64";
|
|
export const onlinePreview = (url: string) =>
|
|
"http://172.10.10.238:8012/onlinePreview?url=" +
|
|
encodeURIComponent(Base64.encode(url));
|
|
|
|
import api from "@/axios";
|
|
interface OBJ {
|
|
objectUrl: string;
|
|
preSignedUrl: string;
|
|
}
|
|
export const getPreSignedUrl = async (fileName: string) => {
|
|
const resp = await api.get<OBJ>("/file/getPreSignedUrl", {
|
|
fileName,
|
|
});
|
|
return resp.data as OBJ;
|
|
};
|