Commit d5374fc2 by hank

视频数据

parent 6fd2d9d3
module.exports = {
API_URL: 'http://123.57.209.57:8091',
API_URL: 'http://123.56.149.208: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: 'http://123.57.209.57:8091',
API_URL: 'http://123.56.149.208/:8091',
CTR_URL: 'http://172.16.1.249:8900'
}
\ No newline at end of file
import React from 'react';
import React, { useState, useEffect } from 'react';
import { connect } from 'dva';
import './index.less';
import Layout from '@/components/Layout.js'
import { send } from '@/services/ctr'
import { getVideoList } from '@/services/api'
function CenterIntroduction(props) {
// send('/首页/信息中心/宣传视频', [])
const [videoList, setVideoList] = useState([])
useEffect(function() {
})
if(!videoList.length) {
getVideoList().then(res => {
console.log(res.data.list)
setVideoList(res.data.list)
})
}
return (
<Layout>
<div className="warmingCenter-content animated fadeIn">
<div className="common-btn-container">
{videoList.map((item, index) => {
return <div className="common-btn one" key={item.url} onClick={() => {
send('/首页/信息中心/宣传视频', [])
}}>
{item.title}
</div>
})}
<div className="common-btn one" onClick={() => {
send('/首页/信息中心/宣传视频', [])
}}>
视频1
</div>
</div>
......
......@@ -13,4 +13,14 @@ export function getChildrenInfo(parentCode) {
url: `/area/get/info/${parentCode}`,
method: 'get'
})
}
export function getVideoList() {
return request({
method: 'get',
url: '/interior/get/promotional/list',
params: {
p: 1,
c: 1000
}
})
}
\ No newline at end of file
......@@ -38,13 +38,14 @@ export function checkState(history) { // 检查路由状态 与大屏保持同
sendObj ? sendObj = JSON.parse(sendObj) : (sendObj = {})
// console.log(data, sendObj)
// window.sessionStorage.setItem('isUse', 'true')
if (data.route === sendObj.path) {
if (data.route === sendObj.path || (data.route === '/首页/全国/预警信息综合监控平台' && sendObj.path.indexOf('/首页/全国') !== -1)) {
console.log('路由重复')
// window.sessionStorage.setItem('isUse', 'true')
} else {
const result = filterRouter(data.route)
console.log(result, 'result', window.location.hash.replace('#', '') !== result.path)
window.sessionStorage.removeItem('isUse')
if (result) {
if (result && window.location.hash.replace('#', '') !== result.path) {
history.replace(result.path)
}
}
......
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