Commit 06d8d6ce authored by lijiongliang's avatar lijiongliang

修改token过期问题

新增跳转第三方页面
parent 90267245
// const baseUrl = 'https://jduniapp.uzosp.com/test-api';
const baseUrl = 'http://sx2zq2.natappfree.cc';
const baseUrl = 'https://jduniapp.uzosp.com/test-api';
// const baseUrl = 'http://64qycp.natappfree.cc';
const httpRequest = (opts, data) => {
let httpDefaultOpts = {
url: baseUrl + opts.url,
......@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
if(res[1].data.code == 401){
uni.removeStorageSync('userToken')
uni.navigateTo({
url:"/pages/binding/index"
url:"/pages/binding/index?failure=401"
})
return;
}
......
......@@ -24,6 +24,13 @@
"style": {
"navigationBarTitleText": "绑定友众账号"
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"subPackages": [
......
......@@ -62,6 +62,7 @@ export default {
superiorUrl: '/pages/main',
//上级路径参数
superiorParam: "index",
failure:null
};
},
methods: {
......@@ -153,15 +154,18 @@ export default {
opts = { url: '/app/user/check/move/code', method: 'post' }
that.http.httpTokenRequest(opts, param).then(res => {
if (res.data.code == 200) {
if(res.data.data.bindFlag) {
that.gotoMoveCar();
} else {
that.gotoBindMoveCar();
}
if(res.data.data.bindFlag) {
that.gotoMoveCar();
} else {
that.gotoBindMoveCar();
}
}
})
} else {
} else if(this.failure == 401 ){
uni.navigateBack()
return
} else {
that.gotoIndex()
}
......@@ -214,6 +218,7 @@ export default {
},
onLoad(e) { //默认加载
let openid = uni.getStorageSync('openid');
this.failure = e.failure
if(!openid) {
this.wechatLogin()
} else {
......
......@@ -26,7 +26,7 @@
<div class="shop__list__one">
<div class="view__title">车主精选 养车必备</div>
<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">
<image :src="getImage(vo.mainImgUrl)" />
</view>
......@@ -154,7 +154,13 @@ export default {
url: '/pagesC/pages/shop/search'
})
},
goDetail(id) {
goDetail(id,link) {
if(link){
uni.navigateTo({
url: '/pages/webview/webview?url=' + link
})
return
}
uni.navigateTo({
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