fix(公共连接): 移动端无法返回上一级

This commit is contained in:
fit2cloud-chenyw 2023-01-06 12:33:38 +08:00
parent 4a2f127b86
commit 90f52b54da
2 changed files with 14 additions and 1 deletions

View File

@ -14,6 +14,7 @@
<el-button
v-if="!isNewBlank"
size="mini"
type="button"
@click="back2Last"
><span><svg-icon
style="width: 12px;height: 12px"
@ -53,6 +54,7 @@
<script>
import { mapState } from 'vuex'
import { isMobile } from '@/utils'
import bus from '@/utils/bus'
export default {
@ -103,7 +105,16 @@ export default {
bus.$emit('clear_panel_linkage', { viewId: 'all' })
},
back2Last() {
this.$router.back(-1)
if (isMobile()) {
let parentUrl = window.location.href
parentUrl = localStorage.getItem('beforeJumpUrl')
localStorage.removeItem('beforeJumpUrl')
window.location.href = parentUrl
window.location.reload()
return false
} else {
this.$router.back(-1)
}
},
exportPDF() {
this.$refs['widget-div'].style.display = ''

View File

@ -974,6 +974,8 @@ export default {
// ID
if (jumpInfo.publicJumpId) {
const url = '/link/' + jumpInfo.publicJumpId
const currentUrl = window.location.href
localStorage.setItem('beforeJumpUrl', currentUrl)
this.windowsJump(url, jumpInfo.jumpType)
} else {
this.$message({