context-path 대응

This commit is contained in:
현성필
2024-01-23 14:44:00 +09:00
parent 1e059a8cf7
commit be1053d832
6 changed files with 81 additions and 37 deletions
+10 -2
View File
@@ -7,10 +7,18 @@
*/
class APIClient {
constructor() {
CLIENT_URL = 'mgmt/api/test.do';
constructor(contextPath) {
window.globals = {};
this.variables = {};
this.abortController = null;
this.contextPath = contextPath || '/';
}
getClientUrl() {
return this.contextPath + this.CLIENT_URL;
}
async sendAPIRequest(model, preProcessCallback, consoleOutput) {
@@ -67,7 +75,7 @@ class APIClient {
const {signal} = this.abortController;
try {
return fetch('/mgmt/api/test.do', {
return fetch(this.getClientUrl(), {
method: 'POST',
headers: {
'Content-Type': 'application/json',