This commit is contained in:
zhutianqi
2021-08-24 20:13:37 +08:00
parent 3bdafc9d3d
commit 2a945201c2
+29
View File
@@ -27,6 +27,7 @@
<script>
import { mapMutations, mapActions } from 'vuex'
import axios from 'axios'
export default {
name: 'Login',
data () {
@@ -292,6 +293,34 @@ export default {
computed: {
},
mounted () {
let url = window.location.search
if (url) {
url = url.substr(1);
url = url.split('&');
let info = [];
let obj = {};
for (let i = 0,len = url.length; i < len; i++) {
info = url[i].split('=')
obj[info[0]] = decodeURI(info[1]);
url[i] = obj;
}
var code = url[0].code
axios.post('http://testsso1.foton.com.cn/oauth2.0/accessTokenByJson',
{
client_id: 'app_slrs',
client_secret: 'wj5iDTqyguQCxnsoo5VU21BoRSZqevhI',
grant_type: 'authorization_code',
redirect_uri: 'http://62.234.136.153:8038',
code: code
}
).then(function (response) {
console.log(response);
}).catch(function (error) {
console.log(error);
});
} else {
}
if (this.$store.state.laws_urm !== '') {
this.isRemember = true
}