fix: 更新API路径和代理配置以适配本地开发环境
修改vite配置中的代理目标地址为本地服务,并添加路径重写规则 更新多个组件中的API请求路径,统一添加'/aw'前缀
This commit is contained in:
parent
645e0d2a2c
commit
587c6f4f38
@ -74,7 +74,7 @@ use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponen
|
|||||||
// API调用函数
|
// API调用函数
|
||||||
const fetchChartData = async (timeType: string, riskLevel: number) => {
|
const fetchChartData = async (timeType: string, riskLevel: number) => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`/screen/alarmByOption/${timeType}/${riskLevel}`)
|
const response = await axios.get(`/aw/screen/alarmByOption/${timeType}/${riskLevel}`)
|
||||||
if (response.data.state === true) {
|
if (response.data.state === true) {
|
||||||
return response.data.value || []
|
return response.data.value || []
|
||||||
} else {
|
} else {
|
||||||
|
@ -85,7 +85,7 @@ const selectedTimeRange = ref('day')
|
|||||||
// API调用函数
|
// API调用函数
|
||||||
const fetchChartData = async (option: string) => {
|
const fetchChartData = async (option: string) => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`/screen/handleByOption/${option}`)
|
const response = await axios.get(`/aw/screen/handleByOption/${option}`)
|
||||||
if (response.data.state === true) {
|
if (response.data.state === true) {
|
||||||
return response.data.value || []
|
return response.data.value || []
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,7 +93,7 @@ const calculateWidth = (value: number) => {
|
|||||||
// 新增:API调用函数
|
// 新增:API调用函数
|
||||||
const fetchCorpsData = async (option: string) => {
|
const fetchCorpsData = async (option: string) => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`/screen/corpsFive/${option}`)
|
const response = await axios.get(`/aw/screen/corpsFive/${option}`)
|
||||||
if (response.data.state === true) {
|
if (response.data.state === true) {
|
||||||
displayData.value = response.data.value || []
|
displayData.value = response.data.value || []
|
||||||
} else {
|
} else {
|
||||||
|
@ -61,8 +61,9 @@ export default ({ mode }) =>
|
|||||||
secure: true
|
secure: true
|
||||||
},
|
},
|
||||||
'/aw/': {
|
'/aw/': {
|
||||||
target: 'http://10.91.33.244/',
|
target: 'http://127.0.0.1:8080/',
|
||||||
changeOrigin: true
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/aw/, '')
|
||||||
},
|
},
|
||||||
'/awjt/': {
|
'/awjt/': {
|
||||||
target: 'http://127.0.0.1:8921/',
|
target: 'http://127.0.0.1:8921/',
|
||||||
|
Loading…
Reference in New Issue
Block a user