Commit 06d8d6ce authored by lijiongliang's avatar lijiongliang

修改token过期问题

新增跳转第三方页面
parent 90267245
// const baseUrl = 'https://jduniapp.uzosp.com/test-api'; const baseUrl = 'https://jduniapp.uzosp.com/test-api';
const baseUrl = 'http://sx2zq2.natappfree.cc'; // const baseUrl = 'http://64qycp.natappfree.cc';
const httpRequest = (opts, data) => { const httpRequest = (opts, data) => {
let httpDefaultOpts = { let httpDefaultOpts = {
url: baseUrl + opts.url, url: baseUrl + opts.url,
...@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => { ...@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
if(res[1].data.code == 401){ if(res[1].data.code == 401){
uni.removeStorageSync('userToken') uni.removeStorageSync('userToken')
uni.navigateTo({ uni.navigateTo({
url:"/pages/binding/index" url:"/pages/binding/index?failure=401"
}) })
return; return;
} }
......
...@@ -24,6 +24,13 @@ ...@@ -24,6 +24,13 @@
"style": { "style": {
"navigationBarTitleText": "绑定友众账号" "navigationBarTitleText": "绑定友众账号"
} }
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
], ],
"subPackages": [ "subPackages": [
......
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
superiorUrl: '/pages/main', superiorUrl: '/pages/main',
//上级路径参数 //上级路径参数
superiorParam: "index", superiorParam: "index",
failure:null
}; };
}, },
methods: { methods: {
...@@ -161,6 +162,9 @@ export default { ...@@ -161,6 +162,9 @@ export default {
} }
}) })
} else if(this.failure == 401 ){
uni.navigateBack()
return
} else { } else {
that.gotoIndex() that.gotoIndex()
} }
...@@ -214,6 +218,7 @@ export default { ...@@ -214,6 +218,7 @@ export default {
}, },
onLoad(e) { //默认加载 onLoad(e) { //默认加载
let openid = uni.getStorageSync('openid'); let openid = uni.getStorageSync('openid');
this.failure = e.failure
if(!openid) { if(!openid) {
this.wechatLogin() this.wechatLogin()
} else { } else {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="shop__list__one"> <div class="shop__list__one">
<div class="view__title">车主精选 养车必备</div> <div class="view__title">车主精选 养车必备</div>
<view class="owner-select" v-if="boutiqueMallList.length > 0"> <view class="owner-select" v-if="boutiqueMallList.length > 0">
<view class="one_item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id)"> <view class="one_item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id,vo.link)">
<view class="one_item_img"> <view class="one_item_img">
<image :src="getImage(vo.mainImgUrl)" /> <image :src="getImage(vo.mainImgUrl)" />
</view> </view>
...@@ -154,7 +154,13 @@ export default { ...@@ -154,7 +154,13 @@ export default {
url: '/pagesC/pages/shop/search' url: '/pagesC/pages/shop/search'
}) })
}, },
goDetail(id) { goDetail(id,link) {
if(link){
uni.navigateTo({
url: '/pages/webview/webview?url=' + link
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/pages/shop/detail?id=' + id url: '/pagesC/pages/shop/detail?id=' + id
}) })
......
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
url:''
}
},
onLoad(e) {
console.log(e.url,111111)
this.url = e.url
},
methods: {
}
}
</script>
<style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment