取消了一些乱七八糟不同步的方法
Publish to npm / publish (push) Failing after 10s
Publish to npm / publish (push) Failing after 10s
This commit is contained in:
+11
-7
@@ -77,15 +77,15 @@ async function fetchPost<T = any>(
|
||||
// ── SimApiCore ────────────────────────────────────────
|
||||
|
||||
export class SimApiCore {
|
||||
debug: boolean = true
|
||||
auth: SimApiAuthConfig = {
|
||||
private debug: boolean = true
|
||||
private auth: SimApiAuthConfig = {
|
||||
token_name: 'simapi-auth-token',
|
||||
check_url: '/auth/check',
|
||||
logout_url: '/auth/logout',
|
||||
login_url: '/auth/login',
|
||||
}
|
||||
|
||||
api: SimApiApiConfig = {
|
||||
private api: SimApiApiConfig = {
|
||||
endpoints: {default: ''},
|
||||
defaultEndpoint: 'default',
|
||||
businessCallback: {
|
||||
@@ -146,6 +146,14 @@ export class SimApiCore {
|
||||
}
|
||||
}
|
||||
|
||||
get isDebug() {
|
||||
return this.debug
|
||||
}
|
||||
|
||||
setDebug(debug: boolean) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
setEndpoints(endpoints: { [name: string]: string }): void {
|
||||
this.api.endpoints = {...this.api.endpoints, ...endpoints}
|
||||
}
|
||||
@@ -170,10 +178,6 @@ export class SimApiCore {
|
||||
localStorage.removeItem(this.auth.token_name)
|
||||
}
|
||||
|
||||
get isLoggedIn(): boolean {
|
||||
return !!localStorage.getItem(this.auth.token_name)
|
||||
}
|
||||
|
||||
genS4(): string {
|
||||
return (((1 + Math.random()) * 0x10000 * Date.parse(new Date().toString())) | 0)
|
||||
.toString(16)
|
||||
|
||||
Reference in New Issue
Block a user