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 <el-button
v-if="!isNewBlank" v-if="!isNewBlank"
size="mini" size="mini"
type="button"
@click="back2Last" @click="back2Last"
><span><svg-icon ><span><svg-icon
style="width: 12px;height: 12px" style="width: 12px;height: 12px"
@ -53,6 +54,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { isMobile } from '@/utils'
import bus from '@/utils/bus' import bus from '@/utils/bus'
export default { export default {
@ -103,7 +105,16 @@ export default {
bus.$emit('clear_panel_linkage', { viewId: 'all' }) bus.$emit('clear_panel_linkage', { viewId: 'all' })
}, },
back2Last() { 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() { exportPDF() {
this.$refs['widget-div'].style.display = '' this.$refs['widget-div'].style.display = ''

View File

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