逻辑修改

This commit is contained in:
dinglink 2020-03-24 18:05:54 +08:00
parent f87c60d2ef
commit de722c7164
3 changed files with 21 additions and 13 deletions

View File

@ -39,7 +39,7 @@ if (isDev) {
} }
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || ''
} }
// 超管 // 超管
// debugType="admin"; // debugType="admin";
@ -126,10 +126,11 @@ export function initAxiosInterceptors(props) {
// https://github.com/axios/axios/issues/1497 // https://github.com/axios/axios/issues/1497
// TODO 读取到package.json中的配置 // TODO 读取到package.json中的配置
var //proxy = "http://localhost:3000" var //proxy = "http://localhost:3000"
proxy="https://testforgeplus.trustie.net" proxy="https://testforgeplus.trustie.net/"
// proxy="http://localhost:3000" // proxy="http://localhost:3000"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制 // 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
@ -225,7 +226,7 @@ export function initAxiosInterceptors(props) {
// let timestamp=railsgettimes(proxy); // let timestamp=railsgettimes(proxy);
// console.log(timestamp) // console.log(timestamp)
// `https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp` // `https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`
// railsgettimes( `${proxy}/api/main/first_stamp.json`); railsgettimes( `${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp) let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`; config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) { if (config.url.indexOf('?') == -1) {
@ -237,7 +238,7 @@ export function initAxiosInterceptors(props) {
// 加api前缀 // 加api前缀
// railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); // railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`);
// railsgettimes( `/api/main/first_stamp.json`); railsgettimes( `/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp) let newopens=md5(opens+timestamp)
config.url = url; config.url = url;
if (config.url.indexOf('?') == -1) { if (config.url.indexOf('?') == -1) {

View File

@ -166,7 +166,6 @@ class merge extends Component{
if(type===1){ if(type===1){
this.setState({ this.setState({
status_type:'1', status_type:'1',
openselect:current_user.user_id,
closeselect:undefined, closeselect:undefined,
issue_tag_ids:'标签', issue_tag_ids:'标签',
fixed_version_ids:'里程碑', fixed_version_ids:'里程碑',
@ -179,7 +178,6 @@ class merge extends Component{
this.setState({ this.setState({
status_type:'2', status_type:'2',
openselect:undefined, openselect:undefined,
closeselect:current_user.user_id,
issue_tag_ids:'标签', issue_tag_ids:'标签',
fixed_version_ids:'里程碑', fixed_version_ids:'里程碑',
assigned_to_ids:'指派人', assigned_to_ids:'指派人',

View File

@ -222,7 +222,6 @@ class order extends Component{
if(type===1){ if(type===1){
this.setState({ this.setState({
status_type:'1', status_type:'1',
openselect:current_user.user_id,
closeselect:undefined, closeselect:undefined,
issue_tag_ids:'标签', issue_tag_ids:'标签',
tracker_ids:'所有分类', tracker_ids:'所有分类',
@ -238,7 +237,6 @@ class order extends Component{
this.setState({ this.setState({
status_type:'2', status_type:'2',
openselect:undefined, openselect:undefined,
closeselect:current_user.user_id,
issue_tag_ids:'标签', issue_tag_ids:'标签',
tracker_ids:'所有分类', tracker_ids:'所有分类',
author_ids:'发布人', author_ids:'发布人',
@ -257,11 +255,19 @@ class order extends Component{
// 筛选:全部、指派给我、由我创建 // 筛选:全部、指派给我、由我创建
ChangeAssign=(type)=>{ ChangeAssign=(type)=>{
const { limit, search,status_type} = this.state; const { limit, search,status_type} = this.state;
const { current_user } = this.props;
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
if(type){ if(type){
const { current_user } = this.props; if(current_user===undefined){
this.setState({
isSpin:false
})
alert("请登录后查看")
return;
}
if(type===1){ if(type===1){
this.setState({ this.setState({
page:1, page:1,
@ -310,6 +316,8 @@ class order extends Component{
} }
render(){ render(){
const { current_user } = this.props;
const { issue_chosen , issues , limit , page , search_count , data , assigned_to_id , author_id , isSpin,openselect,closeselect } = this.state; const { issue_chosen , issues , limit , page , search_count , data , assigned_to_id , author_id , isSpin,openselect,closeselect } = this.state;
const { projectsId } = this.props.match.params; const { projectsId } = this.props.match.params;
@ -364,8 +372,9 @@ class order extends Component{
<div className="f-wrap-between mb20"> <div className="f-wrap-between mb20">
<ul className="topWrapper_type"> <ul className="topWrapper_type">
<li className={!author_id && !assigned_to_id ? "active":""} onClick={()=>this.ChangeAssign()}>全部</li> <li className={!author_id && !assigned_to_id ? "active":""} onClick={()=>this.ChangeAssign()}>全部</li>
<li className={assigned_to_id ? "active":""} onClick={()=>this.ChangeAssign(1)}>指派给我</li> {}
<li className={author_id ? "active":""} onClick={()=>this.ChangeAssign(2)}>由我创建</li> <li style={{display:current_user===undefined?'none':'flex'}} className={assigned_to_id ? "active":""} onClick={ ()=>this.ChangeAssign(1)}>指派给我</li>
<li style={{display:current_user===undefined?'none':'flex'}} className={author_id ? "active":""} onClick={()=>this.ChangeAssign(2)}>由我创建</li>
{/* <li>@我的</li> */} {/* <li>@我的</li> */}
</ul> </ul>
<ul className="topWrapper_select"> <ul className="topWrapper_select">