mirror of https://github.com/openspug/spug
F 修复账户所属角色某些情况下未正确展示的问题
parent
7d734df728
commit
d4ea1e4f4b
|
@ -22,7 +22,12 @@ class ComTable extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
store.fetchRecords()
|
||||
if (rStore.records.length === 0) {
|
||||
rStore.fetchRecords()
|
||||
.then(() => store.fetchRecords())
|
||||
} else {
|
||||
store.fetchRecords()
|
||||
}
|
||||
}
|
||||
|
||||
columns = [{
|
||||
|
|
|
@ -10,15 +10,8 @@ import { SearchForm, AuthDiv, Breadcrumb } from 'components';
|
|||
import ComTable from './Table';
|
||||
import ComForm from './Form';
|
||||
import store from './store';
|
||||
import rStore from '../role/store';
|
||||
|
||||
export default observer(function () {
|
||||
useEffect(() => {
|
||||
if (rStore.records.length === 0) {
|
||||
rStore.fetchRecords()
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<AuthDiv auth="system.account.view">
|
||||
<Breadcrumb>
|
||||
|
|
|
@ -9,7 +9,7 @@ import http from 'libs/http';
|
|||
class Store {
|
||||
@observable records = [];
|
||||
@observable record = {};
|
||||
@observable isFetching = false;
|
||||
@observable isFetching = true;
|
||||
@observable formVisible = false;
|
||||
|
||||
@observable f_name;
|
||||
|
|
|
@ -43,7 +43,7 @@ class Store {
|
|||
|
||||
fetchRecords = () => {
|
||||
this.isFetching = true;
|
||||
http.get('/api/account/role/')
|
||||
return http.get('/api/account/role/')
|
||||
.then(res => this.records = res)
|
||||
.finally(() => this.isFetching = false)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue