1234567891011121314151617181920212223 |
- 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
|