错误漏删
This commit is contained in:
parent
688658d1c2
commit
b00dac74de
|
@ -136,7 +136,7 @@ class BoxApi {
|
|||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async addUser(username: string, password: string, email: string = "", token: string | null = null): Promise<any> {
|
||||
try {
|
||||
|
@ -162,7 +162,7 @@ class BoxApi {
|
|||
}
|
||||
}
|
||||
|
||||
public async rmUser(username: string, token: string | null = null): Promise<any> {
|
||||
public async rmUser(username: string, token: string | null = null): Promise<any> {
|
||||
try {
|
||||
const data = {
|
||||
username: username
|
||||
|
@ -177,9 +177,9 @@ class BoxApi {
|
|||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async getAllUsers(token: string | null = null): Promise<any> {
|
||||
public async getAllUsers(token: string | null = null): Promise<any> {
|
||||
try {
|
||||
const res = await this.axios.get(this.apiAllusers, this._authHeader(token));
|
||||
if (res.data.err.ec === 0) {
|
||||
|
@ -190,7 +190,7 @@ class BoxApi {
|
|||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async getCamerasByUrl(url: string, token: string | null = null): Promise<any> {
|
||||
try {
|
||||
|
@ -339,7 +339,7 @@ class BoxApi {
|
|||
|
||||
private _authHeader(token: string | null = null): object {
|
||||
// const access_token = token === "" ? this.token : token;
|
||||
const alertToken = localStorage.getItem(`alertToken`) || token || this.token || "" ||"";
|
||||
const alertToken = localStorage.getItem(`alertToken`) || token || this.token || "" || "";
|
||||
return {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
Loading…
Reference in New Issue