import Navi from './navi' import { getUser } from './util' const checkauth = Behavior({ methods: { afterAuth(callback: Function) { const info = getUser() const self = this if (info != null) { callback && callback() } else { self.gotoLogin() } }, gotoLogin() { Navi.navigateTo({ url: '/pages/login/index', }) }, }, }) export default checkauth