mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:46:46 +00:00
fix: only load history for logged-in users
This commit is contained in:
parent
2cba502f60
commit
85a032f87c
@ -38,12 +38,13 @@ export const CollectionHistoryProvider: React.FC = (props) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const isAdminPage = location.pathname.startsWith('/admin');
|
const isAdminPage = location.pathname.startsWith('/admin');
|
||||||
|
const token = api.auth.getToken() || '';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isAdminPage) {
|
if (isAdminPage && token) {
|
||||||
service.run();
|
service.run();
|
||||||
}
|
}
|
||||||
}, [isAdminPage]);
|
}, [isAdminPage, token]);
|
||||||
|
|
||||||
// 刷新 collecionHistory
|
// 刷新 collecionHistory
|
||||||
const refreshCH = async () => {
|
const refreshCH = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user