issue update

This commit is contained in:
caishi 2023-12-14 16:54:44 +08:00
parent 501bf9725f
commit 7ecd3af55b
4 changed files with 15 additions and 15 deletions

View File

@ -190,7 +190,6 @@ class App extends Component {
this.unlisten = this.props.history.listen((location,history) => {
// if(login && )
let newPathname = location.pathname.split('/')[1];
console.log("---------------newpathname:",newPathname);
if (this.state.pathName !== newPathname) {
newPathname && this.getPathnameType(newPathname);
}

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 || ''
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -145,17 +145,18 @@ class Setting extends Component {
this.setState({
loading:true
})
const { projectsId , owner } = this.props.match.params;
const navUrl = `/${owner}/${projectsId}/project_units.json`;
this.update(values);
// const { projectsId , owner } = this.props.match.params;
// const navUrl = `/${owner}/${projectsId}/project_units.json`;
let unit = values.project_units.filter(item => (item !== "home" && item!== "activity" && item!== "code"));
axios.post(navUrl, {
unit_types:unit
}).then((result) => {
if (result) {
this.update(values);
}
}).catch(error=>{})
// let unit = values.project_units.filter(item => (item !== "home" && item!== "activity" && item!== "code"));
// axios.post(navUrl, {
// unit_types:unit
// }).then((result) => {
// if (result) {
// this.update(values);
// }
// }).catch(error=>{})
}
});
};

View File

@ -213,9 +213,9 @@ export function TPMIndexHOC(WrappedComponent) {
// 如果处于登录状态,且刚刚打开,那么跳到个人主页
// let hrefStr = this.props.match.path === "/login" || this.props.match.path === "/register" || this.props.match.path === "/resetPassword";
// console.log("111:",hrefStr,this.props.match.path);
// if((this.props.match.path === "/" && this.props.history.length===2)){
// this.props.history.push(`/${response.data.login}`)
// }
if(this.props.match.path === "/"){
this.props.history.push(`/${response.data.login}`)
}
if(!response.data.phone){
var supplyCookie = cookie.load('supplyphone');
this.setState({