goodrain / rainbond

No need to know Kubernetes' cloud native application management platform
https://www.rainbond.io
GNU Lesser General Public License v3.0
5.19k stars 790 forks source link

前端如何获取到从rainbond配置的环境变量 #2159

Closed quhongli123 closed 1 month ago

quhongli123 commented 1 month ago

请先确认以下事项:

问题描述

前端如何获取到从rainbond配置的环境变量

该问题是否可以稳定重现?

可重现

重现步骤

本地配置的环境变量可以正常访问到 但从rainbond配置的环境 线上是访问不到的

截图

Image

Image

日志

1

期望结果

可以获取到配置项

解决方案(可选)

No response

操作系统 && Rainbond 版本

V6.2

是否愿意提交 PR 解决该问题?

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: 🐞 Feedback question: Please fill in the title, do not leave it blank

zzzhangqi commented 1 month ago

@quhongli123 这应该是一个基础性问题,不属于 Rainbond 的问题

  1. 你在本地启动的时候实际上是 server 端,比如 npm start yarn start,这个时候是可以读取到本地环境变量的。
  2. 在 rainbond 上是打包后使用 nginx 部署的,打包后都是静态文件,一定是无法获取到系统环境变量的
Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@quhongli123 This should be a basic problem, not a Rainbond problem

  1. When you start locally, it is actually on the server side, such as npm start yarn start, and you can read the local environment variables at this time.
  2. It is deployed using nginx after packaging on rainbond. After packaging, it is static files, so it is definitely impossible to obtain the system environment variables.