Merge pull request '上线前issue修改' (#767) from gitlink_management into pre_gitlink_ssr
This commit is contained in:
commit
4c737c1b5d
|
@ -17,7 +17,7 @@ const TerserWebpackPlugin = require('terser-webpack-plugin');
|
|||
const paths = require("./paths");
|
||||
const getClientEnvironment = require("./env");
|
||||
|
||||
let publicPath = "/react/build/";
|
||||
let publicPath = "/build/";
|
||||
const publicUrl = publicPath.slice(0, -1);
|
||||
|
||||
// const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false";
|
||||
|
|
|
@ -170,7 +170,6 @@ const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "s
|
|||
class App extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
console.log("base:",props.projectBase && props.projectBase.author && props.projectBase.author.type);
|
||||
this.state = {
|
||||
Addcoursestype: false,
|
||||
Addcoursestypes: false,
|
||||
|
@ -219,7 +218,6 @@ class App extends Component {
|
|||
let url = `/owners/${pathname}.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.status === 200) {
|
||||
console.log("data:",response.data.type);
|
||||
this.setState({
|
||||
pathType: response.data.type || '404',
|
||||
pathName: pathname,
|
||||
|
@ -337,7 +335,6 @@ class App extends Component {
|
|||
|
||||
render() {
|
||||
const { pathType, pathName, mygetHelmetapi } = this.state;
|
||||
console.log("pathType:",pathType);
|
||||
return (
|
||||
<ConfigProvider locale={zhCN}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
|
|
|
@ -75,7 +75,7 @@ function Index(props){
|
|||
key:3,
|
||||
width:"10%",
|
||||
render:(value,item)=>{
|
||||
return <Link to={`/${value.login}`}><img src={getImageUrl(`/${value.image_url}`)} alt="" style={{borderRadius:"50%"}} width="32px" height="32px" /></Link>
|
||||
return <Link to={`/${value.login}`}><img src={`${value.image_url}`} alt="" style={{borderRadius:"50%"}} width="32px" height="32px" /></Link>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ function Main(props){
|
|||
setMainList(rows);
|
||||
// 隐藏判断原因:首页查看全部跳转过来后要默认选择指定的cateID而不是第一个
|
||||
// if (temp !== tempEnum.zone) {
|
||||
selectCate(cateId)
|
||||
selectCate(cateId || (rows[0] && rows[0].id))
|
||||
// }
|
||||
setIsSpin(false);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ function NewsList(props){
|
|||
const [ menuSpin , setMenuSpin ] = useState(true);
|
||||
const { id, temp } = props;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if(id && cateId ){
|
||||
setMenuSpin(true);
|
||||
|
|
|
@ -227,6 +227,24 @@ class Detail extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
componentDidUpdate = async (prevState) => {
|
||||
let prevParam = prevState.match.params;
|
||||
let propsParam = this.props.match.params;
|
||||
if (prevState && this.props && (prevParam.projectsId !== propsParam.projectsId || prevParam.owner !== propsParam.owner)) {
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
const data = await getProjectFunc(owner, projectsId);
|
||||
if (data.data) {
|
||||
this.getProject(data.data)
|
||||
}
|
||||
}
|
||||
|
||||
this.props.history.listen((history) => {
|
||||
// 非issue链接地址清除cookie states,具体保存和操作在order.js页面
|
||||
this.clearIssueCookies(history);
|
||||
})
|
||||
}
|
||||
|
||||
clearIssueCookies = (history) => {
|
||||
const { pathname } = history;
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
|
@ -237,9 +255,7 @@ class Detail extends Component {
|
|||
}
|
||||
}
|
||||
async componentWillMount() {
|
||||
|
||||
const { projectsId, owner } = this.props.match.params;
|
||||
console.log(this.props);
|
||||
if (!this.props.projectBase) {
|
||||
const data = await getProjectFunc(owner, projectsId);
|
||||
if (data && data.data) {
|
||||
|
@ -517,12 +533,13 @@ class Detail extends Component {
|
|||
const url = `/${owner}/${projectsId}/forks.json`;
|
||||
axios.post(url).then(result => {
|
||||
if (result && result.data.status === 0) {
|
||||
if (result.data.message === "fork失败,你已拥有了这个项目") {
|
||||
this.props.history.push(`/${current_user && current_user.login}/${projectsId}`);
|
||||
this.props.showNotification(result.data.message);
|
||||
if (result.data.message && result.data.message.indexOf("fork失败")>-1) {
|
||||
// this.props.history.push(`/${current_user && current_user.login}/${projectsId}`);
|
||||
return;
|
||||
}
|
||||
this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`);
|
||||
this.props.showNotification(result.data.message);
|
||||
|
||||
this.props.showNpsModal("indexProject", 3);
|
||||
}
|
||||
this.setState({
|
||||
|
@ -740,7 +757,8 @@ class Detail extends Component {
|
|||
</Content>
|
||||
}
|
||||
<Spin spinning={secondSync && !firstSync} className="spinstyle" tip="正在同步镜像" size="large">
|
||||
<Switch {...this.props}>
|
||||
{/* mirror_status = 1的情况不显示项目详情子模块 */}
|
||||
{!firstSync && <Switch {...this.props}>
|
||||
{/* 服务 */}
|
||||
<Route path="/:owner/:projectsId/service"
|
||||
render={
|
||||
|
@ -942,7 +960,7 @@ class Detail extends Component {
|
|||
(props) => <CoderDepot {...this.props} {...props} {...this.state} {...common} mirror_status={mirror_status}/>
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
</Switch>}
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -19,7 +19,8 @@ function Main(props){
|
|||
|
||||
useEffect(()=>{
|
||||
if(current_user && !current_user.login){
|
||||
props.history.push(`/login?go_page=/${owner}/${projectsId}/service`);
|
||||
// 未登录用户访问会跳转到代码库主页,此处不用处理
|
||||
// props.history.push(`/login?go_page=/${owner}/${projectsId}/service`);
|
||||
}else{
|
||||
setHas_trace_user(current_user.has_trace_user);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ const Infos = Loadable({
|
|||
class DetailTop extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
console.log("userinfos:",props);
|
||||
this.state = {}
|
||||
}
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue