configShareForCustom

dev_cs
hjm 6 years ago
parent 66026a77ac
commit 041351e501

@ -119,14 +119,14 @@ export function configShareForCourses () {
} }
// detail // detail
export function configShareForCustom (title, desc, path, imgUrl) { export function configShareForCustom (title, desc, imgUrl, path) {
requestForSignatrue(() => { requestForSignatrue(() => {
console.log('configShareForCustom', host) console.log('configShareForCustom', host)
const _path = window.location.href.split('#')[0];
var shareData = { var shareData = {
title: title, title: title,
desc: desc, desc: desc,
link: `${host}/${path}`, link: `${host}/${path || _path}`,
imgUrl: imgUrl || window.__testImageUrl imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };

@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { getImageUrl ,markdownToHTML} from 'educoder' import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
@ -51,6 +51,7 @@ class Challenges extends Component {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{ }else{
configShareForCustom(this.props.shixunsDetails.name, response.data.description)
this.setState({ this.setState({
ChallengesDataList: response.data, ChallengesDataList: response.data,
sumidtype: false, sumidtype: false,

Loading…
Cancel
Save