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