add login at same time

このコミットが含まれているのは:
dragon1211 2022-01-28 00:39:15 -08:00
コミット 5d3b05bb44
6個のファイルの変更463行の追加4185行の削除

ファイルの表示

@ -12897,11 +12897,7 @@ categories: [project]
@font-face {
font-family: "iconfont";
src: url(/fonts/iconfont.eot?9bd2f8e21fb68f3cb69f306c7a5a07d2);
<<<<<<< HEAD
src: url(/fonts/iconfont.eot?9bd2f8e21fb68f3cb69f306c7a5a07d2) format("eot"), url(/fonts/iconfont.woff?72290a51f520574be856b3621acc29a1) format("woff"), url(/fonts/iconfont.ttf?e240ce427caf7549e576c77b39a1d3f1) format("truetype"), url(/fonts/iconfont.svg?9e48c54f8bbb472c1c286234fdd6636f) format("svg");
=======
src: url(/fonts/iconfont.eot?9bd2f8e21fb68f3cb69f306c7a5a07d2) format("eot"), url(/fonts/iconfont.woff?72290a51f520574be856b3621acc29a1) format("woff"), url(/fonts/iconfont.ttf?e240ce427caf7549e576c77b39a1d3f1) format("truetype"), url(/fonts/iconfont.svg?d812f238f7ec32f5cb5ebd322f320a02) format("svg");
>>>>>>> 979b70820792a84b53d44fcdd70644d3690ce8d3
font-weight: normal;
font-style: normal;
}

ファイル差分が大きすぎるため省略します 差分を読み込み

ファイルの表示

@ -1,5 +1,5 @@
import React, { useRef, useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import IconButton from "@material-ui/core/IconButton";
import PhotoCameraOutlinedIcon from '@mui/icons-material/PhotoCameraOutlined';
import { useCookies } from 'react-cookie';
@ -12,6 +12,7 @@ import Notification from '../../component/notification';
const ChildProfileDetail = () => {
const [cookies, setCookie] = useCookies(['user']);
const navigator = useNavigate();
const child_id = localStorage.getItem('kiki_acc_id');
const [notice, setNotice] = useState(localStorage.getItem('notice'));

ファイルの表示

@ -13,6 +13,10 @@ export default function AlertStateMessage() {
setSuccess(state);
navigator(pathname);
}
if(localStorage.getItem('kiki_login_flag')) {
setSuccess('ログインに成功しました');
localStorage.removeItem('kiki_login_flag');
}
}, [pathname]);
return (

ファイルの表示

@ -1,35 +0,0 @@
import axios from "axios";
import { useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { useCookies } from 'react-cookie';
import Alert from './alert';
export default function PageChangeHandler() {
const { pathname } = useLocation();
const navigator = useNavigate();
const [cookies, setCookie] = useCookies(['user']);
const [_success, setSuccess] = useState('');
useEffect(() => {
if(localStorage.getItem('kiki_login_flag')) {
setSuccess('ログインに成功しました');
localStorage.removeItem('kiki_login_flag');
}
loginAccountCheck();
}, [pathname]);
const loginAccountCheck = () => {
let acc = pathname.split('/')[1];
let acc_type = localStorage.getItem('kiki_acc_type');
if((acc_type && (acc != acc_type))) {
window.location.href = `/${acc}/login`;
axios.get(`/${acc}/logout`);
}
}
return (
<>
{ _success ? <Alert type="success" hide={()=>setSuccess('')}>{ _success }</Alert> : null}
</>
);
}

ファイルの表示

@ -1,12 +1,10 @@
import { Outlet } from 'react-router-dom';
import PageChangeHandler from '../component/page_change_handler';
import AlertStateMessage from '../component/alert_state_msg';
const DashboardLayout = ({side}) => {
return (
<main className="l-container meeting-consent">
<PageChangeHandler />
<AlertStateMessage />
<Outlet />
{side}