UNPKG

@aplus-frontend/ui

Version:

22 lines (21 loc) 512 B
import { client as a } from "@aplus-frontend/oss"; const s = /* @__PURE__ */ new Map(), n = Symbol("ossInstance"); async function c(t, r) { if (!t) throw new Error("请传入getOssAccess"); if (s.has(n)) return s.get(n); const e = await a.initOssClient({ locale: r, getOssAccess: t, onFailure: (o) => { throw new Error( typeof o?.message == "string" ? o.message : "获取oss临时权限失败" ); } }); return s.set(n, e), e; } export { c as useOssInit };