mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-10 03:16:49 +08:00
build: 添加环境变量替换并优化服务 URL 配置
- 在 risk_history.html 中添加环境变量占位符,构建时将被实际值替换 - 引入VUE_APP_ADMIN 环境变量作为服务 URL 的一部分 -优化 employRecord 组件中服务 URL 的处理逻辑
This commit is contained in:
@@ -377,6 +377,23 @@
|
|||||||
|
|
||||||
<script src="ajax.js"></script>
|
<script src="ajax.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
// 将这里替换为环境变量占位符,构建时会被实际值替换
|
||||||
|
var process = {
|
||||||
|
env: {
|
||||||
|
NODE_ENV: '<%= process.env.NODE_ENV %>',
|
||||||
|
VUE_APP_ADMIN: '<%= process.env.VUE_APP_ADMIN %>'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是开发环境,设置默认值
|
||||||
|
if (process.env.NODE_ENV === '<%= process.env.NODE_ENV %>') {
|
||||||
|
process.env.NODE_ENV = 'production'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.VUE_APP_ADMIN === '<%= process.env.VUE_APP_ADMIN %>') {
|
||||||
|
process.env.VUE_APP_ADMIN = 'http://192.168.8.58:7196/'
|
||||||
|
}
|
||||||
|
|
||||||
var noPadding = getQueryParam('noPT')
|
var noPadding = getQueryParam('noPT')
|
||||||
if (noPadding) {
|
if (noPadding) {
|
||||||
document.getElementById('main')
|
document.getElementById('main')
|
||||||
@@ -399,11 +416,15 @@
|
|||||||
// objectToQueryString 函数必须定义
|
// objectToQueryString 函数必须定义
|
||||||
|
|
||||||
var ipConfig = {
|
var ipConfig = {
|
||||||
ip: getQueryParam('ip') || 'http://39.104.123.254',
|
ip:
|
||||||
|
getQueryParam('ip') ||
|
||||||
|
process.env.VUE_APP_ADMIN ||
|
||||||
|
'http://39.104.123.254',
|
||||||
port: getQueryParam('port') || '7196'
|
port: getQueryParam('port') || '7196'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(process)
|
||||||
|
|
||||||
var serviceUrl = {
|
var serviceUrl = {
|
||||||
queryResult: {
|
queryResult: {
|
||||||
url: '/riskCheckRecordEx/queryResult',
|
url: '/riskCheckRecordEx/queryResult',
|
||||||
|
|||||||
@@ -49,12 +49,8 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
// 获取路由参数
|
// 获取路由参数
|
||||||
this.recordId = this.$route.query.recordId || ''
|
this.recordId = this.$route.query.recordId || ''
|
||||||
|
|
||||||
// 将process.env.VUE_APP_ADMIN拆分城IP 跟端口
|
// 将process.env.VUE_APP_ADMIN拆分城IP 跟端口
|
||||||
const [http, ip, port] = process.env.VUE_APP_ADMIN.split(':')
|
const [http, ip, port] = process.env.VUE_APP_ADMIN.split(':')
|
||||||
console.log(process.env.VUE_APP_ADMIN.split(':'))
|
|
||||||
console.log(ip, port)
|
|
||||||
|
|
||||||
// 模拟设置详情URL,实际项目中应该根据recordId从API获取真实URL
|
// 模拟设置详情URL,实际项目中应该根据recordId从API获取真实URL
|
||||||
if (this.$route.query.taCode) {
|
if (this.$route.query.taCode) {
|
||||||
// 示例URL,实际应根据recordId获取对应的详情页面URL
|
// 示例URL,实际应根据recordId获取对应的详情页面URL
|
||||||
|
|||||||
Reference in New Issue
Block a user