From 6233f1ee171da284802b0424283e8e1c57645c43 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Fri, 9 May 2025 17:44:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=B8=8D=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=9F=A5=E7=9C=8B=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/model/center.js | 3 --- api/model/sharing.js | 5 ----- mixins/list.js | 6 +++--- pages/index/center.vue | 19 ++++++++----------- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/api/model/center.js b/api/model/center.js index 36ef105..822b787 100644 --- a/api/model/center.js +++ b/api/model/center.js @@ -6,7 +6,6 @@ const api = { getNotice: { url: '/all_login/getNotice', method: 'GET', - auth: true, }, /** * 获取动态列表 @@ -14,7 +13,6 @@ const api = { getNews: { url: '/all_login/getNews', method: 'GET', - auth: true, }, /** * 获取新闻动态详情的接口 @@ -22,7 +20,6 @@ const api = { getNewsById: { url: '/all_login/getNewsById', method: 'GET', - auth: true, }, } diff --git a/api/model/sharing.js b/api/model/sharing.js index 0fa3d07..a9aa827 100644 --- a/api/model/sharing.js +++ b/api/model/sharing.js @@ -5,7 +5,6 @@ const api = { getShareInfo: { url: '/fen/getShareInfo', method: 'GET', - auth: true, debounce: 500, }, /** @@ -14,7 +13,6 @@ const api = { addLogShareInfo: { url: '/fen/addLog', method: 'POST', - auth: true, limit : 500, showLoading : true, }, @@ -44,7 +42,6 @@ const api = { getVideoShareInfo: { url: '/fen/getVideoShareInfo', method: 'GET', - auth: true, debounce: 500, }, /** @@ -63,7 +60,6 @@ const api = { getGroupShareInfo: { url: '/fen/getGroupShareInfo', method: 'GET', - auth: true, debounce: 500, }, /** @@ -82,7 +78,6 @@ const api = { getArticleShareInfo: { url: '/fen/getArticleShareInfo', method: 'GET', - auth: true, debounce: 500, }, /** diff --git a/mixins/list.js b/mixins/list.js index 3eea63b..8f6a63d 100644 --- a/mixins/list.js +++ b/mixins/list.js @@ -47,9 +47,9 @@ export default { */ getData(queryParams){ - if(this.authApi && !uni.getStorageSync('token')){ - return - } + if(this.authApi && !uni.getStorageSync('token')){ + return + } return new Promise((success, error) => { if(!this.mixinsListApi){ diff --git a/pages/index/center.vue b/pages/index/center.vue index d8c48f9..5820125 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -148,7 +148,7 @@ export default { return { notice: '', mixinsListApi: 'getNews', - authApi : true, + authApi : false, isLoggedIn : uni.getStorageSync('token'), } }, @@ -159,12 +159,13 @@ export default { }, }, onShow() { - this.isLoggedIn = uni.getStorageSync('token') - if(this.isLoggedIn){ - this.$store.commit('getUserInfo') - this.$store.commit('getUserInfoVip') - this.fetchNotice() - } + this.fetchNotice() + + this.isLoggedIn = uni.getStorageSync('token') + if(this.isLoggedIn){ + this.$store.commit('getUserInfo') + this.$store.commit('getUserInfoVip') + } }, methods: { async fetchNotice() { @@ -190,10 +191,6 @@ export default { return str.replace(/<.*?>/g, '') }, goToNewsDetail(id) { - if (!this.isLoggedIn) { - this.goToLogin() - return - } uni.navigateTo({ url: `/pages_order/mine/news?id=${id}` })