feat: make additional data object
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
34df9cf254
commit
a5d032f022
|
@ -5,12 +5,10 @@ import qFormMixin from './qformMixin';
|
|||
import keyShortcut from './keyShortcut';
|
||||
import { i18n } from './i18n';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import { useVnConfirm } from 'src/composables/useVnConfirm';
|
||||
|
||||
const { notify } = useNotify();
|
||||
const stateQuery = useStateQueryStore();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
export default boot(({ app }) => {
|
||||
|
@ -53,13 +51,25 @@ export default boot(({ app }) => {
|
|||
message = 'Duplicate request';
|
||||
}
|
||||
|
||||
const { config, headers, request, status, statusText, data } = response || {};
|
||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||
const { message: resMessage, code, name } = data?.error || {};
|
||||
const additionalData = {
|
||||
frontPath: '',
|
||||
backError: {
|
||||
config: error.config,
|
||||
data: error,
|
||||
path: location.href,
|
||||
message: resMessage,
|
||||
code,
|
||||
request: request?.responseURL,
|
||||
status,
|
||||
name,
|
||||
statusText: statusText,
|
||||
config: {
|
||||
url,
|
||||
method,
|
||||
params,
|
||||
headers: confHeaders,
|
||||
aborted: signal.aborted,
|
||||
version: headers?.['salix-version'],
|
||||
},
|
||||
httpRequest: error.request.response,
|
||||
};
|
||||
const opts = {
|
||||
actions: [
|
||||
|
@ -72,9 +82,7 @@ export default boot(({ app }) => {
|
|||
handler: async () => {
|
||||
const locale = i18n.global.t;
|
||||
const reason = ref(
|
||||
response.data.error.code == 'ACCESS_DENIED'
|
||||
? locale('cau.askPrivileges')
|
||||
: ''
|
||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
||||
);
|
||||
openConfirmationModal(
|
||||
locale('cau.title'),
|
||||
|
|
Loading…
Reference in New Issue