修改路由的issue

This commit is contained in:
何童崇 2021-09-02 17:20:26 +08:00
parent 559b797c2e
commit 4f39f03b19
9 changed files with 29 additions and 20 deletions

View File

@ -105,7 +105,7 @@ class App extends Component {
occupation: 0,
mygetHelmetapi: null,
pathType: null,
pathName: '',
pathName: null,
}
}
@ -175,7 +175,6 @@ class App extends Component {
const msg = `${event.type}: ${event.message}`;
});
}
componentWillUnmount() {
@ -317,7 +316,7 @@ class App extends Component {
}
/>
{/*项目*/}
{/*新建项目*/}
<Route
path={"/projects"}
render={

View File

@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => {
})
function locationurl(list) {
if (window.location.port !== "3007") {
// if (window.location.port !== "3007") {
window.location.href = list
}
// }
}
// TODO 开发期多个身份切换
let debugType = ""

View File

@ -14,7 +14,7 @@ class ActivityItem extends Component {
{/* 如果是版本发布 */}
{item.trend_type === "VersionRelease" ?
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/releases`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:

View File

@ -12,8 +12,13 @@ import Loadable from "react-loadable";
import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
//404页面
const Shixunnopage = Loadable({
loader: () => import('./modules/404/Shixunnopage'),
loading: Loading,
})
const ProjectNew = Loadable({
loader: () => import("./New/Index"),
loader: () => import("./New/Index"),
loading: Loading,
});
const ProjectIndex = Loadable({
@ -29,8 +34,8 @@ const ProjectIndex = Loadable({
class Index extends Component {
componentDidUpdate=()=>{
this.props.history.listen(()=>{
componentDidUpdate = () => {
this.props.history.listen(() => {
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
window.scrollTo(0, 0)
}
@ -70,6 +75,13 @@ class Index extends Component {
<ProjectIndex {...this.props} {...props} />
)}
></Route>
<Route path="/projects" component={Shixunnopage} />
<Route
path="/"
render={(props) => (
<ProjectIndex {...this.props} {...props} />
)}
></Route>
</Switch>
</div>
);

View File

@ -28,7 +28,7 @@ class IndexItem extends Component {
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a>
:
<Link to={item.author && item.author.login} className="show-user-link">
<Link to={`/${item.author && item.author.login}`} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
</Link>
}

View File

@ -80,9 +80,10 @@ function Notify(props){
<ul className="notifyList">
{
list.map((i,k)=>{
console.log(i);
return(
<li i={k}>
<Link to={`/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
<Link to={`/${i.applied_user && i.applied_user.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg" /></Link>
<div className="notifyFlex">
<p className="notifyInfos">
<Link to={`/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link>

View File

@ -31,7 +31,7 @@ class OrderItem extends Component {
<div className="milepostwidth">
<div className="grid-item width100">
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i>
<Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}`} className="font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/milestones/${item.id}`} className="font-16">{item.name}</Link>
</div>
</div>
</div>
@ -65,7 +65,7 @@ class OrderItem extends Component {
<div className="milepostleft">
<div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-bianji3 font-14 mr5"></i>
<Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link>
<Link to={`/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link>
</div>
<div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-yiguanbi1 font-14 mr5"></i>

View File

@ -11,10 +11,10 @@ function Activity({list}) {
list.map((i,k)=>{
return(
<li>
<Link to={``}><img src={getImageUrl(`/system/lets/letter_avatars/2/D/169_162_140/120.png`)} alt="" className="aImg"/></Link>
<Link to={`/${i.user_login}`}><img src={getImageUrl(`/system/lets/letter_avatars/2/D/169_162_140/120.png`)} alt="" className="aImg"/></Link>
<div className="aInfos">
<AlignCenter>
<Link to={``} className="name">{i.user_name}</Link>
<Link to={`/${i.user_login}`} className="name">{i.user_name}</Link>
<span className="time">{i.action_time}</span>
{i.priority && TagInfo(`${i.priority}`,"")}
{i.issue_status && <span className="status">{i.issue_status}</span> }

View File

@ -10,11 +10,6 @@ import './index.scss';
const { Search } = Input;
const { TabPane } = Tabs;
// const https = 'http://192.168.0.77:8081'; //
// const https = 'http://192.168.31.104:8081'; //
// const https='http://106.75.31.211:58081';
const https = 'https://test-statistics.trustie.net';
const GlobalSearch = ({ location, showNotification, history }) => {
const size = 10;
@ -58,6 +53,8 @@ const GlobalSearch = ({ location, showNotification, history }) => {
}
function searchDataList() {
let chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
let https = chromesettingArray.common.search || 'https://statistics.trustie.net';
const url = https + '/search';
if (!term) {
// showNotification('');