forked from JointCloud/JCC-RIP
fix
This commit is contained in:
parent
f4cb190c8d
commit
79001549d6
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
})
|
||||
},
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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': {
|
||||
|
|
Loading…
Reference in New Issue