You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
389 B
JavaScript
25 lines
389 B
JavaScript
import {
|
|
getGlobalData
|
|
} from '@/store/index.js'
|
|
const back = () => {
|
|
const pages = getCurrentPages()
|
|
if (pages.length === 1) {
|
|
uni.reLaunch({
|
|
url: '/pages/workbench/index'
|
|
})
|
|
} else {
|
|
uni.navigateBack()
|
|
}
|
|
}
|
|
const push = (a, b) => {
|
|
let routeList = getGlobalData('route')
|
|
let type = b || 1
|
|
if (type === 1) {
|
|
uni.navigateTo(a)
|
|
}
|
|
}
|
|
|
|
export const router = {
|
|
back,
|
|
push
|
|
} |