簡體   English   中英

為 Azure ABP.IO React 移動應用程序設置環境變量

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

我已經創建並將 abp.io 項目部署到 Azure。 我已經成功創建了 DB 和 Web 應用程序。

現在我正在探索 React 移動前端。 我試圖將 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得到如下所示的相同錯誤。

本地主機錯誤:

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 錯誤:

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

我有同樣的問題,我做了以下事情:

  1. 使用 HTTP,而不是 HTTPS [我認為這可能會解決您的 azure 問題]
  2. 使用Conveyor為我的本地 web 應用程序獲取 URL 而不是使用本地主機,因為本地主機沒有為移動設備定義

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM