41 lines
720 B
JavaScript
41 lines
720 B
JavaScript
import request from '@/utils/request';
|
|
|
|
|
|
function getCurrentTimestamp() {
|
|
return new Date().getTime();
|
|
}
|
|
export function login(data) {
|
|
return request({
|
|
url: '/auth/login',
|
|
method: 'post',
|
|
data,
|
|
headers: {
|
|
'Timestamp':getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|
|
|
|
export function getInfo(token) {
|
|
return request({
|
|
url: '/user/profile/get',
|
|
method: 'get',
|
|
// params: {token},
|
|
headers: {
|
|
'Authorization':'Bearer '+token,
|
|
'Timestamp': getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
export function logout(token) {
|
|
return request({
|
|
url: '/auth/logout',
|
|
method: 'get',
|
|
headers: {
|
|
'Authorization':'Bearer '+token,
|
|
'Timestamp': getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|