我是用微软身份认证,获取token,在头部加的client_id和client_secret,返回总是失败,用控制台程序调试却是成功的,求大神指导:
` axios.defaults.headers.common['Authorization'] ="Basic" +util.base64encode(config.client_id+":"+config.client_secret);
LoginForm: {
Username: 'admin',
Password: 'ddd88227793',
grant_type:'password'
}
requestLogin(_this.LoginForm).then(data => {
this.loading = false;
debugger
let { msg, code, user } = data;
if (code !== 200) {
this.$notify({
title: '错误',
message: msg,
type: 'error'
});
} else {
// sessionStorage.setItem('user', JSON.stringify(user));
this.$router.push({ path: '/Main' });
}
}).catch(function (error) {
console.log(error);
});`