| 12345678910111213141516171819 |
- /*
- import axios from 'axios'
- export default function ({ app, store, route, res, req , redirect}) {
- // If nuxt generate, pass this middleware
- if (!store.state.option.user.logged) {
- const baseUrl = 'http://' + req.headers.host
- return app.$axios.get('/sso/login',{params:{returnUrl: baseUrl}}).then(response => {
- store.commit('login')
- if (response.data) {
- redirect(response.data.content)
- // console.log(response.data.content + '&baseUrl=' + encodeURIComponent(baseUrl))
- }
- }).catch(error => {
- console.log('error',error)
- })
- }
- }
- */
|