mixins.js 410 B

123456789101112131415161718192021222324
  1. import Vue from 'vue'
  2. Vue.mixin({
  3. data: function () {
  4. return {
  5. appVersion: window.appVersion
  6. }
  7. },
  8. methods: {
  9. async appLogout(evt) {
  10. await this.axios.get('/user/logout')
  11. this.$storage.clear()
  12. delete this.axios.defaults.headers.common['Authorization']
  13. this.$router.push({ name: 'login' })
  14. },
  15. }
  16. })