diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 452529717..5a9fa372e 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -19,7 +19,7 @@ export function getImageUrl(path) { return `${path}`; } -export function IsPC(){ +export function isPhone(){ var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", diff --git a/src/common/educoder.js b/src/common/educoder.js index 6575c5032..96896845a 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -7,7 +7,7 @@ export { getImageUrl as getImageUrl,getImageUrlAbsolute as getImageUrlAbsolute,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, getZoneUrl as getZoneUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl, - turnbar,returnbar,setSeoMeta as setSeoMeta , IsPC as IsPC, addMeta as addMeta + turnbar,returnbar,setSeoMeta as setSeoMeta , isPhone as isPhone, addMeta as addMeta } from './UrlTool'; export { setmiyah as setmiyah } from './Component'; diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss index 5c461c941..92c973d24 100644 --- a/src/forge/Component/Component.scss +++ b/src/forge/Component/Component.scss @@ -23,7 +23,7 @@ li.ant-menu-item{ border:1px solid #eee; .img{ margin-right: 20px; - width: 190px; + max-width: 190px; height: 90px; border:1px solid rgba(238,238,238,1); display: flex; diff --git a/src/forge/Information/Component/comments/list.jsx b/src/forge/Information/Component/comments/list.jsx index 4e70f5468..4014063d4 100644 --- a/src/forge/Information/Component/comments/list.jsx +++ b/src/forge/Information/Component/comments/list.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Button, Popconfirm, Radio, Input, message, Tooltip, Spin, Pagination } from 'antd'; import axios from 'axios'; -import { getImageUrl, timeAgo } from 'educoder'; +import { getImageUrl, timeAgo, isPhone } from 'educoder'; import RenderHtml from '../../../../components/render-html'; import Attachment from '../../../Upload/attachment'; import EditComment from './editComment'; @@ -109,7 +109,7 @@ function IssueCommentList(props){ } return( -
+ (isPhone() && journalsCount === 0) ? '' :
{/* 评论 */}
0 && 'pb15'}`}>
@@ -118,7 +118,7 @@ function IssueCommentList(props){
{/* 评论快速入口-仅有评论且登录时展示 */} - {login && category !== 'operate' && journalsCount > 0 &&
0 && 'pt15'}`}>
点击添加评论
} + {login && category !== 'operate' && journalsCount > 0 && !isPhone() &&
0 && 'pt15'}`}>
点击添加评论
} {/* 评论/操作日志 展示列表 */}
@@ -135,7 +135,7 @@ function IssueCommentList(props){ {item.user.name} {timeAgo(item.created_at)}
- {login &&
+ {login && !isPhone() &&
{/* 平台管理员/仓库管理员/发布评论者/issue创建者 */} {(admin || isManager || login === item.user.login || username === author) && {i.reply_user && i.reply_user.name} {timeAgo(i.created_at)}
- {login &&
+ {login && !isPhone() &&
{/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */} {(admin || isManager || login === i.user.login || (i.reply_user && login === i.reply_user.login) || username === author) && setPage(page)}/>
} {/* 添加评论 */} - {category !== 'operate' &&
+ {category !== 'operate' && !isPhone() &&
{login ? showEdit === 1 ? :
diff --git a/src/forge/Information/Pages/headerPage.jsx b/src/forge/Information/Pages/headerPage.jsx index 46884dc2a..dcb312ad8 100644 --- a/src/forge/Information/Pages/headerPage.jsx +++ b/src/forge/Information/Pages/headerPage.jsx @@ -4,7 +4,7 @@ import { httpUrl } from '../fetch'; import guideArrow from '../img/guideArrow.png'; import { Link } from 'react-router-dom'; import shijian from '../img/shijian.png'; -import { getHomePageList , gethomePageDocList , getAllList } from '../api'; +import { getHomePageList , gethomePageDocList , getAllList, getPartnerList } from '../api'; import axios from 'axios'; import Partner from '../Component/partner'; @@ -21,7 +21,7 @@ function HeaderPage(props){ getProjectList(); getNewsList(); getPersonList(); - getPartnerList(); + getPartner(); } },[id]) @@ -49,9 +49,8 @@ function HeaderPage(props){ }).catch(console.error()) } - function getPartnerList(){ - const url = `${httpUrl}/zone/open/${id}/partners/list`; - axios.get(url).then(result=>{ + function getPartner(){ + getPartnerList(id).then(result => { if(result){ const array = result.data.rows; const newArray = []; @@ -66,7 +65,7 @@ function HeaderPage(props){ } setParterList(newArray); } - }).catch(error=>{}) + }) } return(
diff --git a/src/forge/Information/Pages/headerPageZone1.jsx b/src/forge/Information/Pages/headerPageZone1.jsx index dc46b6508..c1893c61c 100644 --- a/src/forge/Information/Pages/headerPageZone1.jsx +++ b/src/forge/Information/Pages/headerPageZone1.jsx @@ -16,12 +16,12 @@ import ra from '../img/ra.png' import title from '../img/title.png' import { Link } from 'react-router-dom'; import shijian from '../img/shijian.png'; -import axios from 'axios'; import Nodata from '../../Nodata'; import Projects from '../Component/projects'; import Contributor from '../Component/contributor'; import Partner from '../Component/partner'; import '../indexZone1.scss' +import { getProjectsLists, getPartnerList, getHomePageList, gethomePageDocList } from '../api' function HeaderPage(props){ const [ projectList , setProjectList ] = useState(undefined); @@ -65,13 +65,12 @@ function HeaderPage(props){ getProjectList(); getNewsList(); getPersonList(); - getPartnerList(); + getPartner(); } },[id]) function getPersonList(){ - const url = `${httpUrl}/zone/open/${id}/member/homePageList`; - axios.get(url).then(result=>{ + getHomePageList(id).then(result=>{ if(result){ setPersonList(result.data.rows); } @@ -79,19 +78,14 @@ function HeaderPage(props){ } function getNewsList(){ - const url = `${httpUrl}/cms/doc/open/zone/${id}/homePageDocList`; - axios.get(url).then(result=>{ + gethomePageDocList(id).then(result=>{ if(result){ setNewsList(result.data.rows); } }).catch(error=>{}) } - function getProjectList(){ - const url = `${httpUrl}/zone/open/${id}/project/list`; - axios.get(url,{params:{ - isHomepage:1 - }}).then(result=>{ + getProjectsLists(id,{ isHomepage:1 }).then(result=>{ if(result){ if (result.data.rows.length < 3) { setProjectList(result.data.rows) @@ -99,12 +93,11 @@ function HeaderPage(props){ setProjectList([...result.data.rows, {}]); } } - }).catch(console.error()) + }).catch(error=>{}) } - function getPartnerList(){ - const url = `${httpUrl}/zone/open/${id}/partners/list`; - axios.get(url).then(result=>{ + function getPartner(){ + getPartnerList(id).then(result => { if(result){ const array = result.data.rows; const newArray = []; @@ -119,7 +112,7 @@ function HeaderPage(props){ } setParterList(newArray); } - }).catch(error=>{}) + }) } return(
diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index 5926af15d..24721d43a 100644 --- a/src/forge/Information/Pages/newsCreate.jsx +++ b/src/forge/Information/Pages/newsCreate.jsx @@ -22,6 +22,7 @@ function NewsCreate(props){ const [dirList, setDirList] = useState(undefined); const [loading, setLoading] = useState(false); const [isEdit, setIsEdit] = useState(false); + const { sectionCmsTitle } = props.data; const layout = { labelCol: { span: 2 }, wrapperCol: { span: 14 }, @@ -123,7 +124,7 @@ function NewsCreate(props){ return(
- {tempConfig[temp].mainTitle} + { sectionCmsTitle } {isEdit ? '编辑' : '新建'}文章
diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index ac736791a..64c386fa4 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -4,7 +4,7 @@ import liulan from '../img/liulan.png'; import RenderHtml from '../../../components/render-html'; import { Base64 } from 'js-base64'; import { getNewsDetail } from '../api'; -import { IsPC } from 'educoder'; +import { isPhone } from 'educoder'; import { tempConfig } from '../tempInfo'; import Acce from '../Component/mobile/accessory'; import { addMeta, setSeoMeta } from 'educoder'; @@ -23,7 +23,13 @@ function NewsDetail(props){ useEffect(()=>{ let initialContent = undefined; - if(IsPC() && zonedetail){ + // 设置网页标题 + if(detail){ + const { name, cmsDir, summary} = detail; + document.title = `${ name }/${ cmsDir.name }`; + addMeta('Keywords', `${ name },${ cmsDir.name },${ summary }`); + } + if(isPhone() && zonedetail){ setTimeout(()=>{ window.scrollTo(0,1); if(detail) @@ -33,36 +39,23 @@ function NewsDetail(props){ document.querySelector('meta[name="viewport"]').setAttribute('content','width=device-width, user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0'); } return()=>{ - if(IsPC()){ + if(isPhone()){ document.querySelector('meta[name="viewport"]').setAttribute('content', initialContent); } + if (zonedetail) { + document.title= zonedetail.mainTitle; + setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + } } },[zonedetail,detail]) useEffect(()=>{ if(id){ - window.scrollTo(0,IsPC() ? 0 : 450); + window.scrollTo(0,isPhone() ? 0 : 450); getDetails(); } },[id]) - useEffect(()=>{ - // 设置网页标题 - if(detail){ - const { name, cmsDir, summary} = detail; - document.title = `${ name }/${ cmsDir.name }`; - addMeta('Keywords', `${ name },${ cmsDir.name },${ summary }`); - } - return componentWillUnmount - }, [detail]) - - function componentWillUnmount() { - if (zonedetail) { - document.title= zonedetail.name; - setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) - } - } - function getDetails(){ setIsSpin(true) getNewsDetail(id).then(result=>{ @@ -82,24 +75,24 @@ function NewsDetail(props){ return( { - IsPC() && + isPhone() && } -
+
{ detail &&
{ - IsPC() && zonedetail && + isPhone() && zonedetail && } { - !IsPC() && + !isPhone() && - {tempConfig[temp].mainTitle} + { zonedetail.sectionCmsTitle } { cmsDir && {cmsDir.name} } 正文 @@ -115,7 +108,7 @@ function NewsDetail(props){ { detail.auditStatus === '0' &&
  • }
    - { !IsPC() && } + { !isPhone() && } { content ? @@ -125,7 +118,7 @@ function NewsDetail(props){
    { // 审核通过才有评论 - detail.auditStatus === '1' &&
    + detail.auditStatus === '1' &&
    {setCommentReload(Math.random())}}/>
    } @@ -135,7 +128,7 @@ function NewsDetail(props){
    { - IsPC() && + isPhone() && } ) diff --git a/src/forge/Information/Pages/selfList.jsx b/src/forge/Information/Pages/selfList.jsx index 74d11df27..76b888abd 100644 --- a/src/forge/Information/Pages/selfList.jsx +++ b/src/forge/Information/Pages/selfList.jsx @@ -22,6 +22,7 @@ function SelfList(props){ const pathname = props.location.pathname; const { deptId} = props.match.params; const { id , temp , data } = props; + const { sectionCmsTitle } = data; const limit = 15; useEffect(()=>{ @@ -142,7 +143,7 @@ function SelfList(props){
    - {source ? "资源发布": temp === tempEnum.zone1 ? "新闻资讯":"领域资讯"} + { sectionCmsTitle } 我的{source ? "资源":"文章"}
      diff --git a/src/forge/Information/Pages/sourceDetail.jsx b/src/forge/Information/Pages/sourceDetail.jsx index eae707ff8..e9a181069 100644 --- a/src/forge/Information/Pages/sourceDetail.jsx +++ b/src/forge/Information/Pages/sourceDetail.jsx @@ -33,7 +33,7 @@ function SourceDetail(props){ function componentWillUnmount() { if (zonedetail) { - document.title= zonedetail.name; + document.title= zonedetail.mainTitle; setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) } } diff --git a/src/forge/Information/api.js b/src/forge/Information/api.js index fb4daeb67..c9cc48673 100644 --- a/src/forge/Information/api.js +++ b/src/forge/Information/api.js @@ -46,6 +46,13 @@ export function getAllList(id,params){ }) } +export function getPartnerList(id){ + return fetch({ + url:`/zone/open/${id}/partners/list`, + method: 'get', + }) +} + /**领域资讯 */ export function getNewsAllList(id,params){ return fetch({ diff --git a/src/forge/Information/fetch.js b/src/forge/Information/fetch.js index 29cc15d28..f74c1faef 100644 --- a/src/forge/Information/fetch.js +++ b/src/forge/Information/fetch.js @@ -5,11 +5,22 @@ function beforeFetch(actionUrl){ if (window.location.href.indexOf('localhost') < 0) { axios.defaults.withCredentials = true; } - - const service = axios.create({ + const config = { baseURL: actionUrl, timeout: 1800000, // 请求超时时间 - }); + } + + const service = axios.create(config); + + service.interceptors.request.use(request => { + let deptId = sessionStorage.getItem('deptId') + + if (deptId) { + // 用于权限区分 + request.headers['Dept-Id'] = deptId + } + return request + }) service.interceptors.response.use( response => { diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index cf14149ec..c68756bd3 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -11,7 +11,7 @@ import Loading from "../../Loading"; import { getMainInfos , getCheckZoneRole, getCurrentRole } from './api'; import PublicBanner from "./Component/publicBanner"; import './index.scss'; -import { IsPC } from 'educoder'; +import { isPhone } from 'educoder'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import { tempEnum } from "./tempInfo"; @@ -98,7 +98,7 @@ function Index(props){ const [ temp , setTemp ] = useState(tempEnum.zone); const [ role , setRole ] = useState(undefined); const { pathname } = props.history.location; - const sourcedetail = pathname.indexOf(`/zone/${deptId}/newdetail/`)>-1 && IsPC(); + const sourcedetail = pathname.indexOf(`/zone/${deptId}/newdetail/`)>-1 && isPhone(); const {current_user} = props; useEffect(()=>{ @@ -124,16 +124,18 @@ function Index(props){ return } let data = result.data.data; - if (data.template) { + if (data && data.template) { setTemp( data.template ) } setData(data); - document.title= data && data.name; + document.title= data && data.mainTitle; setId(data.id); if(data.id){ getAdminUrl(data.id); getRole(data.id) } + // 存储deptId,所有专区接口header带上 + sessionStorage.setItem('deptId', data.deptId) setSeoMeta(`${data.name},`, data.name, data.subTitle, `/zone/${deptId}`) } }).catch(console.error()) diff --git a/src/forge/Issues/Pages/list.jsx b/src/forge/Issues/Pages/list.jsx index ef242b710..081f4eb4b 100644 --- a/src/forge/Issues/Pages/list.jsx +++ b/src/forge/Issues/Pages/list.jsx @@ -77,6 +77,10 @@ function List(props){ }else{ Init(); } + // 标签列表页点击跳转issue列表页并筛选 + if (props.location.state && props.location.state.issue) { + chooseTagFunc(props.location.state.issue) + } },[]) useEffect(()=>{ diff --git a/src/forge/Issues/Pages/sign.jsx b/src/forge/Issues/Pages/sign.jsx index bed42dbcc..645b8a7e5 100644 --- a/src/forge/Issues/Pages/sign.jsx +++ b/src/forge/Issues/Pages/sign.jsx @@ -189,6 +189,12 @@ function Sign(props){ c && setDefaultColor(`#${c}`); setEdit(true); } + + // 标签列表页点击跳转issue列表页并筛选 + function toIssues(issue) { + props.history.push({ pathname: `/${owner}/${projectsId}/issues`, state: { issue: issue } }); + } + return(
      - {i.name} + toIssues(i) }>{i.name}

      {i.description}

      - {i.issues_count || 0} 疑修 + toIssues(i) } >{i.issues_count || 0} 疑修 {/* {i.pull_requests_count || 0} 合并请求 */}

      diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index c6cd4d56d..fe570e020 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -511,9 +511,9 @@ function CoderDepot(props){ } { checkIfLogin && checkIfLogin()? - eventTrack(`/${owner}/${projectsId}/webIDE/tree/${branchName||defaultBranch}`)}>Web IDE

      + eventTrack(`/${owner}/${projectsId}/webIDE/tree/${branchName||defaultBranch}`)}>Web IDE : - {showLoginDialog(`/${owner}/${projectsId}`)}}>Web IDE
      + {showLoginDialog(`/${owner}/${projectsId}`)}}>Web IDE } diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index e85489432..dc000a3be 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -551,4 +551,10 @@ .replaceStyle{ height: 140px!important; +} +.hovergrey:hover{ + border-color: #afb7c2; + color:#4c5b76; + background-color: rgba(175, 183, 194, 0.16); + } \ No newline at end of file diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index a591ed0d8..f5130bf0f 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Tooltip } from 'antd'; +import { Button, Tooltip } from 'antd'; import { getImageUrl } from 'educoder'; import { AlignCenter } from '../Component/layout'; import { Link } from 'react-router-dom'; @@ -78,6 +78,10 @@ class IndexItem extends Component { {item.last_update_time ? {item.time_ago} : ""} {item.language && item.language.id ? {item.language.name} : ""} + {/* + + + */}
    diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index fc4196afd..f5c3d6b47 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -98,7 +98,7 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur
  • {/* */} - 引擎(Engine)
    + 引擎(Engine) {projectDetail && projectDetail.ops_count ? {projectDetail.ops_count} : ""}
  • @@ -138,7 +138,7 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur
  • - 服务
    + 服务
  • } diff --git a/src/forge/Main/sub/UpdateDescModal.jsx b/src/forge/Main/sub/UpdateDescModal.jsx index 0043b865a..56baa0245 100644 --- a/src/forge/Main/sub/UpdateDescModal.jsx +++ b/src/forge/Main/sub/UpdateDescModal.jsx @@ -41,7 +41,7 @@ function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_u if(value.length > 5){ callback("最多创建5个标签"); }else if(boolLength.length){ - callback("每个标签最多支持20个汉字"); + callback("每个标签最多支持20个字符"); }else if(bool.length){ callback("标签名只允许包含中文、字母、数字或者中划线(-), 不能以中划线开头"); } diff --git a/src/forge/SecuritySetting/img/header.png b/src/forge/SecuritySetting/img/header.png new file mode 100644 index 000000000..4a4b6c8f6 Binary files /dev/null and b/src/forge/SecuritySetting/img/header.png differ diff --git a/src/forge/SecuritySetting/website/createSite.jsx b/src/forge/SecuritySetting/website/createSite.jsx index ba12ace0c..91344adfd 100644 --- a/src/forge/SecuritySetting/website/createSite.jsx +++ b/src/forge/SecuritySetting/website/createSite.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect, Fragment } from "react"; -import { Button, message, Form, Input, Select } from "antd"; +import { Button, message, Form, Input, Select, Modal, Checkbox } from "antd"; import "./index.scss"; import "../../users/Material/Index.scss"; import axios from "axios"; @@ -17,6 +17,9 @@ function CreateSite(props) { const [language, setLanguage] = useState(undefined); const [themes, setThemes] = useState([]); const [theme, setTheme] = useState(undefined); + const [modalVisibal, setmodalVisibal] = useState(false); + const [accept, setAccept] = useState(false); + const [formValues, setFormValues] = useState({}); useEffect(() => { document.title = "创建站点"; @@ -59,22 +62,34 @@ function CreateSite(props) { e.preventDefault(); validateFieldsAndScroll((err, values) => { if (!err) { - axios.post(`/projects/page_migrate.json`,{ - ...values, - clone_addr: theme && theme.clone_url, - theme: theme && theme.name, - user_id: current_user.user_id, - identifier: values.identifier.split("http://")[1] - }).then(res=>{ - if(res && res.status === 200){ - message.success("新建成功"); - history.push(`/settings/mysite`); - } - }) + setmodalVisibal(true) + setFormValues(values) } }); } + function confirmSubmit() { + axios.post(`/projects/page_migrate.json`,{ + ...formValues, + site_name: formValues.identifier, + clone_addr: theme && theme.clone_url, + theme: theme && theme.name, + user_id: current_user.user_id, + identifier: formValues.identifier.split("http://")[1] + }).then(res=>{ + onCancel() + if(res && res.status === 200){ + message.success("新建成功"); + history.push(`/settings/mysite`); + } + }) + } + function onCancel() { + setmodalVisibal(false); + setAccept(false); + setFormValues({}); + } + return (
    我的站点 / 新建站点
    @@ -89,22 +104,18 @@ function CreateSite(props) { onSubmit={submit} >
    站点配置
    - + {/* {getFieldDecorator("site_name", { rules: [{ required: true, message: "请输入站点名称" }, {type: 'string', max: 50, min: 1, message: "长度1-50"}], })()} - + */} - {getFieldDecorator("identifier", { - rules: [{ required: true, message: "请输入站点标识" }, - // {pattern: /^[a-zA-Z0-9]{2,100}$/, message: '长度2-100,只能包含数字和字母'} - ], - })( + {getFieldDecorator("identifier")( { setTag(e.target.value); @@ -154,7 +165,7 @@ function CreateSite(props) { {/* / 0.87 */} {getFieldDecorator("repository_name", { - rules: [{ required: true, message: "请输入项目标识" }, + rules: [ {pattern: /^[a-zA-Z0-9][a-zA-Z0-9_.-]{2,100}[a-zA-Z0-9]$/, message: "长度2-100,只能包含数字、字母、下划线、中划线、英文句号,必须以数字和字母开头,不能以下划线/中划线/英文句号开头和结尾"}], })( @@ -166,8 +177,7 @@ function CreateSite(props) { label="项目名称" > {getFieldDecorator("name", { - rules: [{ required: true, message: "请输入项目名称" }, - {type: 'string', max: 50, min: 1, message: "长度1-50"}], + rules: [{type: 'string', max: 50, min: 1, message: "长度1-50"}], })( )} @@ -192,6 +202,40 @@ function CreateSite(props) { + +
    + 个人建站声明 + +
    +
    +

    个人建站服务仅供Jekyll、Hugo、Hexo静态网站效果演示用途,请勿用于违规内容,包括但不仅限于:

    +
      +
        发布诱导分享/诱导关注/诱导下载/诱导跳转内容
      +
        发布欺诈/谣言/骚扰信息/广告信息/垃圾信息/特殊识别码、口令类信息
      +
        发布低俗内容/“宗教性捐献”及相关信息
      +
        发布侵害他人权利/违法经营及可疑服务类内容
      +
        发布其它违反国家法律法规的内容
      +
    +

    平台保留使用规则最终解释权,如发现上述违规行为,平台将视违规情况严重程度予以建站服务封禁以至账号永久封禁惩罚。

    + { setAccept(e.target.checked) }}>我已阅读并接受 《个人建站声明条款》 +
    +
    +
    + + +
    +
    ); } diff --git a/src/forge/SecuritySetting/website/index.scss b/src/forge/SecuritySetting/website/index.scss index 45834b803..d01f5c61f 100644 --- a/src/forge/SecuritySetting/website/index.scss +++ b/src/forge/SecuritySetting/website/index.scss @@ -29,4 +29,71 @@ color: $primary-color; } } +} +.m-header { + background: url(../img/header.png) no-repeat; + background-size: 101% 100%; + height: 56px; + text-align: center; + line-height: 56px; + font-size: 18px; + font-weight: 500; + color: #FFFFFF; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + position: relative; + i { + position: absolute; + right: 16px; + top: 0; + cursor: pointer; + } +} +.m-content { + padding: 19px 26px; + font-size: 15px; + color: #4C5B76; + line-height: 30px; + ul { + padding: 10px 0; + } + ol { + display: flex; + align-items: center; + &:before { + content: ''; + display: inline-block; + width: 5px; + height: 5px; + background: #202D40; + opacity: 1; + border-radius: 100%; + margin-right: 8px; + } + } + .divider { + width: 100%; + height: 0px; + opacity: 1; + border: 1px solid rgba(153,153,153,0.1); + margin-top: 21px; + } +} +.m-footer { + display: flex; + align-items: center; + justify-content: center; + padding: 5px 0 27px 0; + button { + width: 120px; + height: 36px; + border-radius: 4px 4px 4px 4px; + font-size: 15px; + font-weight: 400; + color: #FFFFFF; + &:nth-of-type(1) { + color: #666666; + margin-right: 78px; + } + } } \ No newline at end of file diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss index 5b21e05d7..4e1f5f672 100644 --- a/src/forge/Team/Index.scss +++ b/src/forge/Team/Index.scss @@ -561,4 +561,19 @@ align-items: center; justify-content: center; } +} + +.plusCard{ + display: flex; + flex-direction: column; + justify-content: center; + width: 104px; + height: 104px; + margin-bottom: 8px; + text-align: center; + vertical-align: top; + background-color: #fafafa; + border: 1px dashed #d9d9d9; + border-radius: 4px; + cursor: pointer; } \ No newline at end of file diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx index db4bf1451..5ec95b5e8 100644 --- a/src/forge/Team/New.jsx +++ b/src/forge/Team/New.jsx @@ -1,22 +1,26 @@ import React,{ forwardRef , useCallback , useEffect, useState } from 'react'; import './Index.scss'; -import { Form , Input , Radio , Checkbox , Button } from "antd"; -import UploadImage from './Component/UploadImage'; +import { Form , Input , Icon , Checkbox , Button } from "antd"; +// import UploadImage from './Component/UploadImage'; +import AvatarModal from '../users/Avatar/Index'; import axios from 'axios'; + + const port = window.location.port; const hostname = window.location.hostname; export default Form.create()( forwardRef(({ form , showNotification , history, showNpsModal })=>{ const [ image , setImage ] = useState(undefined); const [ imageFlag , setImageFlag] = useState(false); + const [ imageVisible , setIamgeVisible ] = useState(false); const [ descNum ,setDescNum ] = useState(0); const { getFieldDecorator, validateFields , setFieldsValue } = form; - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - } + // const radioStyle = { + // display: 'block', + // height: '30px', + // lineHeight: '30px', + // } const helper = useCallback( (label, name, rules, widget, isRequired = true) => ( @@ -68,14 +72,27 @@ export default Form.create()( if(!value){ callback(); } - if(value && !value.match(/^[a-zA-Z0-9][a-zA-Z0-9_-]{3,19}$/)){ - callback("只能使用以字母、数字开头,包含字母、数字、下划线、横杠等,长度4到20个字符"); + let reg = /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*$/ + if(value && !value.match(reg)){ + callback("只能以数字或字母开头,仅支持横杠、下划线、点三种符号,不允许符号连续排列,长度4-50个字符"); + } + if(value && (value.length<4 || value.length>50)){ + callback("只能以数字或字母开头,仅支持横杠、下划线、点三种符号,不允许符号连续排列,长度4-50个字符12"); } callback(); } + function saveImgFunc(imgUrl){ + setImage(imgUrl); + setIamgeVisible(false); + } + return(
    + { + imageVisible && + {setIamgeVisible(false)}} saveFunc={saveImgFunc}/> + }

    新建组织

    @@ -90,7 +107,7 @@ export default Form.create()( ], )} {helper( @@ -131,11 +148,23 @@ export default Form.create()( 私有(仅对组织成员可见) )} */} - -

    选择头像

    - - {imageFlag &&

    请上传头像

    } - +
    +

    选择头像

    + {/* */} +
    {setIamgeVisible(true)}}> + { + image ? + avatar + : + + +
    点击上传
    +
    + } +
    + {/* */} + {imageFlag &&

    请上传头像

    } +
    {helper( '权限', "repo_admin_change_team_access", diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx index d1ff67c0f..975dbe161 100644 --- a/src/forge/Team/Setting/TeamSettingCommon.jsx +++ b/src/forge/Team/Setting/TeamSettingCommon.jsx @@ -1,11 +1,12 @@ import React, { forwardRef , useCallback , useEffect, useState } from 'react'; -import { Form , Input , Radio ,Checkbox , Divider , Button , InputNumber } from 'antd'; +import { Form , Input , Icon ,Checkbox , Divider , Button , InputNumber } from 'antd'; import { WhiteBack , FlexAJ } from '../../Component/layout'; import Title from '../../Component/Title'; import styled from 'styled-components'; -import UploadImage from '../Component/UploadImage'; +// import UploadImage from '../Component/UploadImage'; import axios from 'axios'; import Modals from '../Component/Modals'; +import AvatarModal from '../../users/Avatar/Index'; import { getImageUrl } from 'educoder'; const TextArea = Input.TextArea; @@ -27,6 +28,7 @@ export default Form.create()( const [ visible , setVisible ] = useState(false); const [ privacyVisible , setPrivacyVisible ] = useState(false); const [ descNum , setDescNum ] = useState(0); + const [ imageVisible , setIamgeVisible ] = useState(false); const { getFieldDecorator , validateFields , setFieldsValue , getFieldsValue} = form; useEffect(()=>{ @@ -75,7 +77,7 @@ export default Form.create()( function getImage(image){ setImageFlag(true); setImage(image); - console.log(image); + setIamgeVisible(false); } // 删除组织 @@ -123,6 +125,10 @@ export default Form.create()( } return(
    + { + imageVisible && + {setIamgeVisible(false)}} saveFunc={getImage}/> + } 基本设置 setPrivacyVisible(false)}> @@ -196,8 +202,19 @@ export default Form.create()( ,false,false, "当输入栏为空时,默认数量无限制" )} -

    选择头像:

    - +

    选择头像:

    + {/* */} +
    {setIamgeVisible(true)}}> + { + image ? + avatar + : + + +
    点击上传
    +
    + } +
    diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx index eedce64b2..6062fd13a 100644 --- a/src/forge/Team/Sub/Detail.jsx +++ b/src/forge/Team/Sub/Detail.jsx @@ -55,28 +55,28 @@ function Detail(props){ useEffect(()=>{ if(OIdentifier){ - getDetail(OIdentifier); + getDetail(); } },[OIdentifier]); - function getDetail(id) { - const url = `/organizations/${id}.json`; + function getDetail() { + const url = `/organizations/${OIdentifier}.json`; axios.get(url).then(result=>{ if(result && result.data){ setDetail(result.data); - let keyWords=`${result.data.nickname},${id},`; - let title= result.data.nickname+'('+ id +') ' +result.data.description; - setSeoMeta(keyWords,title,title,`/${id}`,id); + let keyWords=`${result.data.nickname},${OIdentifier},`; + let title= result.data.nickname+'('+ OIdentifier +') ' +result.data.description; + setSeoMeta(keyWords,title,title,`/${OIdentifier}`,OIdentifier); } }).catch(error=>{}) } - function updateDetail(name,desc){ - let d = detail; - d.name = name; - d.description = desc; - setDetail(d); - } + // function updateDetail(name,desc){ + // let d = detail; + // d.name = name; + // d.description = desc; + // setDetail(d); + // } return(
    { @@ -140,7 +140,7 @@ function Detail(props){ { - return + return }} > diff --git a/src/forge/Team/images/white.jpg b/src/forge/Team/images/white.jpg new file mode 100644 index 000000000..a4396ef74 Binary files /dev/null and b/src/forge/Team/images/white.jpg differ diff --git a/src/forge/Wiki/EditWiki.jsx b/src/forge/Wiki/EditWiki.jsx index 728f6e775..6ec63904f 100644 --- a/src/forge/Wiki/EditWiki.jsx +++ b/src/forge/Wiki/EditWiki.jsx @@ -18,7 +18,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, let wikiName = '' let key = ''; if (!pathname.endsWith('/wiki/add')) { - wikiName = pathname.split('/')[4]; + wikiName = decodeURI(pathname.split('/')[4]); key = pathname.split('/')[5]; }else{ key = search.split('=').pop(); @@ -116,6 +116,12 @@ export default Form.create()(({ form, history, showNotification, projectDetail, }; validateFields((err, values) => { if (!err) { + let regEn = /[\\/:*?"<>|[\]-]/g; + if (regEn.test(values.title)) { + message.error('文件名不能有特殊字符: \\ / : * ? \" < > | [ \] -'); + setOperateFlag(false); + return; + } const {md_content, title} = values; if (wikiName && search!== "?copy") { updateWiki({ @@ -124,7 +130,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, projectId: project.id, pageName: wikiName, title, - message: '', + commit_message: '', content_base64: Base64.encode(md_content) }).then(res => dealRes(res, title)); } else { @@ -217,7 +223,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, projectId: project.id, pageName: '_Sidebar', title: '_Sidebar', - message: '', + commit_message: '', content_base64: Base64.encode(content) }).then(res => { if (res && res.message === "200") { @@ -327,7 +333,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail, "title", [ { required: true, message: "请输入标题" }, - { pattern: /^(?!-).*$/, message: '不能以-开头' } + // { pattern: /[^`\[\]\/:*?''<>|%-+_]/g, message: '不允许部分特殊字符' } ], { project && checkItem.name && getWiki({ owner: owner, repo: projectsId, - pageName: checkItem.sub_url, + pageName: checkItem.name, projectId: project.id }).then(res => { if (res && res.message === "200") { @@ -190,6 +190,11 @@ export default (props) => { setAddMenuError("不能仅输入空格"); return; } + const regEn = /[\\/:*?"<>|[\]-]/g; + if (regEn.test(menuName)) { + setAddMenuError("不能有特殊字符: \\ / : * ? \" < > | [ \] -"); + return; + } // 校验一级目录中是否有相同名称 const oneMenuList = fileList.filter(item=>!item.title.trim().startsWith('[[')).map(i=>i.title.trim()) if(oneMenuList.includes(`- ${menuName}`)){ @@ -210,7 +215,7 @@ export default (props) => { projectId: project.id, pageName: '_Sidebar', title: '_Sidebar', - message: '', + commit_message: '', content_base64: Base64.encode(treeToMd(sidebarList)) }).then(res => { if (res && res.message === "200") { @@ -228,7 +233,7 @@ export default (props) => { } function goEdit(params) { - history.push(`/${owner}/${projectsId}/wiki/${encodeURI(checkItem.sub_url)}/${checkItem.key}/edit${params}`); + history.push(`/${owner}/${projectsId}/wiki/${encodeURI(checkItem.name)}/${checkItem.key}/edit${params}`); } function preview() { diff --git a/src/forge/Wiki/Preview.jsx b/src/forge/Wiki/Preview.jsx index 2b700f60c..b36b1946f 100644 --- a/src/forge/Wiki/Preview.jsx +++ b/src/forge/Wiki/Preview.jsx @@ -63,7 +63,7 @@ export default (props) => { projectsId && checkItem.name && getWiki({ owner: owner, repo: projectsId, - pageName: checkItem.sub_url, + pageName: checkItem.name, projectId: projectId, }).then(res => { if (res && res.message === "200") { diff --git a/src/forge/Wiki/api.js b/src/forge/Wiki/api.js index 2250ec5f4..66425e0fb 100644 --- a/src/forge/Wiki/api.js +++ b/src/forge/Wiki/api.js @@ -116,16 +116,13 @@ export function markdownToTree(markdownText){ lines.map((item, index) =>{ const title = item.trim(); const isFile = title.startsWith('[[') && title.endsWith(']]'); - const titleStr = isFile ? title.substring(2, title.length - 2) : title.substring(2, title.length) const node = { // 带空格+[[]]或者- 标识 title: item, children: [], key: undefined, // 纯内容 - titleStr, - // 编码后的title,获取wiki内容用title_sub - title_sub: encodeURIComponent(titleStr), + titleStr: isFile ? title.substring(2, title.length - 2) : title.substring(2, title.length), // 是否是wiki文件 isFile: isFile } diff --git a/src/forge/Wiki/components/sidebar/index.jsx b/src/forge/Wiki/components/sidebar/index.jsx index d7046edb0..794ecbabc 100644 --- a/src/forge/Wiki/components/sidebar/index.jsx +++ b/src/forge/Wiki/components/sidebar/index.jsx @@ -163,7 +163,7 @@ export default function Sidebar(props) { const {node, children, key} = item; if(isFile){ // 删除页面 - deleteWiki({owner: owner, repo: projectsId, projectId: project.id, pageName: item.title_sub}).then(res => { + deleteWiki({owner: owner, repo: projectsId, projectId: project.id, pageName: title}).then(res => { if(res && res.message === "204"){ // 递归过滤相同key值的节点,执行删除操作 const menuListByDel = findSameKeyByDel(menuList, key); @@ -267,7 +267,7 @@ export default function Sidebar(props) { projectId: project.id, pageName: '_Sidebar', title: '_Sidebar', - message: '', + commit_message: '', content_base64: Base64.encode(content) }).then(res => { if (res && res.message === "200") { @@ -303,18 +303,20 @@ export default function Sidebar(props) { e.stopPropagation(); setVisible(item); setIsEditName(type); - const {titleStr, title_sub} = item; + let title = item.title.trim(); + const isFile = title.startsWith('[[') && title.endsWith(']]'); + title = isFile ? title.substring(2,title.length-2) : title.substring(2, title.length); type === 2 && getWiki({ owner: owner, repo: projectsId, - pageName: title_sub, + pageName: title, projectId: project.id }).then(res => { if (res && res.message === "200") { setWikiContent(res.data.md_content); } }) - setMenuName(titleStr); + setMenuName(title); } // 新增子目录 或者 重命名目录 @@ -327,8 +329,9 @@ export default function Sidebar(props) { setAddMenuError("不能仅输入空格"); return; } - if (isEditName === 2 && /^-/.test(menuName)) { - setAddMenuError('不能以-开头'); + const regEn = /[\\/:*?"<>|[\]-]/g; + if (regEn.test(menuName)) { + setAddMenuError('不能有特殊字符: \\ / : * ? \" < > | [ \] -'); return; } if(!isEditName){ @@ -353,15 +356,14 @@ export default function Sidebar(props) { }else{ // isEditName 1 编辑目录名称 2编辑页面名称 const titleToJudge = isEditName === 2 ? `[[${menuName}]]` : `- ${menuName}`; - const {key, titleStr, title_sub} = visible; - // 判断是否有修改名称 - if(titleStr === menuName){ + const {title, key} = visible; + if(title.trim() === titleToJudge){ setAddMenuError("请修改名称"); return } // 找兄弟节点 const list = findBrotherNodesByKey(menuList, key) || []; - if(list.map(item=>item.titleStr).includes(menuName)){ + if(list.map(item=>item.title.trim()).includes(titleToJudge)){ setAddMenuError("不能与同级目录名称相同"); return } @@ -379,16 +381,17 @@ export default function Sidebar(props) { }) if(isEditName === 2){ // 编辑页面名称-> 修改wiki + const oldTitle = title.substring(title.indexOf('[[')+2, title.indexOf(']]')) updateWiki({ owner, repo: projectsId, projectId: project.id, // 原名称 - pageName: title_sub, + pageName: oldTitle, // 现名称 title: menuName, content_base64: wikiContent, - message: '', + commit_message: '', }).then(res=>{ if(res && res.message === '200'){ // 修改wiki名称接口请求成功,更新sidebar diff --git a/src/forge/Wiki/components/uploadWiki/index.jsx b/src/forge/Wiki/components/uploadWiki/index.jsx index 30cfe492c..4113752dd 100644 --- a/src/forge/Wiki/components/uploadWiki/index.jsx +++ b/src/forge/Wiki/components/uploadWiki/index.jsx @@ -59,8 +59,10 @@ export default function UploadWiki(props) { message.error('只能上传md、txt文件'); return false; } - if (/^-/.test(file.name)) { - message.error('文件名不能以-开头'); + + let regEn = /[\\/:*?"<>|[\]-]/g; + if (regEn.test(file.name)) { + message.error('文件名不能有特殊字符: \\ / : * ? \" < > | [ \] -'); return false; } @@ -84,7 +86,7 @@ export default function UploadWiki(props) { projectId: project.id, pageName: '_Sidebar', title: '_Sidebar', - message: '', + commit_message: '', content_base64: Base64.encode(treeToMd(sidebarList)) }).then(res => { if (res && res.message === "200") { diff --git a/src/forge/users/Avatar/Index.jsx b/src/forge/users/Avatar/Index.jsx index fd1389371..9ed18c605 100644 --- a/src/forge/users/Avatar/Index.jsx +++ b/src/forge/users/Avatar/Index.jsx @@ -5,9 +5,7 @@ import Cropper from 'react-cropper'; import 'cropperjs/dist/cropper.css'; import axios from 'axios'; -function Index({onCancel,avatarImg,login}){ - console.log('avatarImg,login', avatarImg,login); - +function Index({onCancel,avatarImg,login,saveFunc}){ const [ avatarPhoto , setAvatarPhoto ] = useState(avatarImg); useEffect(()=>{ @@ -23,15 +21,19 @@ function Index({onCancel,avatarImg,login}){ if (!imgUrl) { message.info('请先上传图片'); } - const url = `/users/${login}/update_image.json`; - axios.put(url,{ - image:imgUrl - }).then(result=>{ - if(result){ - message.success("头像修改成功!"); - onCancel(true); - } - }).catch(error=>{}) + if(login){ + const url = `/users/${login}/update_image.json`; + axios.put(url,{ + image:imgUrl + }).then(result=>{ + if(result){ + message.success("头像修改成功!"); + onCancel(true); + } + }).catch(error=>{}) + }else{ + saveFunc && saveFunc(imgUrl); + } } function onChange(e){ @@ -73,30 +75,35 @@ function Index({onCancel,avatarImg,login}){ footer={null} centered maskClosable={false} - title="修改头像" + title={`${login ? "修改": "上传组织" }头像`} onCancel={()=>onCancel(false)} className="avatarBox" >
    -
    - - {/* 仅支持JPG、GIF、PNG,且文件小于2M */} -
    + { + avatarPhoto ? +
    + + {/* 仅支持JPG、GIF、PNG,且文件小于2M */} +
    + : +
    选择本地照片,上传编辑{!login && "组织"}头像
    + }
    -
    +
    - 保存头像 + {(login || (avatarPhoto && !login)) && {login ? "保存头像":"确定"} }
    diff --git a/src/forge/users/Avatar/Index.scss b/src/forge/users/Avatar/Index.scss index 8b7c1b17c..8836e0674 100644 --- a/src/forge/users/Avatar/Index.scss +++ b/src/forge/users/Avatar/Index.scss @@ -12,12 +12,22 @@ } .avatarDiv{ display: flex; + position: relative; + min-height: 320px; + .tipsPosi{ + position: absolute; + width: 100%; + text-align: center; + top:40%; + height: 30px; + margin-top: -15px; + } .previewBox{ display: flex; flex-direction: column; align-items: center; justify-content: space-between; - margin-left: 30px; + margin-left: auto; .uploadBtn{ margin-bottom: 30px; display: flex; @@ -57,10 +67,12 @@ .previewImg{ overflow: hidden; background-color: #fff; - border-radius: 50%; text-align: center; width: 100px!important; height: 100px!important; + &.ring{ + border-radius: 50%; + } } } } \ No newline at end of file diff --git a/src/forge/users/Echart/Calendar.jsx b/src/forge/users/Echart/Calendar.jsx index c7daad665..8aafa0c32 100644 --- a/src/forge/users/Echart/Calendar.jsx +++ b/src/forge/users/Echart/Calendar.jsx @@ -90,6 +90,26 @@ function Calendar({ userLogin , time , chooseTime }) { } function Init(data,max,flag) { + let piecesList = []; + let number = 1; + if(max>500){ + number = 6; + }else if(max<=500 && max>200){ + number = 5; + }else if(max<=200 && max>100){ + number = 4; + }else if(max<=100 && max>=30){ + number = 3; + }else if(max<30 && max>=10){ + number = 2; + }else{ + number = 1; + } + for(var i=number;i>0;i--){ + let gt = {gt: parseInt(max/number*(i-1)+1,0), lte: parseInt(max/number*i,0)}; + piecesList.push(gt); + } + var huan_val = document.getElementById("Calendar"); var myEcharts = echarts.init(huan_val); let option = { @@ -111,7 +131,17 @@ function Calendar({ userLogin , time , chooseTime }) { inRange:{ color:flag ? ['#fafafa', '#216e39'] :['#fff','#fff'] }, - show:flag + show:flag, + pieces: [ + // {gt: parseInt(max/5*4,0), lte: max}, + // {gt: parseInt(max/5*3,0), lte: parseInt(max/5*4,0)}, + // {gt: parseInt(max/5*2,0), lte: parseInt(max/5*3,0)}, + // {gt: parseInt(max/5*1,0), lte: parseInt(max/5*2,0)}, + // {gt: 1, lte: parseInt(max/5*1,0)}, + ...piecesList, + {max: 1,label:"0"} + ], + itemGap:25 }, calendar: { top: 50, diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 3f0ae26db..0ad751e5c 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -11,7 +11,7 @@ import SupplyPhoneModal from '../../forge/Component/ProfileModal/SupplyPhone'; import SystemNotice from '../../forge/Component/NoticeModal/SystemNotice'; import cookie from 'react-cookies'; import NpsModal from '../modals/npsModal'; -import { IsPC } from 'educoder'; +import { isPhone } from 'educoder'; export function TPMIndexHOC(WrappedComponent) { return class II extends React.Component { @@ -287,7 +287,7 @@ export function TPMIndexHOC(WrappedComponent) { showNpsModal: this.showNpsModal }; let path =this.props.location.pathname; - let pathCheck = path.indexOf("/zone")>-1 && path.indexOf("/newdetail")>-1 && IsPC(); + let pathCheck = path.indexOf("/zone")>-1 && path.indexOf("/newdetail")>-1 && isPhone(); return (