42 lines
773 B
JavaScript
42 lines
773 B
JavaScript
import request from '@/utils/request';
|
|
|
|
const api = 'http://nbxt.oa.x-lf.cn'
|
|
|
|
function getCurrentTimestamp() {
|
|
return new Date().getTime();
|
|
}
|
|
export function login(data) {
|
|
return request({
|
|
url: api+ '/auth/login',
|
|
method: 'post',
|
|
data,
|
|
headers: {
|
|
'Timestamp':getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|
|
|
|
export function getInfo(token) {
|
|
return request({
|
|
url: api +'/user/profile/get',
|
|
method: 'get',
|
|
// params: {token},
|
|
headers: {
|
|
'Authorization':'Bearer '+token,
|
|
'Timestamp': getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
export function logout(token) {
|
|
return request({
|
|
url: api +'/auth/logout',
|
|
method: 'get',
|
|
headers: {
|
|
'Authorization':'Bearer '+token,
|
|
'Timestamp': getCurrentTimestamp()
|
|
}
|
|
});
|
|
}
|