mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
support transaction pictures
This commit is contained in:
@@ -41,6 +41,10 @@ export function isUserVerifyEmailEnabled() {
|
||||
return getServerSetting('v') === '1';
|
||||
}
|
||||
|
||||
export function isTransactionPicturesEnabled() {
|
||||
return getServerSetting('p') === '1';
|
||||
}
|
||||
|
||||
export function isUserScheduledTransactionEnabled() {
|
||||
return getServerSetting('s') === '1';
|
||||
}
|
||||
|
||||
@@ -443,6 +443,11 @@ export default {
|
||||
clientSessionId: clientSessionId
|
||||
});
|
||||
},
|
||||
removeUnusedTransactionPicture: ({ id }) => {
|
||||
return axios.post('v1/transaction/pictures/remove_unused.json', {
|
||||
id
|
||||
});
|
||||
},
|
||||
getAllTransactionCategories: () => {
|
||||
return axios.get('v1/transaction/categories/list.json');
|
||||
},
|
||||
@@ -651,5 +656,27 @@ export default {
|
||||
} else {
|
||||
return avatarUrl + '?' + params.join('&');
|
||||
}
|
||||
},
|
||||
getTransactionPictureUrlWithToken(pictureUrl, disableBrowserCache) {
|
||||
if (!pictureUrl) {
|
||||
return pictureUrl;
|
||||
}
|
||||
|
||||
const params = [];
|
||||
params.push('token=' + userState.getToken());
|
||||
|
||||
if (disableBrowserCache) {
|
||||
if (isBoolean(disableBrowserCache)) {
|
||||
params.push('_nocache=' + generateRandomUUID());
|
||||
} else {
|
||||
params.push('_nocache=' + disableBrowserCache);
|
||||
}
|
||||
}
|
||||
|
||||
if (pictureUrl.indexOf('?') >= 0) {
|
||||
return pictureUrl + '&' + params.join('&');
|
||||
} else {
|
||||
return pictureUrl + '?' + params.join('&');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,6 +165,11 @@ export function setTransactionModelByTransaction(transaction, transaction2, allC
|
||||
|
||||
transaction.hideAmount = transaction2.hideAmount;
|
||||
transaction.tagIds = transaction2.tagIds || [];
|
||||
|
||||
if (setContextData) {
|
||||
transaction.pictures = transaction2.pictures || [];
|
||||
}
|
||||
|
||||
transaction.comment = transaction2.comment;
|
||||
|
||||
if (setContextData) {
|
||||
|
||||
Reference in New Issue
Block a user