Merge pull request '上线前issue修改' (#767) from gitlink_management into pre_gitlink_ssr

This commit is contained in:
caishi 2024-09-14 08:41:19 +08:00
commit 4c737c1b5d
8 changed files with 30 additions and 16 deletions

View File

@ -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";

View File

@ -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}>

View File

@ -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>
}
},
{

View File

@ -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);
}

View File

@ -25,7 +25,6 @@ function NewsList(props){
const [ menuSpin , setMenuSpin ] = useState(true);
const { id, temp } = props;
useEffect(()=>{
if(id && cateId ){
setMenuSpin(true);

View File

@ -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>
)

View File

@ -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);
}

View File

@ -21,7 +21,6 @@ const Infos = Loadable({
class DetailTop extends Component {
constructor(props) {
super(props);
console.log("userinfos:",props);
this.state = {}
}
render() {