Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | methods: { | ||||
if (!update) { | if (!update) { | ||||
store.commit('logoutUser') // destroy old state data | store.commit('logoutUser') // destroy old state data | ||||
store.commit('loginUser') | store.commit('loginUser') | ||||
} | } | ||||
localStorage.setItem('token', response.access_token) | localStorage.setItem('token', response.access_token) | ||||
axios.defaults.headers.common.Authorization = 'Bearer ' + response.access_token | axios.defaults.headers.common.Authorization = 'Bearer ' + response.access_token | ||||
if (response.email) { | |||||
store.state.authInfo = response | |||||
} | |||||
if (dashboard !== false) { | if (dashboard !== false) { | ||||
this.$router.push(store.state.afterLogin || { name: 'dashboard' }) | this.$router.push(store.state.afterLogin || { name: 'dashboard' }) | ||||
} | } | ||||
store.state.afterLogin = null | store.state.afterLogin = null | ||||
// Refresh the token before it expires | // Refresh the token before it expires | ||||
let timeout = response.expires_in || 0 | let timeout = response.expires_in || 0 | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | methods: { | ||||
cost = Math.floor(cost * ((100 - discount) / 100)) | cost = Math.floor(cost * ((100 - discount) / 100)) | ||||
index = '\u00B9' | index = '\u00B9' | ||||
} | } | ||||
return this.price(cost * units) + '/month' + index | return this.price(cost * units) + '/month' + index | ||||
}, | }, | ||||
clickRecord(event) { | clickRecord(event) { | ||||
if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | if (!/^(a|button|svg|path)$/i.test(event.target.nodeName)) { | ||||
$(event.target).closest('tr').find('a')[0].click() | let link = $(event.target).closest('tr').find('a')[0] | ||||
if (link) { | |||||
link.click() | |||||
} | |||||
} | } | ||||
}, | }, | ||||
domainStatusClass(domain) { | domainStatusClass(domain) { | ||||
if (domain.isDeleted) { | if (domain.isDeleted) { | ||||
return 'text-muted' | return 'text-muted' | ||||
} | } | ||||
if (domain.isSuspended) { | if (domain.isSuspended) { | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |