forked from Gitlink/forgeplus-react
reademe转义
This commit is contained in:
parent
381a7e9a0f
commit
2f43c3f74c
|
|
@ -63,7 +63,7 @@ function CoderDepot(props){
|
|||
const [ website , setWebsite ] = useState(projectDetail.website ||undefined);
|
||||
const [ lesson_url , setLessonUrl ] = useState(projectDetail.lesson_url || undefined);
|
||||
const [ topics, setTopics] = useState(projectDetail.topics || undefined);
|
||||
const [ readme , setReadme ] = useState(projectReadMe || undefined);
|
||||
const [ readme , setReadme ] = useState((projectReadMe && JSON.parse(decodeURIComponent(projectReadMe))) || undefined);
|
||||
const [ defaultBranch , setDefaultBranch ] = useState(projectDetail.default_branch || undefined);
|
||||
const [ editReadme , setEditReadme ] = useState(false);
|
||||
const [ pullsFlag , setPullsFlag ] = useState(true);
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ export const setProjectReadMe = ({ owner,projectsId, branch }) => {
|
|||
return (dispatch) => {
|
||||
return getProjectReadMe(owner, projectsId, branch).then(res => {
|
||||
if (res && res.data) {
|
||||
res.data = encodeURIComponent( JSON.stringify(res.data) )
|
||||
dispatch({
|
||||
type: types.GET_PROJECT_README,
|
||||
payload: res.data
|
||||
|
|
|
|||
Loading…
Reference in New Issue