1

res.response.data.message выдает undefuned в data даже так ошибка

typeof res.response.data.message === 'undefined' ? ' res.response.data.message ' : 'error'

Unhandled Rejection (TypeError): Cannot read property 'data' of undefined

1 ответ 1

1
var useMessage = res && res.response && res.response.data && 
  typeof res.response.data.message != 'undefined';
var message = useMessage ? res.response.data.message : 'error';

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.