2020-10-08 14:48:18 +02:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
Vue.mixin({
|
|
|
|
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
appVersion: window.appVersion
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
async appLogout(evt) {
|
|
|
|
|
2021-10-22 14:18:13 +02:00
|
|
|
await this.axios.get('/user/logout')
|
2020-10-08 14:48:18 +02:00
|
|
|
|
2020-11-26 20:41:02 +01:00
|
|
|
this.$storage.clear()
|
2020-10-08 14:48:18 +02:00
|
|
|
delete this.axios.defaults.headers.common['Authorization']
|
|
|
|
|
|
|
|
this.$router.push({ name: 'login' })
|
|
|
|
},
|
2021-10-29 17:12:58 +02:00
|
|
|
|
|
|
|
exitSettings: function(event) {
|
|
|
|
if (event) {
|
|
|
|
this.$notify({ clean: true })
|
|
|
|
this.$router.push({ name: 'accounts' })
|
|
|
|
}
|
2021-11-08 22:33:32 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
isUrl: function (url) {
|
|
|
|
var strRegex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/
|
|
|
|
var re = new RegExp(strRegex)
|
|
|
|
|
|
|
|
return re.test(url)
|
|
|
|
},
|
|
|
|
|
|
|
|
openInBrowser(uri) {
|
|
|
|
const a = document.createElement('a')
|
|
|
|
a.setAttribute('href', uri)
|
|
|
|
a.dispatchEvent(new MouseEvent("click", {'view': window, 'bubbles': true, 'cancelable': true}))
|
2021-10-29 17:12:58 +02:00
|
|
|
}
|
2020-10-08 14:48:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
})
|