diff --git a/src/api/one-class-page/overview.js b/src/api/one-class-page/overview.js index 65b231c..aa82b21 100644 --- a/src/api/one-class-page/overview.js +++ b/src/api/one-class-page/overview.js @@ -27,7 +27,7 @@ export function getClusterResource(url) { // 容器概览页面--节点用量 Top5 export function getNodeBriefMessage(url, query) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-extend/container/node/' + url + '/getNodeResourceSort', + url: '/jcc-extend/container/node/' + url + '/getNodeResourceSort', method: 'get', params: query }) @@ -37,7 +37,7 @@ export function getNodeBriefMessage(url, query) { export function getNodeMessageTop(url) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-extend/container/node/' + url + '/getClusterNode', + url: '/jcc-extend/container/node/' + url + '/getClusterNode', method: 'get' }) } diff --git a/src/api/operations/actions.js b/src/api/operations/actions.js index 50b3af8..7ee36b6 100644 --- a/src/api/operations/actions.js +++ b/src/api/operations/actions.js @@ -404,38 +404,38 @@ export default { // 函数 checkFunctionName(functionName) { return request({ - url: process.env.VUE_APP_FUNCTION_API + `/jcc-faas-manager/function/exist/${functionName}`, + url: `/jcc-faas-manager/function/exist/${functionName}`, method: 'get' }) }, createFunction(query) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/createFunction', + url: '/jcc-faas-manager/function/createFunction', method: 'post', data: query }) }, deleteFunctionByName() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/delete/functionByName', + url: '/jcc-faas-manager/function/delete/functionByName', method: 'delete' }) }, deleteFunction(functionId) { return request({ - url: process.env.VUE_APP_FUNCTION_API + `/jcc-faas-manager/function/deleteFunction/${functionId}`, + url: `/jcc-faas-manager/function/deleteFunction/${functionId}`, method: 'delete' }) }, getFunctionByFunctionName() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/delete/functionByName', + url: '/jcc-faas-manager/function/delete/functionByName', method: 'get' }) }, invokeFunction(params, query) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/invokeFunction', + url: '/jcc-faas-manager/function/invokeFunction', method: 'post', params: params, data: query @@ -443,7 +443,7 @@ export default { }, listFunctions(query) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/lists', + url: '/jcc-faas-manager/function/lists', method: 'get', params: query || { page: 1, size: 10 } }) @@ -456,41 +456,41 @@ export default { // }, getFunctionOverview() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/selectFunctionOverview', + url: '/jcc-faas-manager/function/selectFunctionOverview', method: 'get' }) }, getFunctionMap() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/selectFunctionList', + url: '/jcc-faas-manager/function/selectFunctionList', method: 'get' }) }, // 大屏总营收接口 getRevenue() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-mall/order/queryRevenue', + url: '/jcc-mall/order/queryRevenue', method: 'get' }) }, // 大屏地球查询 getMapArea() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryByArea', + url: '/jcc-faas-manager/function/device/queryByArea', method: 'get' }) }, // 大屏云厂商服务器数量查询接口 getCloudServerCount() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryByManufacturer', + url: '/jcc-faas-manager/function/device/queryByManufacturer', method: 'get' }) }, // 大屏服务器数量统计接口 getServerDeviceCount() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryDeviceCount', + url: '/jcc-faas-manager/function/device/queryDeviceCount', method: 'get' }) }, @@ -498,7 +498,7 @@ export default { // 大屏服务器数量统计接口 getOrderStatus() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-mall/order/countOrderStatus', + url: '/jcc-mall/order/countOrderStatus', method: 'get' }) }, diff --git a/src/api/screen-one-class-page/TotalNum.js b/src/api/screen-one-class-page/TotalNum.js index 6d53a92..5e5eba4 100644 --- a/src/api/screen-one-class-page/TotalNum.js +++ b/src/api/screen-one-class-page/TotalNum.js @@ -3,7 +3,7 @@ import request from '@/utils/request' export function getTotalName() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryByManufacturer', + url: '/jcc-faas-manager/function/device/queryByManufacturer', method: 'get', data: JSON, headers: { @@ -14,7 +14,7 @@ export function getTotalName() { // 大屏服务器数量统计接口 export function getTotalNum() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryDeviceCount', + url: '/jcc-faas-manager/function/device/queryDeviceCount', method: 'get', data: JSON, headers: { @@ -26,7 +26,7 @@ export function getTotalNum() { // 大屏地球地区查询接口 export function getEarthRegion() { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryByArea', + url: '/jcc-faas-manager/function/device/queryByArea', method: 'get', data: JSON, headers: { @@ -38,7 +38,7 @@ export function getEarthRegion() { // 大屏地球各个区域服务器资源详细接口 export function getEarthDetails(area) { return request({ - url: process.env.VUE_APP_FUNCTION_API + '/jcc-faas-manager/function/device/queryResDetailByArea?area=' + area, + url: '/jcc-faas-manager/function/device/queryResDetailByArea?area=' + area, method: 'get', data: JSON, headers: { diff --git a/src/components/ClusterManagement/nodeMessage.vue b/src/components/ClusterManagement/nodeMessage.vue index 1bd4929..d4df58f 100644 --- a/src/components/ClusterManagement/nodeMessage.vue +++ b/src/components/ClusterManagement/nodeMessage.vue @@ -31,7 +31,7 @@ export default { }, computed: { clusterName() { - // console.log(this.$store.getters) + console.log(this.$store.getters) // return this.$store.getters.clusterName return localStorage.getItem('clusterName') } diff --git a/src/permission.js b/src/permission.js index 1b0bd7a..44f5f0f 100644 --- a/src/permission.js +++ b/src/permission.js @@ -38,6 +38,7 @@ router.beforeEach(async(to, from, next) => { next() } else { try { + console.log('sss') // get user info // note: roles must be a object array! such as: ['admin'] or ,['developer','editor'] const { roles } = await store.dispatch('user/getInfo') diff --git a/src/utils/kubeRequest.js b/src/utils/kubeRequest.js deleted file mode 100644 index 4a6b617..0000000 --- a/src/utils/kubeRequest.js +++ /dev/null @@ -1,53 +0,0 @@ -import axios from 'axios' -import { Message } from 'element-ui' - -// 创建axios 实例 -const request = axios.create({ - headers: { - 'Content-Type': 'application/json' - }, - timeout: 15000 // 请求超时时间 -}) -// request 拦截器 -request.interceptors.request.use( - (config) => { - // if (store.getters.token) { - // // let each request carry token - // // ['X-Token'] is a custom headers key - // // please modify it according to the actual situation - // config.headers['X-Token'] = getToken() - // } - if (config.method === 'post') { - // config.data = qs.stringify(config.data); - - } - return config - }, - (error) => { - // do something with request error - console.log(error) // for debug - Promise.reject(error) - } -) -request.interceptors.response.use( - (response) => { - // if (store.getters.token) { - // - // } - if (response.status === 200) { - const res = response.data - if (res.code === 200) { - return res.data || true - } - Message.error(res.message) - return false - } - return false - }, - (error) => { - // do something with request error - // console.log(error.response); // for debug - Message.error(`Status: ${error.response.status} , Message: ${error.response.data.error}`) - } -) -export default request diff --git a/src/utils/request.js b/src/utils/request.js index 2890fd5..391ed95 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -9,7 +9,7 @@ const service = axios.create({ headers: { 'Content-Type': 'application/merge-patch+json' }, - baseURL: '/', // url = base url + request url + baseURL: process.env.NODE_ENV !== 'production' ? '/' : '/apis', // url = base url + request url withCredentials: true, // send cookies when cross-domain requests timeout: 15000 // request timeout }) diff --git a/vue.config.js b/vue.config.js index c98e0fd..1bf56f2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,7 +38,7 @@ module.exports = { }, proxy: { '/jcc-admin': { - target: 'http://10.101.15.6:8000/', + target: 'http://10.101.15.6:/apis', secure: false }, // '^/login': {