Commit 866a75f6 by hanjixin

Merge branch 'develop' of gitlab.maxrocky.com:hanjixin/MeteorologicalBureau

parents 0339d798 6fd2d9d3
module.exports = {
API_URL: '//123.57.209.57:8091',
CTR_URL: '//127.0.01:8900'
API_URL: 'http://123.57.209.57:8091',
CTR_URL: 'http://172.16.1.249:8900'
// CTR_URL: 'http://127.0.0.1:8900'
}
\ No newline at end of file
module.exports = {
API_URL: 'test'
API_URL: 'http://123.57.209.57:8091',
CTR_URL: 'http://172.16.1.249:8900'
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ function RouterConfig({ history }) {
location.query = JSON.parse(sessionStorage.getItem('query'))
}
}
// checkState(history)
checkState(history)
})
//console.log(generateRouter(config), 'generateRouter(config)}') // 生成的路由表
......
......@@ -3,12 +3,15 @@ import { connect } from 'dva';
import styles from './IndexPage.less';
import { send } from '@/services/ctr'
console.log(styles)
function IndexPage(props) {
send('/待机', []).then(res => {
function IndexPage(props) {
send('/待机', []).then(res => {
console.log(res)
})
return (
<div className="content" onClick={() => { props.history.push('/home')}}>
<div className="content" onClick={() => {
send('/首页', [])
props.history.push('/home')
}}>
<span className="title">国家预警信息发布中心</span>
</div>
);
......
......@@ -5,7 +5,7 @@ import Layout from '@/components/Layout.js'
import { send } from '@/services/ctr'
function IntroductionWarning(props) {
send('/首页/动画脚本')
send('/首页/动画脚本',[])
return (
<Layout>
<div className="warmingCenter-content animated fadeIn">
......
......@@ -10,22 +10,24 @@ function WarmingCenter(props) {
<div className="warmingCenter-content animated fadeIn">
<div className="common-btn-container">
<div className="common-btn one" onClick={() => {
send('/首页/全国/全国公服建设/信息员', [])
send('/首页/全国/全国公服建设/信息员', [])
}}>
信息员
</div>
<div className="common-btn one" onClick={() => {
send('/首页/全国/全国公服建设/应急责任人', [])
}}>
应急责任人
<div className="common-btn one" onClick={() => {
send('/首页/全国/全国公服建设/应急责任人', [])
}}>
应急责任人
</div>
<div className="common-btn one" onClick={() => {
send('/首页/全国/全国公服建设/预警工作人员', [])
}}>
预警工作人员
<div className="common-btn one" onClick={() => {
send('/首页/全国/全国公服建设/预警工作人员', [])
}}>
预警工作人员
</div>
</div>
<div className="common-btn-back" onClick={() => {
props.history.go(-1)
}}></div>
</div>
</Layout>
);
......
import request from '../utils/request';
export function send(path, agr) {
console.log(path, 'path', window.sessionStorage.getItem('isUse'))
window.sessionStorage.setItem('sendObj', JSON.stringify({path, agr}))
if(window.sessionStorage.getItem('isUse')) {
console.log('取消发送')
......
......@@ -36,11 +36,11 @@ export function checkState(history) { // 璉頝舐 銝之撅
let data = JSON.parse(res.data.data)
let sendObj = window.sessionStorage.getItem('sendObj');
sendObj ? sendObj = JSON.parse(sendObj) : (sendObj = {})
console.log(data, sendObj)
window.sessionStorage.setItem('isUse', 'true')
// console.log(data, sendObj)
// window.sessionStorage.setItem('isUse', 'true')
if (data.route === sendObj.path) {
console.log('路由重复')
window.sessionStorage.setItem('isUse', 'true')
// window.sessionStorage.setItem('isUse', 'true')
} else {
const result = filterRouter(data.route)
window.sessionStorage.removeItem('isUse')
......@@ -49,5 +49,5 @@ export function checkState(history) { // 璉頝舐 銝之撅
}
}
})
}, 1000)
}, 500)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment