token转账页面未登录状态处理

This commit is contained in:
谢思 2023-03-10 10:52:18 +08:00
parent 2f90745c3b
commit 3aad11336e
2 changed files with 9 additions and 2 deletions

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || ''
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -28,8 +28,15 @@ function Contribution(props){
const [error2, setError2] = useState(undefined);
// id
const [proId, setProId] = useState(undefined);
const {current_user:{user_id, login}} = props;
const {current_user:{user_id, login}, current_user} = props;
const {user} = props;
const username = props.match.params.username;
useEffect(()=>{
if((username && current_user && (current_user.login !== username))){
props.history.push(`/${username}`);
}
},[current_user,username])
useEffect(()=>{
// token