Browse Source

宣传视频数据保护

release_0.0.4^2
巴林闲侠 2 years ago
parent
commit
7bd8ad9634
  1. 18
      api/app/lib/controllers/data/project.js
  2. 4
      web/client/src/sections/quanju/containers/footer/build/index.js

18
api/app/lib/controllers/data/project.js

@ -3,14 +3,24 @@
async function projectGet (ctx) { async function projectGet (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { type } = ctx.query; const { type, entryName } = ctx.query;
const projectRes = await models.Project.findAll({ let findOption = {
where: { where: {
type
}, },
order: [['id', 'DESC']] order: [['id', 'DESC']]
}) }
if (type) {
findOption.where.type = type
}
if (entryName) {
findOption.where.entryName = {
$like: `%${entryName}%`
}
}
const projectRes = await models.Project.findAll(findOption)
ctx.status = 200; ctx.status = 200;
ctx.body = projectRes ctx.body = projectRes

4
web/client/src/sections/quanju/containers/footer/build/index.js

@ -48,7 +48,7 @@ const Build = (props) => {
const res = await dispatch(getxuanchuan()); const res = await dispatch(getxuanchuan());
// setdata(alltype.filter(item=>item.name!=='null')) // setdata(alltype.filter(item=>item.name!=='null'))
setxuandata(res.payload.data) setxuandata(res.payload.data || [])
console.log(res.payload.data,'宣传栏数据') console.log(res.payload.data,'宣传栏数据')
} }
@ -200,7 +200,7 @@ const Build = (props) => {
}} customize={true}> }} customize={true}>
<div className='build-right-top'> <div className='build-right-top'>
{/* <img src='/assets/images/quanju/xuanchuanlan.jpg'></img> */} {/* <img src='/assets/images/quanju/xuanchuanlan.jpg'></img> */}
<video src={xuandata?`${localStorage.getItem("qndmn")}/${xuandata[0].video!==null&&xuandata[0].video?xuandata[0].video[0]:""}`:"#"} autoPlay="autoplay" loop></video> <video src={xuandata && xuandata.length?`${localStorage.getItem("qndmn")}/${xuandata[0].video!==null&&xuandata[0].video?xuandata[0].video[0]:""}`:"#"} autoPlay="autoplay" loop></video>
<h2>全面建设好农村公路切实发挥先行官作用</h2> <h2>全面建设好农村公路切实发挥先行官作用</h2>
</div> </div>
</Module> </Module>

Loading…
Cancel
Save