Commit e3cbd55e authored by 吴冠's avatar 吴冠

主页下侧

parent 0354d579
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
<div class="more t1 list-con" >更多 ></div> <div class="more t1 list-con" >更多 ></div>
</div> </div>
<ul> <ul>
<li v-for="(item,index) in dynamicList" :key="index" v-if="index<5" class="flex-between list-con"> <li v-for="(item,index) in dynamic" :key="index" v-if="index<5" class="flex-between list-con">
<nuxt-link tag="div" to="#">{{item.title}}</nuxt-link> <nuxt-link tag="div" to="#">{{item.title}}</nuxt-link>
<div class="time">{{item.createTime}}</div> <div class="time">{{item.createTime.slice(0,10)}}</div>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -61,6 +61,7 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js' ...@@ -61,6 +61,7 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js'
this.getSecond() this.getSecond()
//文章列表 //文章列表
this.getCategoryList() this.getCategoryList()
this.getListSite()
}, },
methods:{ methods:{
async getCategoryList(){ async getCategoryList(){
...@@ -68,11 +69,13 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js' ...@@ -68,11 +69,13 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js'
this.dynamicList = data this.dynamicList = data
}, },
async getListSite(){ async getListSite(){
let message = {} /* let message = {}
message.cateId = this.id message.cateId = this.id */
const {data} = await getListSite() const {data} = await getListSite()
console.log(data,'++++++++++++++++++++++++') console.log(data,'++++++++++++++++++++++++')
/* this.dynamicList.list = data.list */ console.log('-------------------')
this.dynamic = data
console.log('--------------------')
}, },
//添加验证方法 //添加验证方法
async getSecond(){ async getSecond(){
...@@ -80,8 +83,7 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js' ...@@ -80,8 +83,7 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js'
if(tokenStr){ if(tokenStr){
this.showDefault = false this.showDefault = false
sessionStorage.setItem("websiteenRequestTokenRequest",10) sessionStorage.setItem("websiteenRequestTokenRequest",10)
const {data,code} = await getSecond() const {data} = await getSecond()
window.sessionStorage.setItem("companyName",data.companyName) window.sessionStorage.setItem("companyName",data.companyName)
this.userName = window.sessionStorage.getItem("companyName") this.userName = window.sessionStorage.getItem("companyName")
} }
...@@ -107,8 +109,8 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js' ...@@ -107,8 +109,8 @@ import {getSecond,getCategoryList,getListSite} from '@/common/list.js'
}, },
data() { data() {
return { return {
id:0, id:123,
dyname:[], dynamic:[],
showDefault:true, showDefault:true,
userName:'Hi~欢迎来到捷安彩', userName:'Hi~欢迎来到捷安彩',
userHeader: '', userHeader: '',
......
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 to comment