weaver_trunk_cli/pc4mobx/hrm/stores/domain/authority.js

26 lines
396 B
JavaScript
Raw Normal View History

2023-03-14 09:11:54 +08:00
import {
observable,
action
} from 'mobx';
export default class AuthorityStore {
constructor(api) {
this.api = api;
}
@observable hasRight = false;
@observable loading = true;
@action fetchAuthority = () => {
2024-12-11 15:32:14 +08:00
return this.api.fetchAuthority().then(datas => {
const {
hasRight
} = datas;
2023-03-14 09:11:54 +08:00
2024-12-11 15:32:14 +08:00
this.hasRight = hasRight;
this.loading = false;
2023-03-14 09:11:54 +08:00
2024-12-11 15:32:14 +08:00
return hasRight;
});
2023-03-14 09:11:54 +08:00
}
}