优化调整
This commit is contained in:
@@ -164,11 +164,9 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.account(); //获取cookie的方法
|
||||
this.ProjectLists();
|
||||
},
|
||||
created() {
|
||||
|
||||
this.categoryList();
|
||||
this.getProjectTotal();
|
||||
this.getUserTotal();
|
||||
@@ -204,7 +202,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/selectLastByCate',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/selectLastByCate',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
num: "0",
|
||||
@@ -224,7 +222,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/selectMostStar',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/selectMostStar',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
num: index,
|
||||
@@ -256,7 +254,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/selectLastByCate',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/selectLastByCate',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
num: index,
|
||||
@@ -282,7 +280,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/retLabel',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/retLabel',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
}
|
||||
@@ -303,7 +301,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/userNum',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/userNum',
|
||||
}).then((res)=>{
|
||||
that.userTotal=res.data;
|
||||
}).catch((error)=>{
|
||||
@@ -319,7 +317,7 @@ export default {
|
||||
axios({
|
||||
method: 'post',
|
||||
// 请求的地址
|
||||
url: '/api/countNum',
|
||||
url: 'http://localhost:8082/helloGithub_war_exploded/countNum',
|
||||
// URL 中的查询参数
|
||||
}).then((res)=>{
|
||||
that.projectTotal=res.data;
|
||||
@@ -330,7 +328,7 @@ export default {
|
||||
offset: 50
|
||||
});
|
||||
},
|
||||
)}
|
||||
)},
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div v-if="historySearch!==null" v-show="this.$cookie.get('username')!=null">
|
||||
<el-tag
|
||||
v-if="historySearch.length!==1"
|
||||
v-if="historySearch.length!==0"
|
||||
v-for="(tag,index) in historySearch"
|
||||
:key="index"
|
||||
size="small"
|
||||
|
@@ -151,6 +151,7 @@ export default {
|
||||
articleContent: this.form.content,
|
||||
}
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
if (res.data.code === 200) {
|
||||
Vue.prototype.$notify({
|
||||
title: '成功',
|
||||
|
@@ -177,7 +177,7 @@
|
||||
>
|
||||
</el-rate>
|
||||
</div>
|
||||
<el-button type="primary" plain @click="publishComment">发布</el-button>
|
||||
<el-button type="primary" plain @click.once.stop.native="publishComment">发布</el-button>
|
||||
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
@@ -387,6 +387,9 @@ export default {
|
||||
$route () {
|
||||
if(this.$route.query.refresh){
|
||||
this.getProjectDetail() //重新调用http请求实现页面的重新渲染
|
||||
this.getLastComment();
|
||||
this.isStart();
|
||||
this.getGithub();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -197,6 +197,17 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
isAdminLogin(){
|
||||
if(this.$cookie.get('adminName')===null){
|
||||
this.$router.push({
|
||||
path:'/adminLogin',
|
||||
})
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAdminLoginTime(){
|
||||
var that=this;
|
||||
|
@@ -88,7 +88,7 @@ export default {
|
||||
type: 'success',
|
||||
offset: 50
|
||||
});
|
||||
_this.$cookie.set('adminName',_this.login.username);
|
||||
_this.$cookie.set('adminName',_this.login.username,1);
|
||||
setTimeout(()=>{
|
||||
_this.$router.push({
|
||||
path:'/systemIndex',
|
||||
|
@@ -13,11 +13,11 @@
|
||||
<el-card style="border-radius: 10px;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex-wrap: nowrap">
|
||||
<div style="width: 60px;height: 60px;">
|
||||
<el-avatar v-if="comments.username" :size="60" :src="'http://localhost:8082/helloGithub_war_exploded/retUserAv?username='+comments.username">{{ this.$cookie.get('username') }}</el-avatar>
|
||||
<el-avatar v-if="comments.username" :size="60" :src="'http://localhost:8082/helloGithub_war_exploded/retUserAv?username='+comments.username">{{comments.username}}</el-avatar>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: column;flex-wrap: nowrap;margin-left: 20px">
|
||||
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center">
|
||||
<span style="font-size: 16px;font-weight: bold">{{ this.$cookie.get('username') }}</span>
|
||||
<span style="font-size: 16px;font-weight: bold">{{ comments.username }}</span>
|
||||
<span style="margin-left: 10px">评分: </span>
|
||||
<el-rate
|
||||
style="margin-left: 5px"
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
if (this.comments.commentTime) {
|
||||
const dt = new Date(this.comments.commentTime)
|
||||
const year=dt.getFullYear()
|
||||
const month = dt.getMonth()
|
||||
const month = dt.getMonth()+1
|
||||
const date = dt.getDate()
|
||||
return `${year}-${month}-${date}`
|
||||
}
|
||||
|
@@ -15,10 +15,10 @@
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;margin-top: 10px;justify-content: space-between;align-items: center">
|
||||
<span style="font-size: 10px;color: #9ca3af">贡献值</span>
|
||||
<span v-if="ContributionValue" style="font-weight: bold;color: #59A3A4;font-size: 20px">{{ContributionValue}}/100</span>
|
||||
<span style="font-weight: bold;color: #59A3A4;font-size: 20px">{{ContributionValue}}/100</span>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-progress v-if="ContributionValue" :text-inside="true" :stroke-width="15" :percentage="ContributionValue"></el-progress>
|
||||
<el-progress :text-inside="true" :stroke-width="15" :percentage="ContributionValue"></el-progress>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;flex-direction: row;flex-wrap: nowrap;">
|
||||
|
@@ -241,6 +241,7 @@ export default {
|
||||
that.commentList=JSON.parse(res.data.comment);
|
||||
that.like=JSON.parse(res.data.like)
|
||||
that.article=JSON.parse(res.data.article);
|
||||
console.log(that.commentList)
|
||||
}).catch((error)=>{
|
||||
Vue.prototype.$notify.error({
|
||||
title: '错误',
|
||||
|
@@ -27,7 +27,7 @@ Vue.prototype.$cookie = cookie;
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(Element);
|
||||
|
||||
axios.defaults.timeout = 30000;
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
|
@@ -7,7 +7,12 @@ module.exports = {
|
||||
runtimeCompiler: true,
|
||||
// 关闭语法检查
|
||||
lintOnSave:false,
|
||||
|
||||
|
||||
devServer: {
|
||||
client: {
|
||||
overlay: false,
|
||||
},
|
||||
// host: 'localhost', // 本地域名/ip地址
|
||||
// port: '8080', // 端口号
|
||||
proxy: {
|
||||
|
Reference in New Issue
Block a user