From 041351e501b754b19657b8465a084b9db3d8d67e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 18 Sep 2019 15:34:33 +0800 Subject: [PATCH] configShareForCustom --- public/react/src/common/util/ShareUtil.js | 6 +++--- .../src/modules/tpm/shixunchild/Challenges/Challenges.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 1ea3326d9..c11ed6381 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -119,14 +119,14 @@ export function configShareForCourses () { } // detail -export function configShareForCustom (title, desc, path, imgUrl) { +export function configShareForCustom (title, desc, imgUrl, path) { requestForSignatrue(() => { console.log('configShareForCustom', host) - + const _path = window.location.href.split('#')[0]; var shareData = { title: title, desc: desc, - link: `${host}/${path}`, + link: `${host}/${path || _path}`, imgUrl: imgUrl || window.__testImageUrl || host + '/react/build/images/share_logo_icon.jpg' }; diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index ef94f7fa4..e637bf42e 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { getImageUrl ,markdownToHTML} from 'educoder' +import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder' 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) { }else{ + configShareForCustom(this.props.shixunsDetails.name, response.data.description) this.setState({ ChallengesDataList: response.data, sumidtype: false,