style: lint
This commit is contained in:
1 parent
b29f533a3b
commit
ac5506a43b
48 files changed
+1027
-1115
No files matched your search
@@ -2,16 +2,16 @@ export interface OB11Config {
|
||||
[key: string]: any;
|
||||
http: {
|
||||
enable: boolean;
|
||||
host: "";
|
||||
host: '';
|
||||
port: number;
|
||||
secret: "";
|
||||
secret: '';
|
||||
enableHeart: boolean;
|
||||
enablePost: boolean;
|
||||
postUrls: string[];
|
||||
};
|
||||
ws: {
|
||||
enable: boolean;
|
||||
host: "";
|
||||
host: '';
|
||||
port: number;
|
||||
};
|
||||
reverseWs: {
|
||||
@@ -21,45 +21,45 @@ export interface OB11Config {
|
||||
|
||||
debug: boolean;
|
||||
heartInterval: number;
|
||||
messagePostFormat: "array" | "string";
|
||||
messagePostFormat: 'array' | 'string';
|
||||
enableLocalFile2Url: boolean;
|
||||
musicSignUrl: "";
|
||||
musicSignUrl: '';
|
||||
reportSelfMessage: boolean;
|
||||
token: "";
|
||||
token: '';
|
||||
}
|
||||
|
||||
class WebUiApiOB11ConfigWrapper {
|
||||
private retCredential: string = "";
|
||||
private retCredential: string = '';
|
||||
async Init(Credential: string) {
|
||||
this.retCredential = Credential;
|
||||
}
|
||||
async GetOB11Config(): Promise<OB11Config> {
|
||||
let ConfigResponse = await fetch("/api/OB11Config/GetConfig", {
|
||||
method: "POST",
|
||||
const ConfigResponse = await fetch('/api/OB11Config/GetConfig', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.retCredential,
|
||||
"Content-Type": "application/json",
|
||||
Authorization: 'Bearer ' + this.retCredential,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
if (ConfigResponse.status == 200) {
|
||||
let ConfigResponseJson = await ConfigResponse.json();
|
||||
const ConfigResponseJson = await ConfigResponse.json();
|
||||
if (ConfigResponseJson.code == 0) {
|
||||
return ConfigResponseJson?.data;
|
||||
}
|
||||
}
|
||||
return {} as OB11Config;
|
||||
}
|
||||
async SetOB11Config(config: OB11Config): Promise<Boolean> {
|
||||
let ConfigResponse = await fetch("/api/OB11Config/SetConfig", {
|
||||
method: "POST",
|
||||
async SetOB11Config(config: OB11Config): Promise<boolean> {
|
||||
const ConfigResponse = await fetch('/api/OB11Config/SetConfig', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.retCredential,
|
||||
"Content-Type": "application/json",
|
||||
Authorization: 'Bearer ' + this.retCredential,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ config: JSON.stringify(config) }),
|
||||
});
|
||||
if (ConfigResponse.status == 200) {
|
||||
let ConfigResponseJson = await ConfigResponse.json();
|
||||
const ConfigResponseJson = await ConfigResponse.json();
|
||||
if (ConfigResponseJson.code == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user