优化调整

This commit is contained in:
2023-07-13 11:11:21 +08:00
parent f4afb4629f
commit c5c6b7f4e4
11 changed files with 37 additions and 18 deletions

View File

@@ -164,11 +164,9 @@ export default {
}; };
}, },
mounted() { mounted() {
// this.account(); //获取cookie的方法
this.ProjectLists(); this.ProjectLists();
}, },
created() { created() {
this.categoryList(); this.categoryList();
this.getProjectTotal(); this.getProjectTotal();
this.getUserTotal(); this.getUserTotal();
@@ -204,7 +202,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/selectLastByCate', url: 'http://localhost:8082/helloGithub_war_exploded/selectLastByCate',
// URL 中的查询参数 // URL 中的查询参数
params: { params: {
num: "0", num: "0",
@@ -224,7 +222,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/selectMostStar', url: 'http://localhost:8082/helloGithub_war_exploded/selectMostStar',
// URL 中的查询参数 // URL 中的查询参数
params: { params: {
num: index, num: index,
@@ -256,7 +254,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/selectLastByCate', url: 'http://localhost:8082/helloGithub_war_exploded/selectLastByCate',
// URL 中的查询参数 // URL 中的查询参数
params: { params: {
num: index, num: index,
@@ -282,7 +280,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/retLabel', url: 'http://localhost:8082/helloGithub_war_exploded/retLabel',
// URL 中的查询参数 // URL 中的查询参数
params: { params: {
} }
@@ -303,7 +301,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/userNum', url: 'http://localhost:8082/helloGithub_war_exploded/userNum',
}).then((res)=>{ }).then((res)=>{
that.userTotal=res.data; that.userTotal=res.data;
}).catch((error)=>{ }).catch((error)=>{
@@ -319,7 +317,7 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// 请求的地址 // 请求的地址
url: '/api/countNum', url: 'http://localhost:8082/helloGithub_war_exploded/countNum',
// URL 中的查询参数 // URL 中的查询参数
}).then((res)=>{ }).then((res)=>{
that.projectTotal=res.data; that.projectTotal=res.data;
@@ -330,7 +328,7 @@ export default {
offset: 50 offset: 50
}); });
}, },
)} )},
} }
} }

View File

@@ -17,7 +17,7 @@
</div> </div>
<div v-if="historySearch!==null" v-show="this.$cookie.get('username')!=null"> <div v-if="historySearch!==null" v-show="this.$cookie.get('username')!=null">
<el-tag <el-tag
v-if="historySearch.length!==1" v-if="historySearch.length!==0"
v-for="(tag,index) in historySearch" v-for="(tag,index) in historySearch"
:key="index" :key="index"
size="small" size="small"

View File

@@ -151,6 +151,7 @@ export default {
articleContent: this.form.content, articleContent: this.form.content,
} }
}).then((res) => { }).then((res) => {
console.log(res);
if (res.data.code === 200) { if (res.data.code === 200) {
Vue.prototype.$notify({ Vue.prototype.$notify({
title: '成功', title: '成功',

View File

@@ -177,7 +177,7 @@
> >
</el-rate> </el-rate>
</div> </div>
<el-button type="primary" plain @click="publishComment">发布</el-button> <el-button type="primary" plain @click.once.stop.native="publishComment">发布</el-button>
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
@@ -387,6 +387,9 @@ export default {
$route () { $route () {
if(this.$route.query.refresh){ if(this.$route.query.refresh){
this.getProjectDetail() //重新调用http请求实现页面的重新渲染 this.getProjectDetail() //重新调用http请求实现页面的重新渲染
this.getLastComment();
this.isStart();
this.getGithub();
} }
} }
}, },

View File

@@ -197,6 +197,17 @@ export default {
} }
}, },
watch:{
isAdminLogin(){
if(this.$cookie.get('adminName')===null){
this.$router.push({
path:'/adminLogin',
})
}else {
return false;
}
}
},
methods: { methods: {
getAdminLoginTime(){ getAdminLoginTime(){
var that=this; var that=this;

View File

@@ -88,7 +88,7 @@ export default {
type: 'success', type: 'success',
offset: 50 offset: 50
}); });
_this.$cookie.set('adminName',_this.login.username); _this.$cookie.set('adminName',_this.login.username,1);
setTimeout(()=>{ setTimeout(()=>{
_this.$router.push({ _this.$router.push({
path:'/systemIndex', path:'/systemIndex',

View File

@@ -13,11 +13,11 @@
<el-card style="border-radius: 10px;margin-top: 10px;"> <el-card style="border-radius: 10px;margin-top: 10px;">
<div style="display: flex;flex-direction: row;flex-wrap: nowrap"> <div style="display: flex;flex-direction: row;flex-wrap: nowrap">
<div style="width: 60px;height: 60px;"> <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>
<div style="display: flex;flex-direction: column;flex-wrap: nowrap;margin-left: 20px"> <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"> <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> <span style="margin-left: 10px">评分: </span>
<el-rate <el-rate
style="margin-left: 5px" style="margin-left: 5px"
@@ -75,7 +75,7 @@ export default {
if (this.comments.commentTime) { if (this.comments.commentTime) {
const dt = new Date(this.comments.commentTime) const dt = new Date(this.comments.commentTime)
const year=dt.getFullYear() const year=dt.getFullYear()
const month = dt.getMonth() const month = dt.getMonth()+1
const date = dt.getDate() const date = dt.getDate()
return `${year}-${month}-${date}` return `${year}-${month}-${date}`
} }

View File

@@ -15,10 +15,10 @@
</div> </div>
<div style="display: flex;flex-direction: row;margin-top: 10px;justify-content: space-between;align-items: center"> <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 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>
<div style="margin-top: 10px"> <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> </div>
<el-divider></el-divider> <el-divider></el-divider>
<div style="display: flex;align-items: center;justify-content: space-between;flex-direction: row;flex-wrap: nowrap;"> <div style="display: flex;align-items: center;justify-content: space-between;flex-direction: row;flex-wrap: nowrap;">

View File

@@ -241,6 +241,7 @@ export default {
that.commentList=JSON.parse(res.data.comment); that.commentList=JSON.parse(res.data.comment);
that.like=JSON.parse(res.data.like) that.like=JSON.parse(res.data.like)
that.article=JSON.parse(res.data.article); that.article=JSON.parse(res.data.article);
console.log(that.commentList)
}).catch((error)=>{ }).catch((error)=>{
Vue.prototype.$notify.error({ Vue.prototype.$notify.error({
title: '错误', title: '错误',

View File

@@ -27,7 +27,7 @@ Vue.prototype.$cookie = cookie;
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Element); Vue.use(Element);
axios.defaults.timeout = 30000;
new Vue({ new Vue({
router, router,

View File

@@ -7,7 +7,12 @@ module.exports = {
runtimeCompiler: true, runtimeCompiler: true,
// 关闭语法检查 // 关闭语法检查
lintOnSave:false, lintOnSave:false,
devServer: { devServer: {
client: {
overlay: false,
},
// host: 'localhost', // 本地域名/ip地址 // host: 'localhost', // 本地域名/ip地址
// port: '8080', // 端口号 // port: '8080', // 端口号
proxy: { proxy: {