From f4afb4629fcbb62ec5d740c41a0948a032d23769 Mon Sep 17 00:00:00 2001 From: Qing Date: Thu, 13 Jul 2023 01:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/Header.vue | 12 +- src/components/Home/Home.vue | 38 +++-- src/components/Home/LoginDialog.vue | 16 ++- src/components/Home/PasswordStrength.vue | 124 ---------------- src/components/Home/SearchInput.vue | 32 ++++- src/components/Home/SearchResultsList.vue | 41 ++++-- src/components/Monthly/Monthly.vue | 35 ++++- src/components/Monthly/MonthlyByTags.vue | 23 ++- src/components/Monthly/MonthlyDetail.vue | 15 +- src/components/OneFile/OneFile.vue | 12 ++ src/components/OneFile/OneFileDetail.vue | 14 +- src/components/Paper/ArticleDetail.vue | 2 +- src/components/Paper/Paper.vue | 13 ++ src/components/Paper/PublishArticle.vue | 6 + src/components/Project/ProjectDetail.vue | 132 ++++++++++++++---- src/components/Project/ProjectList.vue | 11 +- src/components/Project/RandomProjects.vue | 7 + src/components/Ranking/Ranking.vue | 32 ++++- src/components/System/AdminHome.vue | 127 ++++++++++++----- src/components/System/AdminLogin.vue | 11 +- .../System/Manage/articleManage.vue | 47 +++++-- .../System/Manage/categoryManage.vue | 42 +++++- .../System/Manage/commentManage.vue | 47 +++++-- .../System/Manage/oneFileManage.vue | 47 +++++-- .../System/Manage/projectManage.vue | 47 +++++-- src/components/System/Manage/systemManage.vue | 14 +- src/components/System/Manage/userManage.vue | 34 ++++- src/components/User/UserInfo.vue | 43 +++++- src/components/User/UserInfoPage.vue | 26 +++- 29 files changed, 760 insertions(+), 290 deletions(-) delete mode 100644 src/components/Home/PasswordStrength.vue diff --git a/src/components/Home/Header.vue b/src/components/Home/Header.vue index ba243c9..7b92d45 100644 --- a/src/components/Home/Header.vue +++ b/src/components/Home/Header.vue @@ -265,7 +265,7 @@ export default { }, getNameAndCheck() { if (this.form.url === null) { - return; + return false; } else { this.splitUrl(); this.isExist(); @@ -356,9 +356,15 @@ export default { } }).then((res)=>{ - that.avatar_url=res.data.owner.avatar_url; + that.avatar_url=res.data.owner.avatar_url; // that.saveGithubInfo(); - }); + }).catch(()=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: '项目地址不合法或不存在!', + offset: 50 + }); + }) }, }, diff --git a/src/components/Home/Home.vue b/src/components/Home/Home.vue index d27cfcb..cf54b1c 100644 --- a/src/components/Home/Home.vue +++ b/src/components/Home/Home.vue @@ -140,6 +140,7 @@ import axios from 'axios' import ProjectList from "@/components/Project/ProjectList.vue"; import UserInfo from "@/components/User/UserInfo.vue"; import LoginDialog from "@/components/Home/LoginDialog.vue"; +import Vue from "vue"; export default { name: "HomeComponent", @@ -169,9 +170,7 @@ export default { created() { this.categoryList(); - setTimeout(()=>{ - this.getProjectTotal(); - },1000) + this.getProjectTotal(); this.getUserTotal(); }, computed: { @@ -212,7 +211,13 @@ export default { } }).then((res)=>{ that.projectLists=res.data; - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, projectListsByCount(index,name){ var that=this; @@ -284,7 +289,13 @@ export default { }).then((res)=>{ // console.log(res); that.tags=res.data; - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, getUserTotal(){ @@ -295,7 +306,13 @@ export default { url: '/api/userNum', }).then((res)=>{ that.userTotal=res.data; - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, getProjectTotal(){ var that=this; @@ -306,9 +323,14 @@ export default { // URL 中的查询参数 }).then((res)=>{ that.projectTotal=res.data; - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); }, - + )} } } diff --git a/src/components/Home/LoginDialog.vue b/src/components/Home/LoginDialog.vue index c4f1fd9..3654911 100644 --- a/src/components/Home/LoginDialog.vue +++ b/src/components/Home/LoginDialog.vue @@ -275,7 +275,13 @@ export default { offset: 50 }); } - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) } else { return false; } @@ -319,7 +325,13 @@ export default { }); } // console.log(res); - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) } else { return false; } diff --git a/src/components/Home/PasswordStrength.vue b/src/components/Home/PasswordStrength.vue deleted file mode 100644 index 55180cf..0000000 --- a/src/components/Home/PasswordStrength.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/Home/SearchInput.vue b/src/components/Home/SearchInput.vue index aca98bc..8346692 100644 --- a/src/components/Home/SearchInput.vue +++ b/src/components/Home/SearchInput.vue @@ -129,7 +129,13 @@ export default { offset: 50 }); } - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, // searchRequest() { // const params = { @@ -151,7 +157,13 @@ export default { }).then((res)=>{ that.historySearch=res.data; - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, handleClose(tag){ var that=this; @@ -181,7 +193,13 @@ export default { offset: 50 }); } - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }, searchByInput(){ var that=this; @@ -217,7 +235,13 @@ export default { that.gethistorySearch(); }, 200); } - }); + }).catch((error)=>{ + Vue.prototype.$notify.error({ + title: '错误', + message: error, + offset: 50 + }); + }) }else{ Vue.prototype.$notify.error({ title: '错误', diff --git a/src/components/Home/SearchResultsList.vue b/src/components/Home/SearchResultsList.vue index 5a9e516..c0178d1 100644 --- a/src/components/Home/SearchResultsList.vue +++ b/src/components/Home/SearchResultsList.vue @@ -1,7 +1,7 @@