diff --git a/src/components/Home/Home.vue b/src/components/Home/Home.vue
index cf54b1c..8ffcbc9 100644
--- a/src/components/Home/Home.vue
+++ b/src/components/Home/Home.vue
@@ -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
});
},
- )}
+ )},
}
}
diff --git a/src/components/Home/SearchInput.vue b/src/components/Home/SearchInput.vue
index 8346692..b353377 100644
--- a/src/components/Home/SearchInput.vue
+++ b/src/components/Home/SearchInput.vue
@@ -17,7 +17,7 @@
{
+ console.log(res);
if (res.data.code === 200) {
Vue.prototype.$notify({
title: '成功',
diff --git a/src/components/Project/ProjectDetail.vue b/src/components/Project/ProjectDetail.vue
index 8c8d8f6..35d0155 100644
--- a/src/components/Project/ProjectDetail.vue
+++ b/src/components/Project/ProjectDetail.vue
@@ -177,7 +177,7 @@
>
- 发布
+ 发布
@@ -387,6 +387,9 @@ export default {
$route () {
if(this.$route.query.refresh){
this.getProjectDetail() //重新调用http请求实现页面的重新渲染
+ this.getLastComment();
+ this.isStart();
+ this.getGithub();
}
}
},
diff --git a/src/components/System/AdminHome.vue b/src/components/System/AdminHome.vue
index 721365e..25d5a92 100644
--- a/src/components/System/AdminHome.vue
+++ b/src/components/System/AdminHome.vue
@@ -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;
diff --git a/src/components/System/AdminLogin.vue b/src/components/System/AdminLogin.vue
index 92b7fa3..7f9c056 100644
--- a/src/components/System/AdminLogin.vue
+++ b/src/components/System/AdminLogin.vue
@@ -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',
diff --git a/src/components/User/UserComments.vue b/src/components/User/UserComments.vue
index 79821b3..490804a 100644
--- a/src/components/User/UserComments.vue
+++ b/src/components/User/UserComments.vue
@@ -13,11 +13,11 @@
- {{ this.$cookie.get('username') }}
+ {{comments.username}}
-
{{ this.$cookie.get('username') }}
+
{{ comments.username }}
评分:
贡献值
- {{ContributionValue}}/100
+ {{ContributionValue}}/100
-
+
diff --git a/src/components/User/UserInfoPage.vue b/src/components/User/UserInfoPage.vue
index 7d2ef4c..e525ea9 100644
--- a/src/components/User/UserInfoPage.vue
+++ b/src/components/User/UserInfoPage.vue
@@ -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: '错误',
diff --git a/src/main.js b/src/main.js
index acd1365..928033a 100644
--- a/src/main.js
+++ b/src/main.js
@@ -27,7 +27,7 @@ Vue.prototype.$cookie = cookie;
Vue.config.productionTip = false
Vue.use(Element);
-
+axios.defaults.timeout = 30000;
new Vue({
router,
diff --git a/vue.config.js b/vue.config.js
index 3341614..5e0c3f4 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -7,7 +7,12 @@ module.exports = {
runtimeCompiler: true,
// 关闭语法检查
lintOnSave:false,
+
+
devServer: {
+ client: {
+ overlay: false,
+ },
// host: 'localhost', // 本地域名/ip地址
// port: '8080', // 端口号
proxy: {