feat: remove unused code
This commit is contained in:
parent
7a62ad32a9
commit
993c24cd36
|
@ -88,7 +88,6 @@ export const DesktopLayout = observer(() => {
|
|||
width={"50%"}
|
||||
onClose={() => {
|
||||
store.ui.toggleLeftDrawerIsShown()
|
||||
console.log("clicked");
|
||||
}}
|
||||
visible={store.ui.leftDrawerIsShown}
|
||||
key={"dashboard-drawer"}
|
||||
|
@ -211,7 +210,6 @@ export const DesktopLayout = observer(() => {
|
|||
}
|
||||
onClick={() => {
|
||||
store.ui.toggleLeftDrawerIsShown();
|
||||
console.log("apa")
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
|
|
|
@ -98,7 +98,8 @@ export const Product = observer(() => {
|
|||
Prdct
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</Card><PulsaModal visible={visibleModal}
|
||||
</Card>
|
||||
<PulsaModal visible={visibleModal}
|
||||
confirmLoading={confirmLoading}
|
||||
initialData={initialData}
|
||||
onCreate={async (data) => {
|
||||
|
|
|
@ -7,17 +7,11 @@ export class Authentication {
|
|||
isLoginLoading = false;
|
||||
ctx;
|
||||
|
||||
accessToken = '';
|
||||
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
get isLoggedIn() {
|
||||
return !!this.accessToken;
|
||||
}
|
||||
|
||||
get userData() {
|
||||
const defaultValue = {
|
||||
role: '',
|
||||
|
@ -26,8 +20,7 @@ export class Authentication {
|
|||
};
|
||||
|
||||
try {
|
||||
console.log(JSON.parse(atob(this.accessToken.split('.')[1])), "isi jwt")
|
||||
return JSON.parse(atob(this.accessToken.split('.')[1]));
|
||||
return JSON.parse(atob(TokenUtil.accessToken.split('.')[1]));
|
||||
} catch (err) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
@ -41,7 +34,6 @@ export class Authentication {
|
|||
try {
|
||||
const result = await http.post('/auth/login').send({username, password});
|
||||
|
||||
this.accessToken = result.body.access_token;
|
||||
TokenUtil.setAccessToken(result.body.access_token);
|
||||
TokenUtil.persistToken();
|
||||
runInAction(() => {
|
||||
|
@ -61,6 +53,5 @@ export class Authentication {
|
|||
TokenUtil.clearAccessToken();
|
||||
TokenUtil.persistToken();
|
||||
this.isLoggedIn = false;
|
||||
this.accessToken = '';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ export class Store {
|
|||
TokenUtil.loadToken();
|
||||
if (TokenUtil.accessToken) {
|
||||
this.authentication.isLoggedIn = true;
|
||||
this.authentication.accessToken = TokenUtil.accessToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user