#13 feat: 支持不登录查看我的页面;

Merged
Fox merged 1 commits from fox into master 1 month ago
  1. +0
    -3
      api/model/center.js
  2. +0
    -5
      api/model/sharing.js
  3. +3
    -3
      mixins/list.js
  4. +8
    -11
      pages/index/center.vue

+ 0
- 3
api/model/center.js View File

@ -6,7 +6,6 @@ const api = {
getNotice: { getNotice: {
url: '/all_login/getNotice', url: '/all_login/getNotice',
method: 'GET', method: 'GET',
auth: true,
}, },
/** /**
* 获取动态列表 * 获取动态列表
@ -14,7 +13,6 @@ const api = {
getNews: { getNews: {
url: '/all_login/getNews', url: '/all_login/getNews',
method: 'GET', method: 'GET',
auth: true,
}, },
/** /**
* 获取新闻动态详情的接口 * 获取新闻动态详情的接口
@ -22,7 +20,6 @@ const api = {
getNewsById: { getNewsById: {
url: '/all_login/getNewsById', url: '/all_login/getNewsById',
method: 'GET', method: 'GET',
auth: true,
}, },
} }

+ 0
- 5
api/model/sharing.js View File

@ -5,7 +5,6 @@ const api = {
getShareInfo: { getShareInfo: {
url: '/fen/getShareInfo', url: '/fen/getShareInfo',
method: 'GET', method: 'GET',
auth: true,
debounce: 500, debounce: 500,
}, },
/** /**
@ -14,7 +13,6 @@ const api = {
addLogShareInfo: { addLogShareInfo: {
url: '/fen/addLog', url: '/fen/addLog',
method: 'POST', method: 'POST',
auth: true,
limit : 500, limit : 500,
showLoading : true, showLoading : true,
}, },
@ -44,7 +42,6 @@ const api = {
getVideoShareInfo: { getVideoShareInfo: {
url: '/fen/getVideoShareInfo', url: '/fen/getVideoShareInfo',
method: 'GET', method: 'GET',
auth: true,
debounce: 500, debounce: 500,
}, },
/** /**
@ -63,7 +60,6 @@ const api = {
getGroupShareInfo: { getGroupShareInfo: {
url: '/fen/getGroupShareInfo', url: '/fen/getGroupShareInfo',
method: 'GET', method: 'GET',
auth: true,
debounce: 500, debounce: 500,
}, },
/** /**
@ -82,7 +78,6 @@ const api = {
getArticleShareInfo: { getArticleShareInfo: {
url: '/fen/getArticleShareInfo', url: '/fen/getArticleShareInfo',
method: 'GET', method: 'GET',
auth: true,
debounce: 500, debounce: 500,
}, },
/** /**


+ 3
- 3
mixins/list.js View File

@ -47,9 +47,9 @@ export default {
*/ */
getData(queryParams){ getData(queryParams){
if(this.authApi && !uni.getStorageSync('token')){
return
}
if(this.authApi && !uni.getStorageSync('token')){
return
}
return new Promise((success, error) => { return new Promise((success, error) => {
if(!this.mixinsListApi){ if(!this.mixinsListApi){


+ 8
- 11
pages/index/center.vue View File

@ -148,7 +148,7 @@ export default {
return { return {
notice: '', notice: '',
mixinsListApi: 'getNews', mixinsListApi: 'getNews',
authApi : true,
authApi : false,
isLoggedIn : uni.getStorageSync('token'), isLoggedIn : uni.getStorageSync('token'),
} }
}, },
@ -159,12 +159,13 @@ export default {
}, },
}, },
onShow() { 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: { methods: {
async fetchNotice() { async fetchNotice() {
@ -190,10 +191,6 @@ export default {
return str.replace(/<.*?>/g, '') return str.replace(/<.*?>/g, '')
}, },
goToNewsDetail(id) { goToNewsDetail(id) {
if (!this.isLoggedIn) {
this.goToLogin()
return
}
uni.navigateTo({ uni.navigateTo({
url: `/pages_order/mine/news?id=${id}` url: `/pages_order/mine/news?id=${id}`
}) })


Loading…
Cancel
Save