推荐后台对接

master
pan 4 years ago
parent 7bf718d938
commit 4fec3aabac
  1. 2
      components/center/security.vue
  2. 2
      components/lang.vue
  3. 2
      layouts/mainmenu.vue
  4. 10
      nuxt.config.js
  5. 33
      pages/index/document.vue
  6. 5
      store/read.js

@ -101,6 +101,8 @@
if(res.code==='200'){
that.$message.info(that.$t('center.security.tip.ok').toString())
that.$cookies.remove(that.GLOBAL.user_key)
that.$store.commit('read/reset')
that.$store.commit('menus/none')
that.$router.push(that.localePath('/account'))
}else if(res.msg!==null){
that.$message.error(res.msg)

@ -32,6 +32,8 @@
methods:{
logout:function() {
this.$cookies.remove(this.GLOBAL.user_key)
this.$store.commit('read/reset')
this.$store.commit('menus/none')
this.$router.push(this.localePath('/account'))
}
}

@ -7,7 +7,7 @@
</el-image>
<h1 class="el-dialog--center"></h1>
<el-menu @select="selectItem" :router="true" :default-active="$route.path">
<el-menu-item :index="localePath('/'+item,$i18n.locale)" v-for="item in menus" :key="item">
<el-menu-item :index="localePath('/'+item,$i18n.locale)" v-for="item in menus" :key="item" :disabled="$route.path==='/'+item">
<template slot="title">
<i class="el-icon-location"></i>
<span>{{$t('menus.'+item)}}</span>

@ -165,7 +165,8 @@ export default {
"tutor": "导师"
},
"tip": {
"empty": "没有匹配到一篇论文"
"doc_empty": "没有匹配到一篇论文",
"recommend_empty": "暂无论文推荐"
}
},
"en": "英文",
@ -184,6 +185,7 @@ export default {
"upload": "本地上传论文"
},
"more_query": "更多查询",
"new_recommend": "最新推荐",
"note": {
"table": {
"original_text": "注释原文",
@ -233,7 +235,6 @@ export default {
"reset": "重置",
"select_please": "请选择{keyword}",
"tip": "提示",
"today_recommend": "今日推荐",
"unknown_error": "未知错误",
"upload": {
"form": {
@ -338,7 +339,8 @@ export default {
"tutor": ""
},
"tip": {
"empty": ""
"doc_empty": "",
"recommend_empty": ""
}
},
"en": "english",
@ -357,6 +359,7 @@ export default {
"upload": ""
},
"more_query": "",
"new_recommend": "",
"note": {
"table": {
"original_text": "",
@ -406,7 +409,6 @@ export default {
"reset": "",
"select_please": "",
"tip": "",
"today_recommend": "",
"unknown_error": "",
"upload": {
"form": {

@ -47,7 +47,7 @@
<el-col :span="18">
<template v-if="docList.length===0">
<el-alert
:title="tip"
:title="$t('document.tip.doc_empty')"
type="success"
:closable="false"
center>
@ -82,15 +82,20 @@
</el-col>
<el-col :span="5" class="ml3">
<el-row>
<h1 class="center">{{$t('today_recommend')}}</h1>
<h1 class="center">{{$t('new_recommend')}}</h1>
</el-row>
<div class="recommend-list">
<el-row v-for="(item,index) in recommend_list" :key="index">
<h3 class="center doc-title">{{item.title}}</h3>
<p class="doc-summary">{{item.summary}}</p>
</el-row>
<div class="recommend-list"v-if="recommend_list.length>0">
<el-row v-for="(item,index) in recommend_list" :key="index">
<h3 class="center doc-title"><a @click="read(item)">{{item.title}}</a></h3>
<p class="doc-summary">{{item.summary}}</p>
</el-row>
</div>
<el-alert v-else
:title="$t('document.tip.recommend_empty')"
type="success"
:closable="false"
center>
</el-alert>
</el-col>
</el-row>
<el-pagination
@ -123,7 +128,6 @@
activeNames: [],
docList: [],
recommend_list: [],
tip: this.$t('document.tip.empty'),
total:1
}
},
@ -150,10 +154,17 @@
}
loadingInstance.close()
})
},
recommend(){
let that=this
this.GLOBAL.fetchGet('/v1/api/paper/recommend',{},function(res) {
that.recommend_list=res.data
})
}
},
mounted() {
this.query()
this.recommend()
}
})
</script>
@ -174,4 +185,8 @@
.recommend-list {
overflow-y: scroll;
}
a{
cursor: pointer;
}
</style>

@ -45,5 +45,10 @@ export const mutations = {
//更新收藏状态
updateCollect(state,key){
state.read[key].hasCollect=!state.read[key].hasCollect
},
//重置
reset(state){
state.read={ }
state.activeName=''
}
}

Loading…
Cancel
Save