You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CoreID/app/services/Vue.service.js

36 lines
885 B

const { Service } = require('flitter-di')
class VueService extends Service {
static get services() {
return [...super.services, 'configs']
}
data(merge = {}) {
return {
vue_state: {
app_name: this.configs.get('app.name'),
app_url: this.configs.get('app.url'),
...merge
}
}
}
auth_message(res, {message, next_destination, ...args}) {
const text = args.button_text || 'Continue'
return res.page('public:message', {
...this.data({
message,
actions: [
{
text,
action: 'redirect',
next: next_destination,
}
],
})
})
}
}
module.exports = exports = VueService