axios({
method: 'post',
url: '/zhuang/token',
data: get,
}).then(function(data){
ling=data.data.data.access_token;
console.log(data);
setTimeout(function(){
console.log(ling);
//发送注册请求
let name=that.name
let password=that.password
let date={
"registered_method": "mobile",
"mobile": name,
"password": password
};
axios({
method: 'post',
url: '/zhuang/users',
data: date,
headers: {Authorization:"Bearer "+ling}
}).then(function(data){
alert('注册成功,请登录');
that.name='';
that.password='';
},function(){
alert('注册失败')
});
},1000)
})