mirror of
https://github.com/primedigitaltech/azon_seeker.git
synced 2026-02-06 23:35:44 +08:00
feat: update HTTP/HTTPS headers for image upload in dev and prod
This commit is contained in:
parent
b1f70e9a3a
commit
2c503a9ab6
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "azon-seeker",
|
||||
"displayName": "Azon Seeker v0.7.1.6-beta",
|
||||
"displayName": "Azon Seeker v0.7.1.7-beta",
|
||||
"version": "0.7.2",
|
||||
"private": true,
|
||||
"description": "Starter modify by honestfox101 and PetrichorFun",
|
||||
|
||||
@ -16,6 +16,6 @@ export const isFirefox = navigator.userAgent.includes('Firefox');
|
||||
|
||||
// export const remoteHost = __DEV__ ? '127.0.0.1:8000' : '47.251.4.191:8000';
|
||||
// export const remoteHost = __DEV__ ? '127.0.0.1:18000' : 'vm8nc3zr-18000.usw2.devtunnels.ms';
|
||||
export const remoteHost = __DEV__ ? '127.0.0.1:18000' : 'amzplugin.rekeymed.com';
|
||||
|
||||
export const remoteHost = __DEV__ ? 'ogsm-dev.rekeymed.com:8888' : 'amzplugin.rekeymed.com';
|
||||
// export const remoteHost = __DEV__ ? '127.0.0.1:18000' : 'amzplugin.rekeymed.com';
|
||||
// export const remoteHost = '47.251.4.191:8000';
|
||||
|
||||
@ -23,7 +23,8 @@ export async function uploadImage(
|
||||
const formData = new FormData();
|
||||
formData.append('file', blob, filename);
|
||||
|
||||
const url = `http://${remoteHost}/upload/image/${encodeURIComponent(filename)}`;
|
||||
const httpProtocol = __DEV__ ? 'http' : 'https';
|
||||
const url = `${httpProtocol}://${remoteHost}/upload/image/${encodeURIComponent(filename)}`;
|
||||
const resp = (await fetch(url, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
@ -32,5 +33,5 @@ export async function uploadImage(
|
||||
return undefined;
|
||||
}
|
||||
const data = await resp.json();
|
||||
return `http://${remoteHost}${data.file}`;
|
||||
return `${httpProtocol}://${remoteHost}${data.file}`;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user