|
@@ -16,8 +16,8 @@ const global = window as any;
|
|
|
|
|
|
let count = 0;
|
|
let count = 0;
|
|
export const api =
|
|
export const api =
|
|
- // import.meta.env.DEV && !global.android
|
|
|
|
- true
|
|
|
|
|
|
+ import.meta.env.DEV && !global.android
|
|
|
|
+ // true
|
|
? // const api = import.meta.env.DEV
|
|
? // const api = import.meta.env.DEV
|
|
{
|
|
{
|
|
async setStore(data) {
|
|
async setStore(data) {
|
|
@@ -47,7 +47,7 @@ export const api =
|
|
url = url.trim();
|
|
url = url.trim();
|
|
const paths = url.split("/")
|
|
const paths = url.split("/")
|
|
const notBase64BaseTypes = [
|
|
const notBase64BaseTypes = [
|
|
- ".png", ".jpg", ".bin"
|
|
|
|
|
|
+ ".png", ".jpg"
|
|
]
|
|
]
|
|
const notBase64 = notBase64BaseTypes.some(type => paths[paths.length - 1].includes(type))
|
|
const notBase64 = notBase64BaseTypes.some(type => paths[paths.length - 1].includes(type))
|
|
if (notBase64) {
|
|
if (notBase64) {
|
|
@@ -97,7 +97,8 @@ export const api =
|
|
|
|
|
|
const paths = fileUrl.split("/")
|
|
const paths = fileUrl.split("/")
|
|
const notBase64BaseTypes = [
|
|
const notBase64BaseTypes = [
|
|
- ".png", ".jpg", ".bin"
|
|
|
|
|
|
+ // ".png", ".jpg"
|
|
|
|
+ // , ".bin"
|
|
]
|
|
]
|
|
const notBase64 = notBase64BaseTypes.some(type => paths[paths.length - 1].includes(type))
|
|
const notBase64 = notBase64BaseTypes.some(type => paths[paths.length - 1].includes(type))
|
|
|
|
|
|
@@ -105,7 +106,7 @@ export const api =
|
|
return await new Promise<string>((resolve) => {
|
|
return await new Promise<string>((resolve) => {
|
|
const apiName = `getImageCallback${count++}`
|
|
const apiName = `getImageCallback${count++}`
|
|
global[apiName] = (base64) => {
|
|
global[apiName] = (base64) => {
|
|
- console.error("请求url:" + fileUrl, "返回:" + base64.substring(0, 60))
|
|
|
|
|
|
+ // console.error("请求url:" + fileUrl, "返回:" + base64.substring(0, 60))
|
|
resolve(URL.createObjectURL(base64ToBlob(base64)));
|
|
resolve(URL.createObjectURL(base64ToBlob(base64)));
|
|
delete global[apiName]
|
|
delete global[apiName]
|
|
};
|
|
};
|