0

我有一个功能,可以在其中加载给定的用户对话。它一直没有故障,直到今天早上我开始收到此错误消息

未处理的拒绝(NotAllowedError):在当前上下文中,用户代理或平台不允许请求,可能是因为用户拒绝了权限。

这是我的功能

async function init_chat(){
  let conversations = await api_call_based_on_jwt('/chat/get_user_conversations.php');

  store.dispatch( set_conversations(conversations) ); 

  if(conversations.length > 0){
    store.dispatch( sort_conversations() );
    store.dispatch(set_conversation( find_conversation(conversations, store.getState().chat.conversations[0].conversation_id) ));
  }
}

设置对话

export const set_conversations = (conversations) => ({
  type : SET_CONVERSATIONS,
  payload : conversations
});

以前有没有其他人遇到过这个问题?

store.dispatch(set_conversations(conversations)) 是导致问题的原因

4

0 回答 0