mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
move query parameter utc_offset to header
This commit is contained in:
+5
-7
@@ -16,6 +16,8 @@ axios.interceptors.request.use(config => {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
config.headers['X-Timezone-Offset'] = utils.getTimezoneOffsetMinutes();
|
||||
|
||||
if (needBlockRequest && !config.ignoreBlocked) {
|
||||
return new Promise(resolve => {
|
||||
blockedRequests.push(newToken => {
|
||||
@@ -251,12 +253,10 @@ export default {
|
||||
});
|
||||
},
|
||||
getTransactions: ({ maxTime, minTime, type, categoryId, accountId, keyword }) => {
|
||||
const utcOffset = utils.getTimezoneOffsetMinutes();
|
||||
return axios.get(`v1/transactions/list.json?max_time=${maxTime}&min_time=${minTime}&type=${type}&category_id=${categoryId}&account_id=${accountId}&keyword=${keyword}&count=50&utc_offset=${utcOffset}`);
|
||||
return axios.get(`v1/transactions/list.json?max_time=${maxTime}&min_time=${minTime}&type=${type}&category_id=${categoryId}&account_id=${accountId}&keyword=${keyword}&count=50`);
|
||||
},
|
||||
getTransaction: ({ id }) => {
|
||||
const utcOffset = utils.getTimezoneOffsetMinutes();
|
||||
return axios.get(`v1/transactions/get.json?id=${id}&utc_offset=${utcOffset}`);
|
||||
return axios.get(`v1/transactions/get.json?id=${id}`);
|
||||
},
|
||||
addTransaction: ({ type, categoryId, time, sourceAccountId, destinationAccountId, sourceAmount, destinationAmount, tagIds, comment, utcOffset }) => {
|
||||
return axios.post('v1/transactions/add.json', {
|
||||
@@ -288,10 +288,8 @@ export default {
|
||||
});
|
||||
},
|
||||
deleteTransaction: ({ id }) => {
|
||||
const utcOffset = utils.getTimezoneOffsetMinutes();
|
||||
return axios.post('v1/transactions/delete.json', {
|
||||
id,
|
||||
utcOffset
|
||||
id
|
||||
});
|
||||
},
|
||||
getAllTransactionCategories: () => {
|
||||
|
||||
@@ -491,6 +491,7 @@ export default {
|
||||
'operation failed': 'Operation failed',
|
||||
'nothing will be updated': 'Nothing will be updated',
|
||||
'failed to request third party api': 'Failed to request third party api',
|
||||
'client timezone offset is invalid': 'Client timezone offset is invalid',
|
||||
'user id is invalid': 'User ID is invalid',
|
||||
'username is empty': 'Username is empty',
|
||||
'email is empty': 'Email is empty',
|
||||
|
||||
@@ -491,6 +491,7 @@ export default {
|
||||
'operation failed': '操作失败',
|
||||
'nothing will be updated': '没有内容更新',
|
||||
'failed to request third party api': '请求第三方接口失败',
|
||||
'client timezone offset is invalid': '客户端时区时间差异无效',
|
||||
'user id is invalid': '用户ID无效',
|
||||
'username is empty': '用户名为空',
|
||||
'email is empty': '电子邮箱为空',
|
||||
|
||||
Reference in New Issue
Block a user