このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
kikikan/backend/resources/js/component/page_change_handler.jsx

20 行
458 B
React
Raw 通常表示 履歴

2021-12-19 04:32:51 +09:00
import { useEffect } from "react";
import { useLocation } from "react-router-dom";
export default function PageChangeHandler() {
2021-12-19 04:32:51 +09:00
const { pathname } = useLocation();
useEffect(() => {
2021-12-31 11:19:58 +09:00
loginAccountCheck();
2021-12-19 04:32:51 +09:00
}, [pathname]);
2021-12-31 11:19:58 +09:00
const loginAccountCheck = () => {
let acc = pathname.split('/')[1];
2021-12-31 11:15:25 +09:00
if(localStorage.getItem('kiki_acc_type') && (acc != localStorage.getItem('kiki_acc_type'))) {
location.reload();
2021-12-31 11:15:25 +09:00
}
2021-12-31 10:57:48 +09:00
}
2021-12-19 04:32:51 +09:00
return null;
}