|
|
@ -27,6 +27,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { setToken } from '@/utils/auth' |
|
|
import { setToken } from '@/utils/auth' |
|
|
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'SSOLogin', |
|
|
name: 'SSOLogin', |
|
|
@ -37,6 +38,11 @@ export default { |
|
|
message: '' |
|
|
message: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
...mapGetters([ |
|
|
|
|
|
'baseApi' |
|
|
|
|
|
]) |
|
|
|
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.handleAutoLogin() |
|
|
this.handleAutoLogin() |
|
|
}, |
|
|
}, |
|
|
@ -57,7 +63,7 @@ export default { |
|
|
console.log('token', token) |
|
|
console.log('token', token) |
|
|
|
|
|
|
|
|
// 发起登录请求 |
|
|
// 发起登录请求 |
|
|
fetch('/api/sso/auto-login', { |
|
|
|
|
|
|
|
|
fetch(this.baseApi + '/api/sso/auto-login', { |
|
|
method: 'POST', |
|
|
method: 'POST', |
|
|
headers: { |
|
|
headers: { |
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
|