|
|
@@ -272,36 +272,25 @@ export default {
|
|
|
btnLinkBack() {
|
|
|
clearInterval(this.codeMess.t)
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
+ let { go, replace, to } = this.$route.query
|
|
|
+ if (replace) {
|
|
|
+ location.replace(decodeURIComponent(replace))
|
|
|
+ } else if (to) {
|
|
|
+ location.href = decodeURIComponent(to)
|
|
|
+ } else if (go) {
|
|
|
+ this.$router.go(go)
|
|
|
+ }
|
|
|
+ else if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
//ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
wx.miniProgram.getEnv((res) => {
|
|
|
if (res.miniprogram) {
|
|
|
// 在小程序里
|
|
|
console.log('miniprogram')
|
|
|
wx.miniProgram.switchTab({ url: '/pages/index/index' })
|
|
|
- } else {
|
|
|
- // 不在小程序里
|
|
|
- console.log('micromessenger')
|
|
|
- let { go, replace, to } = this.$route.query
|
|
|
- if (replace) {
|
|
|
- location.replace(decodeURIComponent(replace))
|
|
|
- } else if (to) {
|
|
|
- location.href = decodeURIComponent(to)
|
|
|
- } else {
|
|
|
- this.$router.go(go || -1)
|
|
|
- }
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- console.log('browser')
|
|
|
- let { go, replace, to } = this.$route.query
|
|
|
- if (replace) {
|
|
|
- location.replace(decodeURIComponent(replace))
|
|
|
- } else if (to) {
|
|
|
- location.href = decodeURIComponent(to)
|
|
|
- } else {
|
|
|
- this.$router.go(go || -1)
|
|
|
- }
|
|
|
+ this.$router.go(-1)
|
|
|
}
|
|
|
}
|
|
|
}
|