From 0f16aeff6a034b53a831a6e2f8f19f7961ef91b8 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Mon, 31 Oct 2022 19:22:21 +0800
Subject: [PATCH 01/11] :bug: fix pagination not found
---
pages/admin/articles.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pages/admin/articles.vue b/pages/admin/articles.vue
index bb5b231..7e1feb1 100644
--- a/pages/admin/articles.vue
+++ b/pages/admin/articles.vue
@@ -139,7 +139,7 @@ export default {
handleSizeChange(pageSize) {
let _ts = this;
_ts.$store.dispatch('admin/fetchArticles', {
- page: _ts.pagination.currentPage,
+ page: _ts.articles.pageNum,
rows: pageSize
})
},
@@ -147,7 +147,7 @@ export default {
let _ts = this;
_ts.$store.dispatch('admin/fetchArticles', {
page: page,
- rows: _ts.pagination.pageSize
+ rows: _ts.articles.pageSize
})
},
toggleStatus() {},
From 220ee2680dbf6d474017feea18ca63f788cd43e7 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Mon, 31 Oct 2022 19:54:53 +0800
Subject: [PATCH 02/11] :fix: first enter the https://rymcu.com/open-data can
not show the chart
---
pages/open-data.vue | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pages/open-data.vue b/pages/open-data.vue
index 7ba5d18..c304a89 100644
--- a/pages/open-data.vue
+++ b/pages/open-data.vue
@@ -155,7 +155,9 @@ export default {
},
mounted() {
this.$store.commit("setActiveMenu", "open-data");
- this.initLastThirtyDaysCharts(this.lastThirtyDays)
+ setTimeout(() => {
+ this.initLastThirtyDaysCharts(this.lastThirtyDays)
+ }, 500);
}
}
From a6f197930e701863bc0c031cc14fb9a41ee83a84 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 01:49:32 +0800
Subject: [PATCH 03/11] :fix: chart data will not displayed when first enter
---
pages/admin/dashboard.vue | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue
index 5228568..a404252 100644
--- a/pages/admin/dashboard.vue
+++ b/pages/admin/dashboard.vue
@@ -593,8 +593,11 @@ export default {
},
mounted() {
this.$store.commit("setActiveMenu", "admin-dashboard");
- this.initLastThirtyDaysCharts(this.lastThirtyDays)
- this.initHistoryCharts(this.history)
+ setTimeout(() => {
+ this.initLastThirtyDaysCharts(this.lastThirtyDays)
+ this.initHistoryCharts(this.history)
+ }, 500);
+
}
}
From 4d87aff1d04784c027a0dff7014fe3277a4739b4 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 02:07:58 +0800
Subject: [PATCH 04/11] :fix: pagination not fonud
---
components/common/user/login-records.vue | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/components/common/user/login-records.vue b/components/common/user/login-records.vue
index 6486e73..832ed36 100644
--- a/components/common/user/login-records.vue
+++ b/components/common/user/login-records.vue
@@ -5,7 +5,7 @@
+ :total="records.total">
@@ -61,7 +61,7 @@ export default {
let _ts = this;
let search = {
size: size,
- page: _ts.records.pagination.currentPage
+ page: _ts.records.pageNum
}
_ts.$emit('currentChange', search);
},
@@ -69,7 +69,7 @@ export default {
let _ts = this;
let search = {
page: page,
- size: _ts.records.pagination.pageSize
+ size: _ts.records.pageSize
}
_ts.$emit('currentChange', search);
}
From f24bdbb1dc2830c475cd5a8c8c59758538510466 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 02:27:57 +0800
Subject: [PATCH 05/11] :fix: the preference button does not render correctly
in time.
---
pages/admin/articles.vue | 18 ++++++------------
pages/admin/dashboard.vue | 18 ++++++------------
2 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/pages/admin/articles.vue b/pages/admin/articles.vue
index bb5b231..de12a55 100644
--- a/pages/admin/articles.vue
+++ b/pages/admin/articles.vue
@@ -157,18 +157,12 @@ export default {
idArticle: idArticle,
articlePerfect: '1'
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '1'
- })
- _ts.$message.success("设置成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '1'
+ })
+ _ts.$message.success("设置成功!");
})
},
cancelPreference(index, idArticle) {
diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue
index 5228568..45fc794 100644
--- a/pages/admin/dashboard.vue
+++ b/pages/admin/dashboard.vue
@@ -503,18 +503,12 @@ export default {
idArticle: idArticle,
articlePerfect: '1'
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '1'
- })
- _ts.$message.success("设置成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '1'
+ })
+ _ts.$message.success("设置成功!");
})
},
cancelPreference(index, idArticle) {
From 3d7562a4da1ca04fc1263296bb3c91926d74a627 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 02:57:34 +0800
Subject: [PATCH 06/11] :fix: the preference button in article page does not
render correctly in time.
---
pages/article/_article_id.vue | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue
index 2f53a9d..eacbc05 100644
--- a/pages/article/_article_id.vue
+++ b/pages/article/_article_id.vue
@@ -341,14 +341,8 @@ export default {
idArticle: _ts.article.idArticle,
articlePerfect: '1',
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$set(_ts, 'isPerfect', false);
- _ts.$message.success("设置成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.isPerfect = !_ts.isPerfect;
+ _ts.$message.success("设置成功!");
})
},
cancelPreference() {
@@ -357,14 +351,8 @@ export default {
idArticle: _ts.article.idArticle,
articlePerfect: '0',
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$set(_ts, 'isPerfect', true);
- _ts.$message.success("取消成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.isPerfect = !_ts.isPerfect;
+ _ts.$message.success("设置成功!");
})
},
thumbsUp() {
From 55de0b557ae32c7a4863fc715be305e6814a44a3 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 02:59:22 +0800
Subject: [PATCH 07/11] :fix: the preference button does not render correctly
in time.
---
pages/admin/articles.vue | 18 ++++++------------
pages/admin/dashboard.vue | 18 ++++++------------
2 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/pages/admin/articles.vue b/pages/admin/articles.vue
index de12a55..0a0cfb3 100644
--- a/pages/admin/articles.vue
+++ b/pages/admin/articles.vue
@@ -171,18 +171,12 @@ export default {
idArticle: idArticle,
articlePerfect: '0'
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '0'
- })
- _ts.$message.success("取消成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '0'
+ })
+ _ts.$message.success("取消成功!");
})
},
updateTags(index, article) {
diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue
index 45fc794..71090e1 100644
--- a/pages/admin/dashboard.vue
+++ b/pages/admin/dashboard.vue
@@ -517,18 +517,12 @@ export default {
idArticle: idArticle,
articlePerfect: '0'
}).then(function (res) {
- if (res) {
- if (res.success) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '0'
- })
- _ts.$message.success("取消成功!");
- } else {
- _ts.$message.error(_ts.message);
- }
- }
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '0'
+ })
+ _ts.$message.success("取消成功!");
})
},
updateTags(index, article) {
From b44c7ce33597eba31ead0ab6d805fcad8e8c23c6 Mon Sep 17 00:00:00 2001
From: Zeeland <287017217@qq.com>
Date: Tue, 1 Nov 2022 03:23:13 +0800
Subject: [PATCH 08/11] :fix: can not render avatar normally.
---
pages/user/settings/avatar.vue | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pages/user/settings/avatar.vue b/pages/user/settings/avatar.vue
index cc39215..41a6d64 100644
--- a/pages/user/settings/avatar.vue
+++ b/pages/user/settings/avatar.vue
@@ -158,9 +158,9 @@ export default {
if (res.message) {
_ts.$message.error(res.message);
} else {
- _ts.$set(_ts, 'user', res.user);
- _ts.$set(_ts, 'avatarUrl', res.user.avatarUrl);
- _ts.$refs.cropper.replace(res.user.avatarUrl);
+ _ts.$set(_ts, 'user', res);
+ _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
+ _ts.$refs.cropper.replace(res.avatarUrl);
// _ts.webImageToBase64(res.user.avatarUrl);
}
}
@@ -192,9 +192,9 @@ export default {
if (res.message) {
_ts.$message.error(res.message);
} else {
- _ts.$set(_ts, 'user', res.user);
- _ts.$set(_ts, 'avatarUrl', res.user.avatarUrl);
- _ts.$store.commit('setUserInfo', res.user);
+ _ts.$set(_ts, 'user', res);
+ _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
+ _ts.$store.commit('setUserInfo', res);
_ts.$message.success('更新成功 !');
}
}
From c61b7cea5d6106c725cd18eac3717be38eba37eb Mon Sep 17 00:00:00 2001
From: ronger
Date: Tue, 1 Nov 2022 07:38:52 +0800
Subject: [PATCH 09/11] Update articles.vue
---
pages/admin/articles.vue | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/pages/admin/articles.vue b/pages/admin/articles.vue
index 0a0cfb3..2a75f49 100644
--- a/pages/admin/articles.vue
+++ b/pages/admin/articles.vue
@@ -157,12 +157,16 @@ export default {
idArticle: idArticle,
articlePerfect: '1'
}).then(function (res) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '1'
- })
- _ts.$message.success("设置成功!");
+ if (res) {
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '1'
+ })
+ _ts.$message.success("设置成功!");
+ } else {
+ _ts.$message.error("设置失败!");
+ }
})
},
cancelPreference(index, idArticle) {
@@ -171,12 +175,16 @@ export default {
idArticle: idArticle,
articlePerfect: '0'
}).then(function (res) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '0'
- })
- _ts.$message.success("取消成功!");
+ if (res) {
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '0'
+ })
+ _ts.$message.success("取消成功!");
+ } else {
+ _ts.$message.error("取消失败!");
+ }
})
},
updateTags(index, article) {
From e50613586d0357888d0a1370fc6d6a3ae2f60811 Mon Sep 17 00:00:00 2001
From: ronger
Date: Tue, 1 Nov 2022 07:40:27 +0800
Subject: [PATCH 10/11] Update dashboard.vue
---
pages/admin/dashboard.vue | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/pages/admin/dashboard.vue b/pages/admin/dashboard.vue
index 71090e1..3729487 100644
--- a/pages/admin/dashboard.vue
+++ b/pages/admin/dashboard.vue
@@ -503,12 +503,16 @@ export default {
idArticle: idArticle,
articlePerfect: '1'
}).then(function (res) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '1'
- })
- _ts.$message.success("设置成功!");
+ if (res) {
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '1'
+ })
+ _ts.$message.success("设置成功!");
+ } else {
+ _ts.$message.error("设置失败!");
+ }
})
},
cancelPreference(index, idArticle) {
@@ -517,12 +521,16 @@ export default {
idArticle: idArticle,
articlePerfect: '0'
}).then(function (res) {
- _ts.$store.commit('admin/updateArticlePreference', {
- index: index,
- idArticle: idArticle,
- articlePerfect: '0'
- })
- _ts.$message.success("取消成功!");
+ if (res) {
+ _ts.$store.commit('admin/updateArticlePreference', {
+ index: index,
+ idArticle: idArticle,
+ articlePerfect: '0'
+ })
+ _ts.$message.success("取消成功!");
+ } else {
+ _ts.$message.error("取消失败!");
+ }
})
},
updateTags(index, article) {
From 66784c40cc1ff21b00bb516bbba3cc62a46f6147 Mon Sep 17 00:00:00 2001
From: ronger
Date: Tue, 1 Nov 2022 07:46:34 +0800
Subject: [PATCH 11/11] Update _article_id.vue
---
pages/article/_article_id.vue | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue
index eacbc05..1a99618 100644
--- a/pages/article/_article_id.vue
+++ b/pages/article/_article_id.vue
@@ -335,14 +335,18 @@ export default {
_ts.gotoLogin();
}
},
- setPreference() {
+ setPreference() {
let _ts = this;
_ts.$axios.$patch("/api/admin/article/update-perfect", {
idArticle: _ts.article.idArticle,
articlePerfect: '1',
}).then(function (res) {
- _ts.isPerfect = !_ts.isPerfect;
- _ts.$message.success("设置成功!");
+ if (res) {
+ _ts.$set(_ts, 'isPerfect', true);
+ _ts.$message.success("设置成功!");
+ } else {
+ _ts.$message.error("设置失败!");
+ }
})
},
cancelPreference() {
@@ -351,8 +355,12 @@ export default {
idArticle: _ts.article.idArticle,
articlePerfect: '0',
}).then(function (res) {
- _ts.isPerfect = !_ts.isPerfect;
- _ts.$message.success("设置成功!");
+ if (res) {
+ _ts.$set(_ts, 'isPerfect', false);
+ _ts.$message.success("取消成功!");
+ } else {
+ _ts.$message.error("设置失败!");
+ }
})
},
thumbsUp() {