简体   繁体   English

为 Azure ABP.IO React 移动应用程序设置环境变量

[英]Setting up Environment Variables for Azure ABP.IO React Mobile App

I have created and deployed the abp.io project to Azure.我已经创建并将 abp.io 项目部署到 Azure。 I have created the DB and Web app successfully.我已经成功创建了 DB 和 Web 应用程序。

Now I exploring the React mobile front end.现在我正在探索 React 移动前端。 I am attempting to point the React app at localhost or the Azure server.我试图将 React 应用程序指向 localhost 或 Azure 服务器。

I have set the environment variables 'apiUrl' and 'issuer' to my IP and my azure website based on the documentation( https://docs.abp.io/en/abp/latest/Getting-Started-React-Native ) and get the same error shown below. I have set the environment variables 'apiUrl' and 'issuer' to my IP and my azure website based on the documentation( https://docs.abp.io/en/abp/latest/Getting-Started-React-Native ) and得到如下所示的相同错误。

Localhost Error:本地主机错误:

Network Error

The above error occurred in task fetchAppConfig
    created by takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
    created by _callee
    created by rootSaga
Tasks cancelled due to error:
takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
takeLatest(app/setLanguageAsync, setLanguage)
takeLatest(app/logoutAsync, logout)

Azure Error: Azure 错误:

Request failed with status code 500
- node_modules\axios\lib\core\createError.js:15:17 in createError
- node_modules\axios\lib\core\settle.js:16:9 in settle
- node_modules\axios\lib\adapters\xhr.js:53:6 in handleLoad
- node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
- node_modules\react-native\Libraries\Network\XMLHttpRequest.js:592:4 in setReadyState
- node_modules\react-native\Libraries\Network\XMLHttpRequest.js:395:6 in __didCompleteResponse   
- node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0  
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

The above error occurred in task fetchAppConfig
    created by takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
    created by _callee
    created by rootSaga
Tasks cancelled due to error:
takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
takeLatest(app/setLanguageAsync, setLanguage)
takeLatest(app/logoutAsync, logout)

Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`
.
.
.
* [native code]:null in callFunctionReturnFlushedQueue

I had the same problem And I did the following:我有同样的问题,我做了以下事情:

  1. Using HTTP, not HTTPS [I think this may solve your problem with azure]使用 HTTP,而不是 HTTPS [我认为这可能会解决您的 azure 问题]
  2. Using Conveyor to get a URL for my local web app instead of using localhost as the localhost is not defined for the mobile使用Conveyor为我的本地 web 应用程序获取 URL 而不是使用本地主机,因为本地主机没有为移动设备定义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM