Merge branch 'gitlink_server' of https://gitlink.org.cn/Gitlink/forgeplus-react into feature_reposyncer
This commit is contained in:
commit
5cb72167f2
|
|
@ -16,7 +16,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";
|
||||
const shouldUseSourceMap = process.env.NODE_ENV !== "production";
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"proxy": "http://172.20.32.202:4000",
|
||||
"proxy": "https://testforgeplus.trustie.net",
|
||||
"port": "3007",
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "7.0.0-beta.51",
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
|
|
@ -50,6 +50,7 @@
|
|||
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
|
||||
<script src="%PUBLIC_URL%js/alex/moment.js"></script>
|
||||
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.19/bundle/alex.all.global.min.js"></script>
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<meta name="viewport" content="">
|
||||
<%= htmlWebpackPlugin.tags.bodyTags %>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@ import SiderBar from './forge/Component/SiderBar';
|
|||
import SiderBarHelp from './glcc/siderBarHelp';
|
||||
// import GlccModal from './modules/glccModal';
|
||||
|
||||
import { SnackbarHOC } from 'educoder';
|
||||
import { SnackbarHOC, configShareForCustom } from 'educoder';
|
||||
import { initAxiosInterceptors } from './AppConfig'
|
||||
import { Provider } from 'react-redux';
|
||||
import configureStore from './redux/stores/configureStore';
|
||||
import cookie from 'react-cookies';
|
||||
|
||||
|
||||
const store = configureStore();
|
||||
window.marked = marked;
|
||||
|
|
@ -302,6 +303,9 @@ class App extends Component {
|
|||
this.setState({
|
||||
mygetHelmetapi: response.data.setting
|
||||
});
|
||||
|
||||
configShareForCustom(response.data.name)
|
||||
|
||||
//存储配置到游览器
|
||||
localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||
localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||
|
|
|
|||
|
|
@ -1,13 +1,20 @@
|
|||
import axios from 'axios'
|
||||
const host = window.location.protocol + '//' + window.location.host
|
||||
const wx = window.wx
|
||||
const appId = 'wxf8debe756b4a0309'
|
||||
|
||||
let settings = localStorage.chromesetting&&JSON.parse(localStorage.chromesetting);
|
||||
let actionUrl = settings && settings.common.zone +'/api';
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: actionUrl,
|
||||
timeout: 1800000, // 请求超时时间
|
||||
});
|
||||
|
||||
function share(shareData) {
|
||||
try {
|
||||
wx.onMenuShareAppMessage(shareData);//分享给好友
|
||||
wx.onMenuShareTimeline(shareData);//分享到朋友圈
|
||||
wx.onMenuShareQQ(shareData);//分享给手机QQ
|
||||
wx.onMenuShareWeibo(shareData);//分享腾讯微博
|
||||
wx.onMenuShareQZone(shareData);//分享到QQ空间
|
||||
wx.updateAppMessageShareData(shareData);//分享给好友
|
||||
wx.updateTimelineShareData(shareData);//分享到朋友圈
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
|
@ -21,26 +28,24 @@ function requestForSignatrue (callback) {
|
|||
callback && callback()
|
||||
} else {
|
||||
const wx = window.wx
|
||||
const url = '/wechats/js_sdk_signature.json'
|
||||
const url = '/cms/doc/open/wechatSignature'
|
||||
urlDoneMap[currentUrl] = true
|
||||
// window.encodeURIComponent()
|
||||
axios.post(url, {
|
||||
url: window.__testUrl || currentUrl,
|
||||
service.post(url, {
|
||||
url: currentUrl,
|
||||
}).then((response) => {
|
||||
console.log('got res')
|
||||
const data = response.data;
|
||||
const data = response.data && response.data.data;
|
||||
|
||||
wx.config({
|
||||
debug: false,
|
||||
appId: data.appid,
|
||||
appId: appId, // data.appid,
|
||||
timestamp: data.timestamp,
|
||||
nonceStr: data.noncestr,
|
||||
signature: data.signature,
|
||||
jsApiList: [
|
||||
'onMenuShareTimeline',//
|
||||
'onMenuShareAppMessage',
|
||||
'onMenuShareQQ',
|
||||
'onMenuShareWeibo',
|
||||
'onMenuShareQZone'
|
||||
'updateAppMessageShareData',//
|
||||
'updateTimelineShareData',
|
||||
]
|
||||
});
|
||||
wx.ready(function () {
|
||||
|
|
@ -125,11 +130,10 @@ export function configShareForCustom (title, desc, imgUrl, path) {
|
|||
console.log('configShareForCustom', host)
|
||||
const _url = window.location.href.split('#')[0];
|
||||
var shareData = {
|
||||
title: title,
|
||||
desc: desc,
|
||||
title: title || 'GitLink | 确实开源',
|
||||
desc: desc || 'GitLink,新一代开源创新服务平台',
|
||||
link: path ? `${host}/${path}` : _url,
|
||||
imgUrl: imgUrl || window.__testImageUrl
|
||||
|| host + '/react/build/images/share_logo_icon.jpg'
|
||||
imgUrl: imgUrl || host + '/build/images/share_logo_icon.png'
|
||||
};
|
||||
share(shareData)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function ProjectSource(props) {
|
|||
// 获取wiki内容
|
||||
setLoading(true);
|
||||
getWiki({
|
||||
pageName: wiki.titleStr,
|
||||
pageName: wiki.title_sub,
|
||||
...wikiParams
|
||||
}).then(res=>{
|
||||
setLoading(false);
|
||||
|
|
@ -78,7 +78,7 @@ function ProjectSource(props) {
|
|||
message.error("加载失败")
|
||||
}
|
||||
})
|
||||
}, [wiki && wiki.titleStr])
|
||||
}, [wiki && wiki.title_sub])
|
||||
|
||||
useEffect(() => {
|
||||
if (scroller) {
|
||||
|
|
@ -236,7 +236,7 @@ function ProjectSource(props) {
|
|||
<div className='wikiTitleHC font-20 mb5'>{wikiDetail.name}</div>
|
||||
{wikiDetail.commit && <div className='wikiUpdateTimeHC font-15'>更新时间:{wikiDetail.commit.author.date || '刚刚'}</div>}
|
||||
</div>
|
||||
{adminUrl && <Button onClick={()=>{wiki && window.open(`${data && data.gitlinkProject.wiki_url}/${wiki.titleStr}/${wiki.key}`)}} className='zone_apply_button' style={{width: '90px', height: '34px'}}>配置内容</Button>}
|
||||
{adminUrl && <Button onClick={()=>{wiki && window.open(`${data && data.gitlinkProject.wiki_url}/${wiki.title_sub}/${wiki.key}`)}} className='zone_apply_button' style={{width: '90px', height: '34px'}}>配置内容</Button>}
|
||||
</FlexAJ>
|
||||
{wikiDetail.md_content && <RenderHtml className="wikiContentHC editor-content-panel mt20 imageLayerParent" value={ Base64.decode(wikiDetail.md_content) } url={history.location}/>}
|
||||
</LongWidth>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { getNewsDetail } from '../api';
|
|||
import { isPhone } from 'educoder';
|
||||
import { tempConfig } from '../tempInfo';
|
||||
import Acce from '../Component/mobile/accessory';
|
||||
import { addMeta, setSeoMeta } from 'educoder';
|
||||
import { addMeta, setSeoMeta, configShareForCustom } from 'educoder';
|
||||
import CommentList from '../Component/comments/list'
|
||||
|
||||
|
||||
|
|
@ -28,6 +28,9 @@ function NewsDetail(props){
|
|||
const { name, cmsDir, summary} = detail;
|
||||
document.title = `${ name }/${ cmsDir.name }`;
|
||||
addMeta('Keywords', `${ name },${ cmsDir.name },${ summary }`);
|
||||
setTimeout(() => {
|
||||
configShareForCustom(detail.name, detail.summary, detail.headImg)
|
||||
}, 1000);
|
||||
}
|
||||
if(isPhone() && zonedetail){
|
||||
setTimeout(()=>{
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import "slick-carousel/slick/slick-theme.css";
|
|||
import { tempEnum } from "./tempInfo";
|
||||
import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import { setSeoMeta } from 'educoder';
|
||||
import { configShareForCustom } from 'educoder';
|
||||
|
||||
|
||||
const SourceDetail = Loadable({
|
||||
|
|
@ -142,6 +143,7 @@ function Index(props){
|
|||
getAdminUrl(data.id);
|
||||
getRole(data.id)
|
||||
}
|
||||
configShareForCustom(data.mainTitle, data.subTitle, data.introductionImage)
|
||||
// 存储deptId,所有专区接口header带上
|
||||
sessionStorage.setItem('deptId', data.deptId)
|
||||
setSeoMeta(`${data.name},`, data.name, data.subTitle, `/zone/${deptId}`)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ class CoderRootFileDetail extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
isCommit = () => {
|
||||
const {detail, branch} = this.props;
|
||||
return detail && detail.commit && detail.commit.sha.includes(branch)
|
||||
}
|
||||
|
||||
// 更新网页标题
|
||||
updateDocumentTitle(){
|
||||
const {projectDetail, treeValuePath, location} = this.props;
|
||||
|
|
@ -300,7 +305,7 @@ class CoderRootFileDetail extends Component {
|
|||
</span>
|
||||
</div>
|
||||
<p className="text-right">
|
||||
{flag && platform && (
|
||||
{flag && platform && !this.isCommit() && (
|
||||
<div>
|
||||
{readOnly ? (
|
||||
<span>
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ class Setting extends Component {
|
|||
{/* <Mirror /> */}
|
||||
</WhiteBack>
|
||||
{
|
||||
projectDetail && projectDetail.permission && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner")?
|
||||
projectDetail && projectDetail.permission && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission ==="Manager")?
|
||||
<WhiteBack className="dangerousBox mb20">
|
||||
<div>
|
||||
<div className="dangerousTitle">危险操作区</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue