상점을로드 할 때마다 내부 서버 500 오류가 계속 발생합니다. 현재 필요한 데이터가 포함 된 API 끝점에 연결하려고합니다. 이 (빈 것 같다, '적용'헤더를 확인, 참고로 내가 올바르게에 연결하기 위해 거기에 application/json
을 가질 수있는 방법을 모르겠습니다.) 나는 모든 시간을지고있어 오류입니다 :ExtJS 4.2 - 상점로드시 내부 서버 오류 500
내 가게는이 같은 설정입니다 :
Ext.define('EcommBackoffice.store.TierCapacity', {
extend: 'Ext.data.Store',
model: 'EcommBackoffice.model.TierCapacityModel',
storeId: 'tier-capacity-id',
autoLoad: true,
sorters: [{
property: 'name',
direction: 'ASC'
}],
proxy: {
type: 'rest',
url: EcommBackoffice.Global.getAPIEndPoints().tier_capacity + '?siteCode=bgp88',
reader: {
type: 'json',
root: ''
},
listeners: {
exception: function(proxy, response, op) {
if (response.status === 403 || response.status === 401) return; /*skip this exception handler and check App exception handler*/
Ext.Msg.alert('ERROR', response.responseText + ' ' + response.statusText);
}
}
}
});
그리고 이런 내 모델 :
Ext.define('EcommBackoffice.model.TierCapacityModel', {
extend: 'Ext.data.Model',
fields: [{
name: 'id'
}, {
name: 'paymentOption',
type: Ext.data.SortTypes.asUCString
}, {
name: 'tier',
type: Ext.data.SortTypes.asUCString
}, {
name: 'media',
type: Ext.data.SortTypes.asUCString
}, {
name: 'channels',
type: Ext.data.SortTypes.asUCString
}]
});
API는 다음과 같은 것이 포함되어 있습니다 :
[{
"name": "DEBIT",
"tiers": [{
"name": "Default",
"media": [{
"name": "OFFICE",
"channels": [{
"name": "CHANNEL-001",
"currentVolume": 0,
"maxVolume": 0,
"yesterdayVolume": 0
}]
}]
}]
}]
또한 모델과 상점 설정에 익숙하지 않습니다. 나는 그것이 내가 놓치고있는 곳이라고 생각하고있다. API 응답을 기반으로 모델을 올바르게 구성하고 있습니까? 나는 문서를 읽으려고했으나 나는 여전히 내 머리를 감쌀 수 없다.