Merge pull request '密码管理+issue' (#327) from caishi/forgeplus-react:gitlink_server into gitlink_server

This commit is contained in:
xxq250 2021-12-20 17:50:23 +08:00
commit 9786aaa4fe
4 changed files with 52 additions and 37 deletions

View File

@ -303,7 +303,7 @@ class Detail extends Component {
<p className="grid-item-left pb15">
<span className="issue_detail_info">负责人:</span>
<span>
{data && data.assign_user_name ? data.assign_user_name : "--"}
{data && data.assign_user_name ? <Link to={`/${data.assign_user_login}`} className="color-blue">{data.assign_user_name}</Link> : "--"}
</span>
</p>
<p className="grid-item-left pb15">
@ -325,7 +325,7 @@ class Detail extends Component {
<p className="grid-item-left pb15">
<span className="issue_detail_info">里程碑:</span>
<span className="title_overflow">
{data && data.version ? data.version : "--"}
{data && data.version ? <Link to={`/${owner}/${projectsId}/milestones/${data.version_id}`} className="color-blue">{data.version}</Link> : "--"}
</span>
</p>
<p className="grid-item-left pb15">

View File

@ -248,16 +248,28 @@ class order extends Component {
});
const { status_type } = this.state;
this.state.select_params.search = value;
this.state.select_params.page = 1;
this.getIssueList(status_type);
this.setState({
select_params:{
search:value,
page:1
}
},()=>{
this.getIssueList(status_type);
})
};
openorder = (type) => {
this.setState({
const s = {
author_id: undefined,
assigned_to_id: undefined,
page:1,
limit:15
}
this.setState({
status_type: type,
select_params:s,
author_id: undefined,
assigned_to_id: undefined,
issue_tag_ids: "标记",
tracker_ids: "类型",
author_ids: "发布人",
@ -265,13 +277,12 @@ class order extends Component {
status_ids: "状态",
done_ratios: "完成度",
fixed_version_ids:"里程碑",
paix: "排序",
checkedValue:[],
all:undefined
all:undefined,
paix: "排序",
},()=>{
this.getIssueList(type);
});
this.state.select_params.page = 1;
this.state.select_params.limit = 15;
this.getIssueList(type);
};
// 筛选:全部、指派给我、由我创建

View File

@ -9,7 +9,7 @@ import '../../SecuritySetting/notice/manager/Index.scss';
function Index(props){
// const { username } = props && props.match && props.match.params;
const { pathname } = props && props.location;
// const { current_user } = props;
const { current_user } = props;
const [ key , setKey ] = useState("0");
@ -28,10 +28,10 @@ function Index(props){
return(
<div className="notice01">
<div className="sshHead">
<Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu">
<Menu.Item key="0"><Link to={`/settings/profile`}>基本资料</Link></Menu.Item>
<Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu" onClick={(e)=>setKey(e.key)}>
<Menu.Item key="0" className="font-16">基本资料</Menu.Item>
{/* <Menu.Item key="0"><Link to={`/settings/profile`}>基本资料</Link></Menu.Item> */}
{/* <Menu.Item key="1"><Link to={`/${username}/password`}>密码管理</Link></Menu.Item> */}
<Menu.Item key="1" className="font-16">密码管理</Menu.Item>
</Menu>
</div>
<div style={{padding:"20px"}}>

View File

@ -7,11 +7,10 @@ import Axios from 'axios';
export default Form.create()(
forwardRef((props)=>{
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
const { username } = props && props.match && props.match.params;
const { current_user} = props;
const [ oldPass , setOldPass ] = useState(undefined);
const [ oldPassRepeat , setOldPassRepeat ] = useState(undefined);
const [ NewPass , setNewPass ] = useState(undefined);
const [ NewPassRepeat , setNewPassRepeat ] = useState(undefined);
function submit() {
validateFields((error,values)=>{
@ -34,23 +33,29 @@ export default Form.create()(
}
//
var reg = /(?!.*\s)(?!^[\u4e00-\u9fa5]+$)^.{8,16}$/;
function checkIdentifier(rule, value, callback , inputValue){
if(!value){
callback();
}
if (value && !inputValue && !reg.test(value)) {
callback("请输入8-16位密码区分大小写、不能使用空格");
}
if (value && inputValue && value !== inputValue) {
callback("两次输入的密码不一致");
}
callback();
}
var reg = /(?!.*\s)(?!^[\u4e00-\u9fa5]+$)(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^.{8,16}$/;
function checkNewPass(rule, value, callback) {
function checkNewPass(rule, value, callback,newpassrepeat) {
if(!value){
callback();
}
if (!reg.test(value)) {
callback("8-16个字符,不包含空格,必须包含数字,字母或字符至少两种");
callback("请输入8-16位密码区分大小写、不能使用空格");
}
if(value && newpassrepeat && newpassrepeat!==value){
callback("两次输入的密码不一致");
}
callback();
}
@ -60,37 +65,36 @@ export default Form.create()(
<Form.Item label="旧密码">
{getFieldDecorator("old_password",{
rules:[
{required:true,message:"请输入旧密码"},
{validator:(rule, value, callback)=>checkIdentifier(rule, value, callback,oldPassRepeat)}
{required:true,message:"请输入旧密码"}
]
})(
<Input.Password placeholder="请输入旧密码" style={{width:"400px"}} onChange={(e)=>{setOldPass(e.target.value)}}/>
)}
</Form.Item>
<Form.Item label="重复旧密码">
{getFieldDecorator("old_password_repeat",{
rules:[
{required:true,message:"请重新输入旧密码"},
{validator:(rule, value, callback)=>checkIdentifier(rule, value, callback,oldPass)}
]
})(
<Input.Password placeholder="请重新输入旧密码" style={{width:"400px"}} onChange={(e)=>{setOldPassRepeat(e.target.value)}}/>
<Input.Password placeholder="请输入旧密码" autoComplete={"new-password"} style={{width:"400px"}}/>
)}
</Form.Item>
<Form.Item label="新密码">
{getFieldDecorator("password",{
rules:[
{required:true,message:"请输入新密码"},
{validator:checkNewPass}
{validator:(rule, value, callback)=>checkNewPass(rule, value, callback,NewPassRepeat)}
]
})(
<Input.Password placeholder="请输入新密码" style={{width:"400px"}}/>
<Input.Password placeholder="请输入新密码" style={{width:"400px"}} onChange={(e)=>{setNewPass(e.target.value)}}/>
)}
</Form.Item>
<Form.Item label="确认新密码">
{getFieldDecorator("new_password_repeat",{
rules:[
{required:true,message:"请重新输入新密码"},
{validator:(rule, value, callback)=>checkIdentifier(rule, value, callback,NewPass)}
]
})(
<Input.Password placeholder="请重新输入新密码" style={{width:"400px"}} onChange={(e)=>{setNewPassRepeat(e.target.value)}}/>
)}
</Form.Item>
<AlignCenter style={{marginTop:"20px"}}>
<span className="ant-form-item-label"></span>
<Button className="but25" type={"primary"} onClick={submit}>提交</Button>
<Button type={"default"} onClick={()=>props.history.push(`/${username}`)} className="ml20">取消</Button>
<Button type={"default"} onClick={()=>props.history.push(`/${current_user && current_user.login}`)} className="ml20">取消</Button>
</AlignCenter>
</Form>
)