login.js 377 B

12345678910111213141516
  1. import user from '../user/index';
  2. export default {
  3. methods: {
  4. routerLogin: function (callback,loginCallback) {
  5. if (user.isLogin()) {
  6. return callback && callback();
  7. }
  8. else {
  9. loginCallback && loginCallback();
  10. return this.$router.navigateTo('login');
  11. }
  12. }
  13. }
  14. }