diff --git a/common/api.js b/common/api.js index 3dc46e9..1956b45 100644 --- a/common/api.js +++ b/common/api.js @@ -2,14 +2,14 @@ const http = uni.$u.http //用户信息 export const UserInfo = (params, config = {}) => http.post('/user/getinfo', params, config); //上传base64 -export const uploadBase64 = (params, config = {}) => http.post('/index/uploads', params, config); +export const uploadBase64 = (params, config = {custom: { auth: true }}) => http.post('/index/uploads', params, config); //微信登录 export const wxapplogin= (params, config = {}) => http.post('/user/wxapplogin', params, config); //修改用户信息 export const profileUser= (params, config = {}) => http.post('/user/profile', params, config); //获取首页轮播图 -export const getBanner = (params, config = {}) => http.post('/wx_adv/index', params, config); +export const getBanner = (params, config = {custom: { auth: true }}) => http.post('/wx_adv/index', params, config); //协议 export const getRichText = (params, config = {}) => http.post('/shopro_richtext/view', params, config); //获取验证码 @@ -17,13 +17,13 @@ export const getsmsCode = (params, config = {}) => http.post('/sms/send', params //手机验证码登录 export const mobileLogin = (params, config = {}) => http.post('/user/mobilelogin', params, config); //首页菜单导航 -export const indexNav = (params, config = {}) => http.post('/wx_menu/index', params, config); +export const indexNav = (params, config = {custom: { auth: true }}) => http.post('/wx_menu/index', params, config); // APP下载地址 export const downloadApp = (params, config = {}) => http.post('/app_url/index', params, config); //上传图片 export const uploadPic = (params, config = {}) => http.post('/index/upload', params, config); //列表数据 -export const listData = (params, config = {}) => http.post('/wx_category/index', params, config); +export const listData = (params, config = {custom: { auth: true }}) => http.post('/wx_category/index', params, config); //文章详情 export const articleDetails = (params, config = {}) => http.post('/wx_article/view', params, config); //收藏记录 @@ -37,9 +37,9 @@ export const lookRecord = (params, config = {}) => http.post('/wx_article_view/i //添加分享 export const addShare = (params, config = {}) => http.post('/wx_article_share/add', params, config); //退出登录 -export const logout = (params, config = {}) => http.post('/user/logout', params, config); +export const logout = (params, config = {custom: { auth: true }}) => http.post('/user/logout', params, config); //文章列表 -export const articalList = (params, config = {}) => http.post('/wx_article/index', params, config); +export const articalList = (params, config = {custom: { auth: true }}) => http.post('/wx_article/index', params, config); diff --git a/common/http.interceptor.js b/common/http.interceptor.js index d73a5a8..08e459a 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -51,8 +51,6 @@ module.exports = (vm) => { // 自定义参数 const custom = response.config?.custom - - console.log(11,data) if (data.code !== 1) { // 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示 // if (custom.toast !== false) { @@ -80,7 +78,6 @@ module.exports = (vm) => { return data.data === undefined ? {} : data.data }, (response) => { - console.log(response,"ld") if(response.data.code==401){ uni.navigateTo({ url:'/pages/login/login' diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index 26a66ae..ff95975 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -116,7 +116,7 @@ scene:'WXSceneSession',//provider 为 weixin 时必选 WXSceneSession分享到聊天界面,WXSceneTimeline分享到朋友圈,WXSceneFavorite分享到微信收藏 title:this.titleInfo.title,//分享内容的标题 summary:this.titleInfo.title,//分享内容的摘要 - href:`http://lxwx.njrenzhou.cn/#/${routes}?id=${this.titleInfo.wx_category_id}`,//跳转链接,type 为 0 时必选 + href:`http://lxwx.h5.njrenzhou.cn/#/${routes}?id=${this.titleInfo.wx_category_id}`,//跳转链接,type 为 0 时必选 imageUrl:`http://lxwx.njrenzhou.cn${this.titleInfo.listimage}`,//图片地址,type 为 0、2、5 时必选 success(res) { //成功返回的参数 diff --git a/pages/index/index.vue b/pages/index/index.vue index 1256c64..5b29f2d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -5,7 +5,7 @@ 首页 - + { this.list = res.rows }) }, diff --git a/pages/index/searchPage.vue b/pages/index/searchPage.vue index 4d021e9..d8fea3e 100644 --- a/pages/index/searchPage.vue +++ b/pages/index/searchPage.vue @@ -126,7 +126,8 @@ export default{ page:this.page, limit:this.limit, wx_category_id:this.wx_category_id, - sort:'weigh' + sort:'weigh', + order:'desc' } listData(params).then(res=>{ if(res.searchList.length==0){ diff --git a/pages/login/login.vue b/pages/login/login.vue index 4336a85..9f0e3d3 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -45,7 +45,6 @@ }, onShow() { let info = JSON.parse(JSON.stringify(uni.getStorageSync('userInfo'))) - console.log(info,"9999") if(info){ uni.switchTab({ url:'/pages/index/index' diff --git a/pages/my/my.vue b/pages/my/my.vue index 8c08e41..85d8e31 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -98,10 +98,13 @@ }, layoutHandle(){ logout({ custom: { auth: true }}).then(res=>{ + console.log("success") this.$store.commit('logout') - uni.switchTab({ - url:'/pages/index/index' + uni.navigateTo({ + url:'/pages/login/login' }) + }).catch((error)=>{ + console.log(error) }) }