diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6a..9ca6363a5 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -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) { diff --git a/src/forge/users/contribution/index.jsx b/src/forge/users/contribution/index.jsx index f79b047a9..1e8cd22ee 100644 --- a/src/forge/users/contribution/index.jsx +++ b/src/forge/users/contribution/index.jsx @@ -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转账列表