feat: fix the problem in the Operator Market frontend pages

This commit is contained in:
root
2025-12-29 11:38:47 +08:00
parent 29e4a333a9
commit 844add27ea
213 changed files with 45547 additions and 45537 deletions

View File

@@ -1,30 +1,30 @@
function log(message, type = "log", provided = 'console') {
const providedFn = globalThis[provided] || console;
if (providedFn && typeof providedFn[type] === 'function') {
const invokeMethod = providedFn[type ?? 'log'];
invokeMethod.call(providedFn, message);
}
}
function addMockPrefix(urlPrefix, api) {
const newMockApi = {};
Object.keys(api).map(apiKey=>{
newMockApi[apiKey] = urlPrefix + api[apiKey];
});
return new Proxy(newMockApi, {
get(target, prop) {
if (prop in target) {
return target[prop];
} else {
throw new Error(`API ${String(prop)} is not defined.`);
}
}
})
}
module.exports = {
log,
addMockPrefix,
function log(message, type = "log", provided = 'console') {
const providedFn = globalThis[provided] || console;
if (providedFn && typeof providedFn[type] === 'function') {
const invokeMethod = providedFn[type ?? 'log'];
invokeMethod.call(providedFn, message);
}
}
function addMockPrefix(urlPrefix, api) {
const newMockApi = {};
Object.keys(api).map(apiKey=>{
newMockApi[apiKey] = urlPrefix + api[apiKey];
});
return new Proxy(newMockApi, {
get(target, prop) {
if (prop in target) {
return target[prop];
} else {
throw new Error(`API ${String(prop)} is not defined.`);
}
}
})
}
module.exports = {
log,
addMockPrefix,
};