forked from Gitlink/forgeplus-react
Merge pull request '更新' (#476) from durian/forgeplus-react:gitlink_server into gitlink_server
This commit is contained in:
commit
3e3ad0531a
|
@ -558,8 +558,8 @@
|
|||
|
||||
_this.setToolbar();
|
||||
|
||||
// editormd.loadScript(loadPath + "marked.min", function () {
|
||||
// });
|
||||
// 此处影响公式加载
|
||||
editormd.loadScript(loadPath + "marked.min", function () {
|
||||
|
||||
editormd.$marked = marked;
|
||||
|
||||
|
@ -572,6 +572,7 @@
|
|||
loadFlowChartOrSequenceDiagram();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
@ -1434,7 +1435,7 @@
|
|||
var tex = $(this);
|
||||
editormd.$katex.render(tex.text(), tex[0]);
|
||||
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
});
|
||||
|
||||
return this;
|
||||
|
@ -3810,7 +3811,7 @@
|
|||
div.find("." + editormd.classNames.tex).each(function () {
|
||||
var tex = $(this);
|
||||
katex.render(tex.text(), tex[0]);
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
});
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
69
src/App.css
69
src/App.css
|
@ -33,7 +33,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* md样式 */
|
||||
.editormd-fullscreen{
|
||||
z-index: 9999;
|
||||
}
|
||||
.editormd-menu>li:last-child{
|
||||
float: right;
|
||||
}
|
||||
/* 控制md编辑器列行的宽度
|
||||
见 codermirror maybeUpdateLineNumberWidth方法
|
||||
*/
|
||||
|
@ -72,8 +78,7 @@ body {
|
|||
.markdown-body p {
|
||||
margin:10px 0px!important;
|
||||
font-size: 16px !important;
|
||||
/* 用户提出多个徽章换行显示,p标签会换行显示 */
|
||||
/* white-space: pre-wrap; */
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.markdown-body>p {
|
||||
|
@ -94,7 +99,7 @@ body {
|
|||
border-left: 1px solid rgb(221, 221, 221);
|
||||
/* 某些情况下,被cm盖住了 */
|
||||
z-index: 99;
|
||||
padding:8px 8px 50px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.editormd-preview .markdown-body{
|
||||
padding:0px !important;
|
||||
|
@ -118,7 +123,6 @@ body {
|
|||
padding: 0 12px;
|
||||
}
|
||||
|
||||
|
||||
/* antd扩展 */
|
||||
.formItemInline.ant-form-item {
|
||||
display: flex;
|
||||
|
@ -141,58 +145,3 @@ body {
|
|||
min-height: calc(100% - 60px) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-header{
|
||||
border-bottom: none;
|
||||
background: none;
|
||||
padding: 16px 24px 0;
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-title{
|
||||
font-weight:500 !important;
|
||||
color:#151d40;
|
||||
font-size:18px;
|
||||
}
|
||||
.feedBackModal .anticon-close{
|
||||
font-size: 22px;
|
||||
}
|
||||
.feedBackModal .ant-modal-footer{
|
||||
border-top: none;
|
||||
text-align: center;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-content{
|
||||
background-image:linear-gradient(359.37deg,#ebf3ff 0%,#f8fbff 55.01%,#cbdbff 100%);
|
||||
border:1.5px solid #ffffff;
|
||||
}
|
||||
|
||||
.feedBackModal .feedBackText{
|
||||
padding: 20px;
|
||||
font-size:15px;
|
||||
color:#202d40;
|
||||
}
|
||||
.feedBackModal .feedBackText::placeholder{
|
||||
color:#afb7c2;
|
||||
}
|
||||
.feedBackModal .gotoIssueFeedBack{
|
||||
color: rgba(70, 106, 255, 1);
|
||||
}
|
||||
.feedBackBox{
|
||||
position: relative;
|
||||
background-color: white;
|
||||
}
|
||||
.feedBackText.errorInput{
|
||||
border: 1px solid #f60011;
|
||||
}
|
||||
.errorInput{
|
||||
background-color:rgba(255, 0, 0, 0.04) !important;
|
||||
}
|
||||
.ant-input.errorInput:hover{
|
||||
background-color: white !important;
|
||||
}
|
||||
.countNumBox{
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
right: 10px;
|
||||
}
|
|
@ -460,3 +460,58 @@ li.ant-menu-item{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-header{
|
||||
border-bottom: none;
|
||||
background: none;
|
||||
padding: 16px 24px 0;
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-title{
|
||||
font-weight:500 !important;
|
||||
color:#151d40;
|
||||
font-size:18px;
|
||||
}
|
||||
.feedBackModal .anticon-close{
|
||||
font-size: 22px;
|
||||
}
|
||||
.feedBackModal .ant-modal-footer{
|
||||
border-top: none;
|
||||
text-align: center;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.feedBackModal .ant-modal-content{
|
||||
background-image:linear-gradient(359.37deg,#ebf3ff 0%,#f8fbff 55.01%,#cbdbff 100%);
|
||||
border:1.5px solid #ffffff;
|
||||
}
|
||||
|
||||
.feedBackModal .feedBackText{
|
||||
padding: 20px;
|
||||
font-size:15px;
|
||||
color:#202d40;
|
||||
}
|
||||
.feedBackModal .feedBackText::placeholder{
|
||||
color:#afb7c2;
|
||||
}
|
||||
.feedBackModal .gotoIssueFeedBack{
|
||||
color: rgba(70, 106, 255, 1);
|
||||
}
|
||||
.feedBackBox{
|
||||
position: relative;
|
||||
background-color: white;
|
||||
}
|
||||
.feedBackText.errorInput{
|
||||
border: 1px solid #f60011;
|
||||
}
|
||||
.errorInput{
|
||||
background-color:rgba(255, 0, 0, 0.04) !important;
|
||||
}
|
||||
.ant-input.errorInput:hover{
|
||||
background-color: white !important;
|
||||
}
|
||||
.countNumBox{
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
right: 10px;
|
||||
}
|
|
@ -51,11 +51,14 @@ class NewHeader extends Component {
|
|||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
// this.geturlsdata();
|
||||
let settings = localStorage.chromesetting&&JSON.parse(localStorage.chromesetting);
|
||||
// 用personal判断是否需要再次请求settings接口,解决登录注册之后无设置按钮的情况
|
||||
if(localStorage.chromesetting && localStorage.chromesetting.personal){
|
||||
this.setState({
|
||||
settings
|
||||
settings: JSON.parse(localStorage.chromesetting)
|
||||
})
|
||||
}else{
|
||||
this.geturlsdata();
|
||||
}
|
||||
window._header_componentHandler = this;
|
||||
|
||||
try {
|
||||
|
|
|
@ -402,7 +402,8 @@ class Detail extends Component {
|
|||
praises_count: result.data.praises_count,
|
||||
forked_count: result.data.forked_count,
|
||||
defaultBranch: result.data.default_branch
|
||||
})
|
||||
});
|
||||
document.title = `${result.data.author.name}/${result.data.name}:${result.data.description}`;
|
||||
}
|
||||
}
|
||||
}).catch((error) => { })
|
||||
|
|
|
@ -382,7 +382,7 @@ class Index extends Component {
|
|||
}
|
||||
</Select>
|
||||
<Search
|
||||
placeholder="输入项目名称关键字进行搜索"
|
||||
placeholder="输入关键字进行搜索"
|
||||
enterButton="搜索"
|
||||
size="large"
|
||||
onSearch={this.searchFun}
|
||||
|
|
|
@ -84,7 +84,7 @@ function Index() {
|
|||
<span>开源项目</span>
|
||||
|
||||
<Search
|
||||
placeholder="输入项目名称关键字进行搜索"
|
||||
placeholder="输入关键字进行搜索"
|
||||
enterButton="搜索"
|
||||
size="middle"
|
||||
onSearch={searchFun}
|
||||
|
|
|
@ -657,7 +657,7 @@ a.issue-type-button.active:hover {
|
|||
line-height: 18px;
|
||||
margin-left: 8px;
|
||||
background-color: rgba(235,244,254,1);
|
||||
color: #1890ff;
|
||||
color: $primary-color;
|
||||
font-size: 12px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 9px;
|
||||
|
|
|
@ -90,7 +90,7 @@ function Index(props){
|
|||
<ul className="securityUl ul-border-buttom">
|
||||
<li>个人信息</li>
|
||||
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i><span className="text-shodow-bold">基本资料</span></Link></li>
|
||||
<li className={pathname.indexOf("/settings/account")>-1 ?"active":""}><Link to={`/settings/account`}><i className="iconfont icon-xuanzhonganquanshezhi_icon mr5 font-14"></i><span className="text-shodow-bold">账号管理</span></Link></li>
|
||||
<li className={(pathname.indexOf("/settings/emails")>-1 || pathname.indexOf("/settings/password")>-1 || pathname.indexOf("/settings/cancel")>-1) ?"active":""}><Link to={`/settings/emails`}><i className="iconfont icon-xuanzhonganquanshezhi_icon mr5 font-14"></i><span className="text-shodow-bold">账号管理</span></Link></li>
|
||||
</ul>
|
||||
{notice_url && <ul className="securityUl ul-border-buttom">
|
||||
<li>消息通知</li>
|
||||
|
@ -136,7 +136,19 @@ function Index(props){
|
|||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/settings/account"
|
||||
path="/settings/emails"
|
||||
render={(p) => (
|
||||
<Password {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/settings/password"
|
||||
render={(p) => (
|
||||
<Password {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/settings/cancel"
|
||||
render={(p) => (
|
||||
<Password {...props} {...p}/>
|
||||
)}
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
.menuPanels{
|
||||
width: 295px;
|
||||
&.maxWidth{
|
||||
width: 400px;
|
||||
}
|
||||
.leftline{
|
||||
position: relative;
|
||||
color: #666;
|
||||
|
@ -43,16 +46,13 @@
|
|||
}
|
||||
|
||||
.claimNote_input{
|
||||
// up, right, botton, left
|
||||
margin: 5px 10px 5px 10px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.claimNote{
|
||||
// up, right, botton, left
|
||||
margin: 5px 14px 0px 14px;
|
||||
padding-bottom: 5px;
|
||||
margin: 5px 14px;
|
||||
padding-bottom: 10px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.attrPerson{
|
||||
padding-top: 12px;
|
||||
|
|
|
@ -1,37 +1,50 @@
|
|||
import React, { Component } from "react";
|
||||
import React from "react";
|
||||
import axios from "axios";
|
||||
import { AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { Popover, List, Button, Dropdown, Input} from "antd";
|
||||
import { AlignCenter, FlexAJ } from "../Component/layout";
|
||||
import { Popover, Button, Input } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
import { getImageUrl } from "educoder";
|
||||
import "./claim.scss"
|
||||
import "./claim.scss";
|
||||
const { TextArea } = Input;
|
||||
|
||||
class claims extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
claimerdata: new Array(),
|
||||
claimerData: new Array(),
|
||||
currentUserClaimed: 0,
|
||||
issue_id: this.props.issue_id,
|
||||
claimNoteBody:'',
|
||||
claimNoteBody: "",
|
||||
claimNoteBodyChanged: false,
|
||||
claimNotePop:false
|
||||
};
|
||||
|
||||
claimNotePop: false,
|
||||
claimNoteBodyError: undefined,
|
||||
// 原声明信息
|
||||
currentUserClaimedContent: undefined
|
||||
};
|
||||
}
|
||||
|
||||
getClaimers = () => {
|
||||
const { issue_id } = this.state;
|
||||
axios.get(`/issues/${issue_id}/claims.json`)
|
||||
const { current_user } = this.props;
|
||||
axios
|
||||
.get(`/issues/${issue_id}/claims.json`)
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
claimerData: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed,
|
||||
});
|
||||
// 如果用户有声明此issue,则赋值currentUserClaimedContent、claimNoteBody
|
||||
if(result.data.currentUserclaimed){
|
||||
const map = result.data.claimers.filter(item =>{return item.user_login === current_user.login});
|
||||
this.setState({
|
||||
currentUserClaimedContent: map[0],
|
||||
claimNoteBody: map[0] && map[0].note_body
|
||||
})
|
||||
}
|
||||
}).catch(function (error) {
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
@ -43,19 +56,21 @@ class claims extends React.Component {
|
|||
} else {
|
||||
const { issue_id } = this.state;
|
||||
axios({
|
||||
method: 'delete',
|
||||
url: `/issues/${issue_id}/claims.json`
|
||||
}).then(result => {
|
||||
method: "delete",
|
||||
url: `/issues/${issue_id}/claims.json`,
|
||||
})
|
||||
.then((result) => {
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
claimerData: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed,
|
||||
claimNotePop: false,
|
||||
claimNoteBody:'',
|
||||
claimNoteBody: "",
|
||||
currentUserClaimedContent: undefined
|
||||
});
|
||||
const { refreshFunc } = this.props;
|
||||
refreshFunc && refreshFunc();
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
@ -63,29 +78,56 @@ class claims extends React.Component {
|
|||
|
||||
changeClaimNote = (e) => {
|
||||
this.setState({
|
||||
claimNoteBodyError: undefined,
|
||||
claimNoteBody: e.target.value,
|
||||
claimNoteBodyChanged: true,
|
||||
});
|
||||
};
|
||||
|
||||
yesClaim = () => {
|
||||
const {issue_id,claimNoteBody} = this.state;
|
||||
const { refreshFunc } = this.props;
|
||||
|
||||
const { issue_id, claimNoteBody, currentUserClaimed, currentUserClaimedContent} = this.state;
|
||||
const { refreshFunc, current_user} = this.props;
|
||||
if(claimNoteBody){
|
||||
// 新增声明
|
||||
if(!currentUserClaimed){
|
||||
axios.post(`/issues/${issue_id}/claims.json`, {
|
||||
claim_note: claimNoteBody
|
||||
claim_note: claimNoteBody,
|
||||
})
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
const map = result.data.claimers.filter(item =>{return item.user_login === current_user.login});
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
claimerData: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed,
|
||||
claimNotePop: false,
|
||||
currentUserClaimedContent: map[0],
|
||||
claimNoteBody: map[0] && map[0].note_body
|
||||
});
|
||||
refreshFunc && refreshFunc();
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}else{
|
||||
// 更新声明
|
||||
axios.put(`/issues/${issue_id}/claims.json`, {
|
||||
claim_note: claimNoteBody,
|
||||
claim_id: currentUserClaimedContent.claim_id,
|
||||
})
|
||||
.then((result) => {
|
||||
this.setState({
|
||||
claimerData: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed,
|
||||
claimNotePop: false
|
||||
});
|
||||
refreshFunc && refreshFunc();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
this.setState({claimNoteBodyError: '请输入您的声明留言'});
|
||||
}
|
||||
};
|
||||
|
||||
addClaim = () => {
|
||||
|
@ -97,189 +139,200 @@ class claims extends React.Component {
|
|||
claimNotePop: true,
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
updateClaim = (claimId,key)=>{
|
||||
const {issue_id,claimNoteBody,claimNoteBodyChanged} = this.state;
|
||||
const { refreshFunc } = this.props;
|
||||
if(claimNoteBodyChanged){
|
||||
axios.put(`/issues/${issue_id}/claims.json`, {
|
||||
claim_note: claimNoteBody,
|
||||
claim_id: claimId
|
||||
})
|
||||
.then(result => {
|
||||
this.setState({
|
||||
claimerdata: result.data.claimers,
|
||||
currentUserClaimed: result.data.currentUserclaimed,
|
||||
});
|
||||
refreshFunc && refreshFunc();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
this.setVisibleFunc(false,key)
|
||||
};
|
||||
|
||||
|
||||
|
||||
cancleClaim = ()=>{
|
||||
cancelClaim = () => {
|
||||
const {currentUserClaimedContent} = this.state;
|
||||
this.setState({
|
||||
claimNotePop: false,
|
||||
})
|
||||
claimNoteBodyError: undefined,
|
||||
claimNoteBody: currentUserClaimedContent ? currentUserClaimedContent.note_body : ''
|
||||
});
|
||||
};
|
||||
|
||||
componentDidMount = () => {
|
||||
this.getClaimers();
|
||||
};
|
||||
|
||||
|
||||
setVisibleFunc = (flag, index) => {
|
||||
const {claimerdata} = this.state
|
||||
var lx = claimerdata.concat();
|
||||
lx.map(i=>i.visible =false);
|
||||
const { claimerData } = this.state;
|
||||
var lx = claimerData.concat();
|
||||
lx.map((i) => (i.visible = false));
|
||||
if (flag) {
|
||||
lx[index].visible = flag;
|
||||
}
|
||||
lx.splice();
|
||||
this.setState({
|
||||
claimerdata:lx
|
||||
})
|
||||
}
|
||||
claimerData: lx,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
claimerdata,
|
||||
currentUserClaimed,
|
||||
issue_id
|
||||
} = this.state;
|
||||
const { claimerData, currentUserClaimed, claimNoteBody, claimNoteBodyError } = this.state;
|
||||
|
||||
const rednerlist = (item)=>{
|
||||
const renderClaim = () => {
|
||||
return (
|
||||
<div>
|
||||
<Link to={`/${item && item.user_login}`} className="show-user-link">
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`/${item && item.user_picture}`)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"/>
|
||||
</Link>
|
||||
<Link to={`/${item && item.user_login}`}
|
||||
className="show-user-link color-black ml10 fwb">
|
||||
{item && item.user_name}
|
||||
</Link>
|
||||
<span className="color-grey-8"> 声明于 {item.created_at}</span>
|
||||
<div className="claimNote_input" style={{ width: "400" }}>
|
||||
<div className="mb5"> 声明留言:</div>
|
||||
<TextArea
|
||||
rows={6}
|
||||
type="text"
|
||||
placeholder="例如可以留言你的解决思路......"
|
||||
onChange={this.changeClaimNote}
|
||||
value={claimNoteBody}
|
||||
className={claimNoteBodyError ? 'error' : ''}
|
||||
/>
|
||||
<div className="mt10" style={{color: 'red'}}>{claimNoteBodyError}</div>
|
||||
<div style={{ display: "flex", justifyContent: "center" }} className="mt10">
|
||||
<Button onClick={() => this.cancelClaim()}>取 消</Button>
|
||||
<Button
|
||||
onClick={() => this.yesClaim()}
|
||||
style={{ marginLeft: "20px" }}
|
||||
type={"primary"}
|
||||
>
|
||||
确 认
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderClaim = ()=>{
|
||||
return(
|
||||
<div className="claimNote_input">
|
||||
<span> 声明留言:</span> <br/>
|
||||
<TextArea rows={4} type="text" placeholder="例如可以留言你的解决思路......" onChange={this.changeClaimNote}/><br/><br/>
|
||||
<div style={{display:"flex",justifyContent:'center'}}>
|
||||
<Button onClick={()=>this.cancleClaim()} >取 消</Button>
|
||||
<Button onClick={()=>this.yesClaim()} style={{marginLeft:"20px"}} type={'primary'} >确 认</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
};
|
||||
|
||||
const renderUser = (item, key) => {
|
||||
const { current_user } = this.props;
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<FlexAJ className="menuMaininfos">
|
||||
<AlignCenter>
|
||||
<Link to={`/${item && item.user_login}`} className="show-user-link">
|
||||
<Link
|
||||
to={`/${item && item.user_login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`/${item && item.user_picture}`)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"/>
|
||||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<Link to={`/${item && item.user_login}`}
|
||||
className="show-user-link color-black ml10 fwb">
|
||||
<Link
|
||||
to={`/${item && item.user_login}`}
|
||||
className="show-user-link color-black ml10 fwb"
|
||||
>
|
||||
<div>
|
||||
{current_user.login == item.user_login?(<div>你</div>
|
||||
{current_user.login == item.user_login ? (
|
||||
<div>你</div>
|
||||
) : (
|
||||
<div>{item && item.user_name}</div>
|
||||
)}
|
||||
</div>
|
||||
</Link>
|
||||
<div style={{marginLeft:"10px"}}> <span className="color-grey-8"> 声明于 {item.created_at}</span></div>
|
||||
<div style={{ marginLeft: "10px" }}>
|
||||
{" "}
|
||||
<span className="color-grey-8"> 声明于 {item.created_at}</span>
|
||||
</div>
|
||||
</AlignCenter>
|
||||
</FlexAJ>
|
||||
<div className="claimNote">
|
||||
{current_user.login == item.user_login ? (
|
||||
<div><span>你的留言:</span><br/>
|
||||
<TextArea onChange={this.changeClaimNote} type="text" defaultValue={item.note_body} /><br/>
|
||||
<div style={{display:"flex",justifyContent:'center',paddingBottom:"10px",paddingTop:"10px"}}>
|
||||
<Button onClick={()=>this.updateClaim(item.claim_id,key)} type={'primary'} >更新声明留言</Button>
|
||||
<div>
|
||||
<div className="mb5">你的留言:</div>
|
||||
<span>{item.note_body}</span>
|
||||
<br />
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
paddingBottom: "10px",
|
||||
paddingTop: "10px",
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
onClick={() => this.delClaim()}
|
||||
type={"primary"}
|
||||
>
|
||||
取消声明
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
):
|
||||
(
|
||||
) : (
|
||||
<div>
|
||||
{item.note_body.length == 0 ? (
|
||||
<span>未留言</span>
|
||||
) : (
|
||||
<div><span>声明留言:</span><br/>
|
||||
<span>{item.note_body}</span></div>
|
||||
<div>
|
||||
<div className="mb5">声明留言:</div>
|
||||
<span>{item.note_body}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
{currentUserClaimed===1?(
|
||||
<div><Button onClick={()=>this.delClaim()} >取消声明</Button>
|
||||
</div>
|
||||
):(
|
||||
<Popover visible={this.state.claimNotePop} content={renderClaim()} trigger='click' placement="bottom" overlayClassName="menuPanels">
|
||||
<Button onClick={()=> this.addClaim()} type="primary"><i className="iconfont icon-shengming font-14 mr5 color-white"></i>声明</Button>
|
||||
<Popover
|
||||
visible={this.state.claimNotePop}
|
||||
content={renderClaim()}
|
||||
trigger="click"
|
||||
placement="bottom"
|
||||
overlayClassName="menuPanels maxWidth"
|
||||
>
|
||||
{currentUserClaimed === 1 ? <a
|
||||
className="topWrapper_btn"
|
||||
onClick={() => {this.setState({claimNotePop: true});}}
|
||||
style={{ display: "inline-block" }}
|
||||
>
|
||||
更改声明
|
||||
</a> : <Button onClick={() => this.addClaim()} type="primary">
|
||||
<i className="iconfont icon-shengming font-14 mr5 color-white"></i>
|
||||
声明
|
||||
</Button>}
|
||||
</Popover>
|
||||
)}
|
||||
|
||||
<div className="ant-divider ant-divider-horizontal"> </div>
|
||||
|
||||
|
||||
{
|
||||
claimerdata&&claimerdata.length>0?(
|
||||
{claimerData && claimerData.length > 0 ? (
|
||||
<div>
|
||||
<div className="mt15">
|
||||
<span>声明要关注/解决此疑修的用户</span>
|
||||
<span className="infoCount">{claimerdata.length}</span>
|
||||
<span className="infoCount">{claimerData.length}</span>
|
||||
</div>
|
||||
<div className="attrPerson" onMouseLeave={()=>this.setVisibleFunc(false)}>
|
||||
{claimerdata.map((item,key)=>{
|
||||
<div
|
||||
className="attrPerson"
|
||||
onMouseLeave={() => this.setVisibleFunc(false)}
|
||||
>
|
||||
{claimerData.map((item, key) => {
|
||||
return (
|
||||
<Popover content={renderUser(item,key)} visible={item.visible} placement="top" overlayClassName="menuPanels">
|
||||
<Popover
|
||||
content={renderUser(item, key)}
|
||||
visible={item.visible}
|
||||
placemen
|
||||
t="top"
|
||||
overlayClassName="menuPanels"
|
||||
width={400}
|
||||
>
|
||||
<Link key={key} to={`/${item.user_login}`}>
|
||||
<img src={getImageUrl(`/${item.user_picture}`)} alt="" onMouseOver={()=>this.setVisibleFunc(true,key)}/>
|
||||
<img
|
||||
src={getImageUrl(`/${item.user_picture}`)}
|
||||
alt=""
|
||||
onMouseOver={() => this.setVisibleFunc(true, key)}
|
||||
/>
|
||||
</Link>
|
||||
</Popover>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>):(
|
||||
<div className='mt15'>
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt15">
|
||||
<span>声明要关注/解决此疑修的用户</span>
|
||||
<span className="infoCount">0</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -147,6 +147,7 @@ class Infos extends Component {
|
|||
});
|
||||
const { pathname } = this.props.location;
|
||||
this.renderPath(pathname,result.data);
|
||||
document.title = result.data.username+'('+ username +')';
|
||||
})
|
||||
.catch((error) => {
|
||||
this.setState({
|
||||
|
|
|
@ -4,6 +4,7 @@ import { AlignCenter } from '../../Component/layout';
|
|||
import './Index.scss';
|
||||
import { locData } from '../../Utils/locData';
|
||||
import Axios from 'axios';
|
||||
import {Link} from "react-router-dom";
|
||||
|
||||
const { TextArea } = Input;
|
||||
export default Form.create()(
|
||||
|
@ -58,6 +59,7 @@ export default Form.create()(
|
|||
<Input placeholder="请输入您的邮箱账号" disabled style={{width:"400px"}}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Link className='gotoUpdateEmail mr30' to='/settings/emails'><i className='iconfont icon-bianji1 font-15 mr5'></i>更改邮箱</Link>
|
||||
<Form.Item label="">
|
||||
{getFieldDecorator("show_email",{
|
||||
rules:[],
|
||||
|
|
|
@ -17,20 +17,29 @@ function Index(props){
|
|||
setKey("0");
|
||||
}else{
|
||||
setKey("1");
|
||||
switch(pathname){
|
||||
case '/settings/emails':
|
||||
setType('0');
|
||||
break;
|
||||
case '/settings/password':
|
||||
setType('1');
|
||||
break;
|
||||
default:
|
||||
setType('2');
|
||||
}
|
||||
}
|
||||
}
|
||||
},[pathname])
|
||||
|
||||
|
||||
return(
|
||||
<div className="notice01">
|
||||
<div className="sshHead personalInfo mb20">
|
||||
{key === "0" ? <Menu mode={'horizontal'} className="infosRightMenu">
|
||||
<Menu.Item key="0" className="font-16">基本资料</Menu.Item>
|
||||
</Menu> : <Menu mode={'horizontal'} className="infosRightMenu" selectedKeys={type} onClick={(e)=>{setType(e.key)}}>
|
||||
<Menu.Item key="0" className="font-16">邮箱管理</Menu.Item>
|
||||
<Menu.Item key="1" className="font-16">密码管理</Menu.Item>
|
||||
<Menu.Item key="2" className="font-16">账号注销</Menu.Item>
|
||||
</Menu> : <Menu mode={'horizontal'} className="infosRightMenu" selectedKeys={type}>
|
||||
<Menu.Item key="0" className="font-16" onClick={()=>{props.history.push('/settings/emails')}}>邮箱管理</Menu.Item>
|
||||
<Menu.Item key="1" className="font-16" onClick={()=>{props.history.push('/settings/password')}}>密码管理</Menu.Item>
|
||||
<Menu.Item key="2" className="font-16" onClick={()=>{props.history.push('/settings/cancel')}}>账号注销</Menu.Item>
|
||||
</Menu>}
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -165,3 +165,6 @@
|
|||
color: #1140ff;
|
||||
}
|
||||
}
|
||||
.gotoUpdateEmail{
|
||||
line-height: 40px;
|
||||
}
|
|
@ -48,7 +48,7 @@ function TopEdition({register,current_user}) {
|
|||
return(
|
||||
<div className={`regform`}>
|
||||
{/* style={{backgroundImage:`url(${getImageUrl(i.image)})`}} */}
|
||||
<div onClick={()=>{if(k === 3){window.location.href="https://forum.gitlink.org.cn/forums/7653/detail"}}} style={{cursor: k === 3 ? 'pointer' : ''}}>
|
||||
<div onClick={()=>{if(i.url){window.location.href=i.url}}} style={{cursor: i.url ? 'pointer' : ''}}>
|
||||
<img src={getImageUrl(i.image)} alt="" height="100%"/>
|
||||
{
|
||||
k +1 === bannerList.length && (!(current_user && current_user.login)) ?
|
||||
|
|
|
@ -99,7 +99,7 @@ li {
|
|||
|
||||
pre.prettyprint {
|
||||
border: 0px solid transparent;
|
||||
padding: 10px;
|
||||
padding: 10px 38px;
|
||||
}
|
||||
|
||||
.-flex-basic0 {
|
||||
|
|
|
@ -518,7 +518,7 @@ class LoginDialog extends Component {
|
|||
}
|
||||
value={this.state.loginValue}
|
||||
name="username"
|
||||
placeholder="请输入邮箱地址/用户名" ></input>
|
||||
placeholder="请输入手机号/邮箱/用户名" ></input>
|
||||
|
||||
<div style={{ height: '25px' }}><p className="color-orange edu-txt-left none" id="username_error_notice"
|
||||
style={{ display: Phonenumberisnotco === undefined ? 'none' : 'block' }}>{Phonenumberisnotco}</p></div>
|
||||
|
|
|
@ -15,13 +15,14 @@ function Login(props){
|
|||
|
||||
useEffect(()=>{
|
||||
//控制密码输入框在DOM不可见value
|
||||
clear;
|
||||
clear();
|
||||
//获取第三方登录平台信息
|
||||
setSetting(JSON.parse(localStorage.getItem("chromesetting")));
|
||||
},[])
|
||||
|
||||
// 登录表单提交
|
||||
function handleSubmit(){
|
||||
setMessage(undefined);
|
||||
form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
axios.post(`/accounts/login.json`, {
|
||||
|
@ -46,12 +47,6 @@ function Login(props){
|
|||
});
|
||||
}
|
||||
|
||||
//校验用户名
|
||||
function comfirmWrite(rule, value, callback, index){
|
||||
setMessage(undefined);
|
||||
value ? callback():index === 1? callback("请输入邮箱地址或用户名登录"):callback("请输入登录密码");
|
||||
}
|
||||
|
||||
//清除密码框的value属性->DOM看不见密码值
|
||||
function clear(){
|
||||
const password = document.getElementById("login_password");
|
||||
|
@ -65,28 +60,30 @@ function Login(props){
|
|||
return(
|
||||
<div>
|
||||
<div className="right_cont login_content">
|
||||
<div className="login_register_head">
|
||||
<div className="login_register_head mb30">
|
||||
<span>欢迎登录 GitLink</span>
|
||||
<span className="link_span">没有账号?<Link to={`/register`}>去注册</Link></span>
|
||||
</div>
|
||||
<p className = {message?"message active":"message"}>{message}</p>
|
||||
<p className = {message?"message active mb10":"message"}>{message}</p>
|
||||
<Form className="login-form">
|
||||
<Form.Item>
|
||||
{getFieldDecorator('username',{
|
||||
rules:[
|
||||
{
|
||||
validator: (rule, value, callback) => { comfirmWrite(rule, value, callback, 1) }
|
||||
required:true,
|
||||
message:"请输入手机号/邮箱/用户名"
|
||||
}
|
||||
],
|
||||
validateTrigger:"onBlur",
|
||||
})(<Input className="account" placeholder="请输入邮箱地址/用户名"/>)}
|
||||
})(<Input className="account" placeholder="请输入手机号/邮箱/用户名"/>)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator('password', {
|
||||
rules: [
|
||||
{
|
||||
validator: (rule, value, callback) => { comfirmWrite(rule, value, callback, 2) }
|
||||
required:true,
|
||||
message:"请输入登录密码"
|
||||
}
|
||||
],
|
||||
validateTrigger:"onBlur",
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
padding: 2.5em 5em;
|
||||
border-radius: 7px;
|
||||
font-size: 15px;
|
||||
& .login_register_head{
|
||||
.login_register_head{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
@ -89,17 +89,15 @@
|
|||
line-height: 1.5;
|
||||
}
|
||||
//注册页面的获取验证码输入框
|
||||
& .ant-input{width: 18rem; }
|
||||
.ant-input{width: 18rem; }
|
||||
}
|
||||
//第一个输入框
|
||||
& .account{margin-top: 4vh; }
|
||||
//所有的链接
|
||||
& a{
|
||||
.link_span a{
|
||||
color: #466AFF;
|
||||
&:hover{opacity:0.8; }
|
||||
}
|
||||
//登录 注册 重置密码并登录按钮
|
||||
& .login_register_cofBut{
|
||||
.login_register_cofBut{
|
||||
font-size: 1em;
|
||||
width: 100%;
|
||||
height: 3.1em;
|
||||
|
@ -128,28 +126,25 @@
|
|||
border-color: #d9d9d9;
|
||||
}
|
||||
//输入密码提示框
|
||||
& .password_tips{
|
||||
.password_tips{
|
||||
margin-top: -10px;
|
||||
padding-bottom: 8px;
|
||||
color: #808080;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
& .message, .ant-form-explain{
|
||||
.message, .ant-form-explain{
|
||||
color: #D40000;
|
||||
font-size: 13px;
|
||||
}
|
||||
& .message.active{
|
||||
margin-bottom: -30px !important;
|
||||
}
|
||||
//antd 输入框样式
|
||||
& .ant-input{
|
||||
.ant-input{
|
||||
height: 3.1em;
|
||||
background-color: #F7F7F7 !important;
|
||||
font-size: 1em;
|
||||
color: #333333;
|
||||
&:hover{border-color:#466AFF; }
|
||||
}
|
||||
& .ant-form-explain{
|
||||
.ant-form-explain{
|
||||
margin-top: 0.5vh;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
@ -181,20 +176,20 @@
|
|||
top: 18vh;
|
||||
background-image: url(./img/loginBg.png);
|
||||
//下次自动登录&&忘记密码
|
||||
& .login_register_head.login{
|
||||
.login_register_head.login{
|
||||
.ant-form-item{
|
||||
margin-bottom: 0;
|
||||
margin-top: -1vh;
|
||||
}
|
||||
}
|
||||
//第三方登录
|
||||
& .quick_logon{
|
||||
.quick_logon{
|
||||
text-align: center;
|
||||
& .quick_logon_p{
|
||||
.quick_logon_p{
|
||||
border-top: 1px solid #979797;
|
||||
margin-top: 24px;
|
||||
}
|
||||
& .startlogin{
|
||||
.startlogin{
|
||||
position: relative;
|
||||
background: #dee1f4;
|
||||
display: block;
|
||||
|
@ -211,10 +206,13 @@
|
|||
.Register_content{
|
||||
// top: 8em;
|
||||
background-image: url(./img/registerBg.png);
|
||||
& .register_last_form .ant-form-item-control{
|
||||
.register_last_form .ant-form-item-control{
|
||||
line-height: 0.5;
|
||||
}
|
||||
& .login_register_cofBut{margin-top: 0.5vh; }
|
||||
.login_register_cofBut{margin-top: 0.5vh; }
|
||||
.message.active{
|
||||
margin: -5px 0 10px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
//找回密码框样式
|
||||
|
@ -222,12 +220,21 @@
|
|||
// top: 12vh;
|
||||
background-image: url(./img/resetPasswordBg.png);
|
||||
// height: 550px;
|
||||
& .resetFailCaptcha{
|
||||
.resetFailCaptcha{
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
color: #D40000;
|
||||
font-size: 13px;
|
||||
}
|
||||
& .login_register_cofBut{margin-top: 1.5vh; }
|
||||
.login_register_cofBut{margin-top: 1.5vh; }
|
||||
}
|
||||
}
|
||||
|
||||
.registerNav{
|
||||
.type{color: #000;}
|
||||
.activeRegisterNav{
|
||||
color: $primary-color;
|
||||
display: inline-block;
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ import './LoginRegisterPage.scss';
|
|||
|
||||
function Register(props){
|
||||
const {form} = props;
|
||||
const {getFieldDecorator } = form;
|
||||
const {getFieldDecorator, setFieldsValue } = form;
|
||||
//用户输入的符合规则的邮箱(用于获取验证码)
|
||||
const [emailStr, setEmailStr] = useState(undefined);
|
||||
//用户输入的符合规则的用户名,用于当用户输入符合规则的用户名之后再更改又去触发check.json接口
|
||||
|
@ -20,10 +20,12 @@ function Register(props){
|
|||
//用于表单提交时会再次校验数据
|
||||
const [userNameGo, setUserNameGo] = useState(true);
|
||||
const [emailGo, setEmailGo] = useState(true);
|
||||
// 注册类型(手机号/邮箱)
|
||||
const [registerType, setRegisterType] = useState(0);
|
||||
const seconds = useRef();
|
||||
let interval = undefined;
|
||||
//页面加载完自动聚焦到第一个输入框
|
||||
const inputEl = useRef(null);
|
||||
// const inputEl = useRef(null);
|
||||
|
||||
//注册表单提交
|
||||
function handleSubmit(){
|
||||
|
@ -70,23 +72,33 @@ function Register(props){
|
|||
}):callback();setLoginStr(undefined);
|
||||
}
|
||||
|
||||
//判断邮箱是否注册
|
||||
//判断邮箱/手机号是否符合规范、是否注册
|
||||
function emailConfirm(rule, value, callback) {
|
||||
if(value){
|
||||
if((/^([1][3456789])\d{9}$/.test(value) && !registerType) || (/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value) && registerType)){
|
||||
setEmailGo(true);
|
||||
value && (emailGo || value !== emailStr) ? axios.post(`/accounts/check.json`, {
|
||||
value: value,
|
||||
type: 2
|
||||
(emailGo || value !== emailStr) ? axios.get(`/accounts/valid_email_and_phone.json`, {
|
||||
params: {
|
||||
login: value,
|
||||
type: 1
|
||||
}
|
||||
}).then(response => {
|
||||
if (response.data.status === -1) {
|
||||
setGetCaptchaBut(false);
|
||||
callback(response.data.message);
|
||||
} else {
|
||||
if(!response.data.status){
|
||||
setEmailStr(value);
|
||||
setGetCaptchaBut(true);
|
||||
setEmailGo(false);
|
||||
callback();
|
||||
}else{
|
||||
setGetCaptchaBut(false);
|
||||
callback(response.data.status === -2 ? `该${registerType ? '邮箱' : '手机号'}已被注册` : response.data.message);
|
||||
}
|
||||
}):callback();setEmailStr(undefined);
|
||||
}else{
|
||||
callback(`请输入正确的${registerType ? '邮箱地址' : '手机号'}`);
|
||||
}
|
||||
}else{
|
||||
callback(`请输入${registerType ? '邮箱地址' : '手机号'}`);
|
||||
}
|
||||
}
|
||||
|
||||
//确认密码
|
||||
|
@ -163,7 +175,7 @@ function Register(props){
|
|||
if (response.data && response.data.status === 0) {
|
||||
//验证码发送成功
|
||||
let email = emailStr.substring(emailStr.indexOf("@")+1);
|
||||
message.success({content:<span>验证码已发送,请注意查收。<a href={`https://mail.${email}`} target="_blank">前往邮箱</a></span>});
|
||||
message.success({content:<span>验证码已发送,请注意查收。{registerType ? <a href={`https://mail.${email}`} target="_blank">前往邮箱</a> : ''}</span>});
|
||||
} else {
|
||||
//验证码发送失败,获取验证码按钮变灰并且文案变回【获取验证码】
|
||||
setGetCaptchaBut(false);
|
||||
|
@ -192,17 +204,27 @@ function Register(props){
|
|||
}
|
||||
|
||||
useEffect(() => {
|
||||
inputEl.current.focus();
|
||||
clear;
|
||||
// inputEl.current.focus();
|
||||
// clear;
|
||||
}, [])
|
||||
|
||||
function changeRegisterType(type){
|
||||
setGetCaptchaBut(false);
|
||||
setRegisterType(type);
|
||||
setFieldsValue({'email': undefined})
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<div className="right_cont Register_content">
|
||||
<div className="login_register_head">
|
||||
<div className="login_register_head mb30">
|
||||
<span>欢迎注册 GitLink</span>
|
||||
<span className="link_span">已有账号,<Link to={`/login`}>立即登录</Link></span>
|
||||
</div>
|
||||
<div className="registerNav mb20 font-18">
|
||||
<a className={`type ${registerType ? '' : 'activeRegisterNav'}`} onClick={()=>{changeRegisterType(0)}}>手机号注册</a>
|
||||
<a className={`type ${registerType ? 'activeRegisterNav' : ''} ml50`} onClick={()=>{changeRegisterType(1)}}>邮箱注册</a>
|
||||
</div>
|
||||
<p className={mess ? "message active" : "message"}>{mess}</p>
|
||||
<Form className="login-form">
|
||||
<Form.Item>
|
||||
|
@ -231,29 +253,21 @@ function Register(props){
|
|||
],
|
||||
validateTrigger:"onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input ref={inputEl} className="account" placeholder="请输入4-15位用户名,以字母开头,只能使用字母和数字" readOnly onFocus={()=>{document.getElementById("register_register_username").removeAttribute("readOnly")}}/>)}
|
||||
// ref={inputEl}
|
||||
})(<Input placeholder="请输入4-15位用户名,以字母开头,只能使用字母和数字" autoComplete="off"/>)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator('email',{
|
||||
rules:[
|
||||
{
|
||||
type: 'email',
|
||||
message: '请输入正确的邮箱格式',
|
||||
},
|
||||
{
|
||||
required:true,
|
||||
message:"请输入邮箱地址"
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => { emailConfirm(rule, value, callback) }
|
||||
}
|
||||
],
|
||||
validateTrigger:"onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input className="email" placeholder="请输入邮箱地址" readOnly onFocus={()=>{document.getElementById("register_email").removeAttribute("readOnly")}} />)}
|
||||
})(<Input className="email" placeholder={`请输入${registerType ? '邮箱地址' : '手机号'}`} autoComplete="off"/>)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item>
|
||||
<div className="login_register_head">
|
||||
{getFieldDecorator('captcha', {
|
||||
|
@ -263,7 +277,7 @@ function Register(props){
|
|||
}],
|
||||
validateTrigger: "onBlur",
|
||||
})(
|
||||
<Input className="captcha" placeholder="请输入验证码" readOnly onFocus={()=>{document.getElementById("register_captcha").removeAttribute("readOnly")}} />
|
||||
<Input className="captcha" placeholder="请输入验证码" autoComplete="off"/>
|
||||
)}
|
||||
<Button className={getCaptchaBut ? 'codeBut':'codeBut disable'} disabled={!getCaptchaBut} onClick={getCaptcha}>{getCaptchaBut || (!getCaptchaBut && !countDown)?"获取验证码":`重发(${secondsStr}s)`}</Button>
|
||||
</div>
|
||||
|
@ -281,7 +295,7 @@ function Register(props){
|
|||
],
|
||||
validateTrigger:"onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input.Password className="register_psd" placeholder="请输入登录密码" onBlur={clear} onChange={clear} readOnly onFocus={()=>{document.getElementById("register_register_psd").removeAttribute("readOnly")}}/>)}
|
||||
})(<Input.Password className="register_psd" placeholder="请输入登录密码" onBlur={clear} onChange={clear} autoComplete="new-password"/>)}
|
||||
</Form.Item>
|
||||
<span className="password_tips" style={{display:tipVisable?"none":"block"}}>请输入8-16位密码,区分大小写、不能使用空格</span>
|
||||
|
||||
|
@ -298,10 +312,9 @@ function Register(props){
|
|||
],
|
||||
validateTrigger: "onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input.Password className="psdComfirm" placeholder="请确认登录密码" onBlur={clear} onChange={clear} readOnly onFocus={()=>{document.getElementById("register_psdComfirm").removeAttribute("readOnly")}}/>)}
|
||||
})(<Input.Password className="psdComfirm" placeholder="请确认登录密码" onBlur={clear} onChange={clear} autoComplete="new-password"/>)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item className="register_last_form">
|
||||
{getFieldDecorator('agreement', {
|
||||
valuePropName: 'checked',
|
||||
|
@ -311,7 +324,7 @@ function Register(props){
|
|||
validator: (rule, value, callback) => { comfirmRead(rule, value, callback) }
|
||||
}
|
||||
],
|
||||
})(<Checkbox>我已阅读并接受<a className="login-form-forgot" href="https://forum.trustie.net/forums/5029/detail" target="_blank">《GitLink服务协议条款》</a></Checkbox>)}
|
||||
})(<Checkbox className="link_span">我已阅读并接受<a className="login-form-forgot" href="https://forum.trustie.net/forums/5029/detail" target="_blank">《GitLink服务协议条款》</a></Checkbox>)}
|
||||
</Form.Item>
|
||||
<Button type="primary" htmlType="submit" className="login_register_cofBut" onClick={handleSubmit}>注册</Button>
|
||||
</Form>
|
||||
|
|
|
@ -56,23 +56,34 @@ function ResetPassword(props) {
|
|||
});
|
||||
}
|
||||
|
||||
//判断邮箱是否注册
|
||||
//判断邮箱/手机号是否符合规范、是否注册
|
||||
function emailConfirm(rule, value, callback) {
|
||||
if(/^([1][3456789])\d{9}$/.test(value) || /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value)){
|
||||
setEmailGo(true);
|
||||
value && (emailGo || value !== emailStr) ? axios.post(`/accounts/check.json`, {
|
||||
value: value,
|
||||
if(value && (emailGo || value !== emailStr)){
|
||||
axios.get(`/accounts/valid_email_and_phone.json`, {
|
||||
params: {
|
||||
login: value,
|
||||
type: 2
|
||||
}
|
||||
}).then(response => {
|
||||
if (response.data && response.data.status === -1) {
|
||||
if (response.data && !response.data.status) {
|
||||
setEmailStr(value);
|
||||
setGetCaptchaBut(true);
|
||||
setEmailGo(false);
|
||||
callback();
|
||||
} else {
|
||||
setGetCaptchaBut(false);
|
||||
callback('此邮箱未注册');
|
||||
callback('此手机号/邮箱未注册');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
setEmailStr(undefined);
|
||||
}else{
|
||||
callback("请输入正确的手机号/邮箱")
|
||||
}
|
||||
}):callback();setEmailStr(undefined);
|
||||
}
|
||||
|
||||
//确认密码
|
||||
|
@ -140,7 +151,7 @@ function ResetPassword(props) {
|
|||
if (response.data && response.data.status === 0) {
|
||||
//验证码发送成功
|
||||
let email = emailStr.substring(emailStr.indexOf("@")+1);
|
||||
message.success({content:<span>验证码已发送,请注意查收。<a href={`https://mail.${email}`} target="_blank">前往邮箱</a></span>});
|
||||
message.success({content:<span>验证码已发送,请注意查收。{emailStr.indexOf("@") === -1 ? '' : <a href={`https://mail.${email}`} target="_blank">前往邮箱</a>}</span>});
|
||||
} else {
|
||||
//验证码发送失败,获取验证码按钮变灰并且文案变回【获取验证码】
|
||||
setGetCaptchaBut(false);
|
||||
|
@ -170,13 +181,12 @@ function ResetPassword(props) {
|
|||
|
||||
useEffect(() => {
|
||||
inputEl.current.focus();
|
||||
clear;
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="right_cont ResetPassword_content">
|
||||
<div className="login_register_head">
|
||||
<div className="login_register_head mb30">
|
||||
<span>找回密码</span>
|
||||
<span className="link_span">已有账号,<Link to={`/login`}>立即登录</Link></span>
|
||||
</div>
|
||||
|
@ -185,13 +195,9 @@ function ResetPassword(props) {
|
|||
<Form.Item>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [
|
||||
{
|
||||
type: 'email',
|
||||
message: '请输入正确的邮箱格式',
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
message: "请输入已注册的邮箱"
|
||||
message: "请输入已注册的手机号/邮箱"
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => { emailConfirm(rule, value, callback) }
|
||||
|
@ -199,10 +205,9 @@ function ResetPassword(props) {
|
|||
],
|
||||
validateTrigger: "onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input ref={inputEl} className="account" placeholder="请输入已注册的邮箱" readOnly onFocus={()=>{document.getElementById("resetPassword_email").removeAttribute("readOnly")}} />)}
|
||||
})(<Input ref={inputEl} className="account" placeholder="请输入已注册的手机号/邮箱" autoComplete="off"/>)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item>
|
||||
<div className="login_register_head">
|
||||
{getFieldDecorator('captcha', {
|
||||
|
@ -212,7 +217,7 @@ function ResetPassword(props) {
|
|||
}],
|
||||
validateTrigger: "onBlur",
|
||||
})(
|
||||
<Input className="captcha" placeholder="请输入验证码" readOnly onFocus={()=>{document.getElementById("resetPassword_captcha").removeAttribute("readOnly")}} />
|
||||
<Input className="captcha" placeholder="请输入验证码" autoComplete="off"/>
|
||||
)}
|
||||
<Button className={getCaptchaBut ? 'codeBut':'codeBut disable'} disabled={!getCaptchaBut} onClick={getCaptcha}>{getCaptchaBut || (!getCaptchaBut && !countDown)?"获取验证码":`重发(${secondsStr}s)`}</Button>
|
||||
</div>
|
||||
|
@ -230,7 +235,7 @@ function ResetPassword(props) {
|
|||
],
|
||||
validateTrigger: "onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input.Password className="psd" placeholder="请输入新密码" onBlur={clear} onChange={clear} readOnly onFocus={()=>{document.getElementById("resetPassword_psd").removeAttribute("readOnly")}} />)}
|
||||
})(<Input.Password className="psd" placeholder="请输入新密码" onBlur={clear} onChange={clear} autoComplete="new-password"/>)}
|
||||
</Form.Item>
|
||||
<span className="password_tips" style={{display:tipVisable?"none":"block"}}>请输入8-16位密码,区分大小写、不能使用空格</span>
|
||||
|
||||
|
@ -247,7 +252,7 @@ function ResetPassword(props) {
|
|||
],
|
||||
validateTrigger: "onBlur",
|
||||
validateFirst: true,
|
||||
})(<Input.Password className="psdComfirm" placeholder="请确认新密码" onBlur={clear} onChange={clear} readOnly onFocus={()=>{document.getElementById("resetPassword_psdComfirm").removeAttribute("readOnly")}} />)}
|
||||
})(<Input.Password className="psdComfirm" placeholder="请确认新密码" onBlur={clear} onChange={clear} autoComplete="new-password"/>)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
|
|
|
@ -106,7 +106,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV
|
|||
let react_id = `react_${id}`;
|
||||
const __that = window[react_id]
|
||||
// Using "||" set icons align right.
|
||||
const icons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "line-break", "watch", "clear"];
|
||||
const icons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "line-break", "watch", "clear","fullscreen"];
|
||||
// 试卷处用到的填空题新增按钮
|
||||
if (__that.props.showNullButton) {
|
||||
icons.push('nullBtton')
|
||||
|
@ -313,7 +313,7 @@ export default class TPMMDEditor extends Component {
|
|||
}
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className={`df ${className} ${imageExpand && 'editormd-image-click-expand'}`} >
|
||||
<div className={`df editormd-editing ${className} ${imageExpand && 'editormd-image-click-expand'}`} >
|
||||
{/* padding10-20 */}
|
||||
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{ ..._style }}>
|
||||
<textarea style={{ display: 'none' }} id={`mdEditors_${mdID}`} name="content"></textarea>
|
||||
|
|
|
@ -9,7 +9,7 @@ import 'codemirror/lib/codemirror.css';
|
|||
import './css/newquestion.css';
|
||||
const $ = window.$
|
||||
|
||||
const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear"];
|
||||
const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear","fullscreen"];
|
||||
|
||||
const NULL_CH = '▁';
|
||||
|
||||
|
@ -289,7 +289,8 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
setEditorInstance(this)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('editor_instance');
|
||||
console.log(editor_instance);
|
||||
|
||||
}, [containerId, editorInstance, startInit])
|
||||
|
||||
|
@ -566,7 +567,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
return (
|
||||
<Fragment>
|
||||
{atWhoVisible && atWhoList}
|
||||
<div ref={editorEl} className={`df ${className} ${imageExpand && 'editormd-image-click-expand'} `}>
|
||||
<div ref={editorEl} className={`df editormd-editing ${className} ${imageExpand && 'editormd-image-click-expand'} `}>
|
||||
<div className={`edu-back-greyf5 radius4 editormd ${error ? 'error' : ''}`} id={containerId} >
|
||||
<textarea style={{ display: 'none' }} id={editorBodyId} name="content"></textarea>
|
||||
<div className="CodeMirror cm-s-defualt"></div>
|
||||
|
|
Loading…
Reference in New Issue