Merge branch 'master' of ssh://git.swordlost.top:222/SikongJueluo/FPGA_WebLab

This commit is contained in:
alivender
2025-08-01 20:00:00 +08:00
20 changed files with 947 additions and 520 deletions

View File

@@ -23,6 +23,50 @@ export class Client {
}
getSignalrDevSpec_json( cancelToken?: CancelToken): Promise<void> {
let url_ = this.baseUrl + "/signalr-dev/spec.json";
url_ = url_.replace(/[?&]$/, "");
let options_: AxiosRequestConfig = {
method: "GET",
url: url_,
headers: {
},
cancelToken
};
return this.instance.request(options_).catch((_error: any) => {
if (isAxiosError(_error) && _error.response) {
return _error.response;
} else {
throw _error;
}
}).then((_response: AxiosResponse) => {
return this.processGetSignalrDevSpec_json(_response);
});
}
protected processGetSignalrDevSpec_json(response: AxiosResponse): Promise<void> {
const status = response.status;
let _headers: any = {};
if (response.headers && typeof response.headers === "object") {
for (const k in response.headers) {
if (response.headers.hasOwnProperty(k)) {
_headers[k] = response.headers[k];
}
}
}
if (status === 200) {
const _responseText = response.data;
return Promise.resolve<void>(null as any);
} else if (status !== 200 && status !== 204) {
const _responseText = response.data;
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}
return Promise.resolve<void>(null as any);
}
getGetAPIClientCode( cancelToken?: CancelToken): Promise<void> {
let url_ = this.baseUrl + "/GetAPIClientCode";
url_ = url_.replace(/[?&]$/, "");