This commit is contained in:
Rizky 2024-02-27 07:22:04 +07:00
parent f011fab5ec
commit 825a380856
1 changed files with 6 additions and 9 deletions

View File

@ -93,10 +93,6 @@ export const getContent = async (
} else if (type === "load.js.dev") { } else if (type === "load.js.dev") {
if (!g.api_gen[type]) if (!g.api_gen[type])
g.api_gen[type] = `\ g.api_gen[type] = `\
(() => {
const baseurl = new URL(location.href);
baseurl.pathname = '';
const url = ${url} || baseurl.toString();
const w = window; const w = window;
if (!w.prasiApi) { if (!w.prasiApi) {
w.prasiApi = {}; w.prasiApi = {};
@ -114,10 +110,6 @@ export const getContent = async (
} else if (type === "load.js.prod") { } else if (type === "load.js.prod") {
if (!g.api_gen[type]) if (!g.api_gen[type])
g.api_gen[type] = `\ g.api_gen[type] = `\
(() => {
const baseurl = new URL(location.href);
baseurl.pathname = '';
const url = ${url} || baseurl.toString();
const w = window; const w = window;
if (!w.prasiApi) { if (!w.prasiApi) {
w.prasiApi = {}; w.prasiApi = {};
@ -127,7 +119,12 @@ export const getContent = async (
} }
})();`; })();`;
} }
return g.api_gen[type]; return `\
(() => {
const baseurl = new URL(location.href);
baseurl.pathname = '';
const url = ${url} || baseurl.toString();
${g.api_gen[type]}`;
}; };
const getApiTypes = async () => { const getApiTypes = async () => {