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

View File

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

View File

@ -14,7 +14,7 @@ class ActivityItem extends Component {
{/* 如果是版本发布 */} {/* 如果是版本发布 */}
{item.trend_type === "VersionRelease" ? {item.trend_type === "VersionRelease" ?
<p className="itemLine"> <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> <span className="activity_type">{item.trend_type}</span>
</p > </p >
: :

View File

@ -12,8 +12,13 @@ import Loadable from "react-loadable";
import Loading from "../Loading"; import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
//404页面
const Shixunnopage = Loadable({
loader: () => import('./modules/404/Shixunnopage'),
loading: Loading,
})
const ProjectNew = Loadable({ const ProjectNew = Loadable({
loader: () => import("./New/Index"), loader: () => import("./New/Index"),
loading: Loading, loading: Loading,
}); });
const ProjectIndex = Loadable({ const ProjectIndex = Loadable({
@ -29,8 +34,8 @@ const ProjectIndex = Loadable({
class Index extends Component { class Index extends Component {
componentDidUpdate=()=>{ componentDidUpdate = () => {
this.props.history.listen(()=>{ this.props.history.listen(() => {
if (document.body.scrollTop || document.documentElement.scrollTop > 0) { if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
window.scrollTo(0, 0) window.scrollTo(0, 0)
} }
@ -70,6 +75,13 @@ class Index extends Component {
<ProjectIndex {...this.props} {...props} /> <ProjectIndex {...this.props} {...props} />
)} )}
></Route> ></Route>
<Route path="/projects" component={Shixunnopage} />
<Route
path="/"
render={(props) => (
<ProjectIndex {...this.props} {...props} />
)}
></Route>
</Switch> </Switch>
</div> </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> <img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
</a> </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> <img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
</Link> </Link>
} }

View File

@ -80,9 +80,10 @@ function Notify(props){
<ul className="notifyList"> <ul className="notifyList">
{ {
list.map((i,k)=>{ list.map((i,k)=>{
console.log(i);
return( return(
<li i={k}> <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"> <div className="notifyFlex">
<p className="notifyInfos"> <p className="notifyInfos">
<Link to={`/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link> <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="milepostwidth">
<div className="grid-item width100"> <div className="grid-item width100">
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i> <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> </div>
</div> </div>
@ -65,7 +65,7 @@ class OrderItem extends Component {
<div className="milepostleft"> <div className="milepostleft">
<div className="grid-item ml15 color-grey-9"> <div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-bianji3 font-14 mr5"></i> <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>
<div className="grid-item ml15 color-grey-9"> <div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-yiguanbi1 font-14 mr5"></i> <i className="iconfont icon-yiguanbi1 font-14 mr5"></i>

View File

@ -11,10 +11,10 @@ function Activity({list}) {
list.map((i,k)=>{ list.map((i,k)=>{
return( return(
<li> <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"> <div className="aInfos">
<AlignCenter> <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> <span className="time">{i.action_time}</span>
{i.priority && TagInfo(`${i.priority}`,"")} {i.priority && TagInfo(`${i.priority}`,"")}
{i.issue_status && <span className="status">{i.issue_status}</span> } {i.issue_status && <span className="status">{i.issue_status}</span> }

View File

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