diff --git a/frontend/src/views/cross/java/Index.vue b/frontend/src/views/cross/java/Index.vue index 982f344..30cca35 100644 --- a/frontend/src/views/cross/java/Index.vue +++ b/frontend/src/views/cross/java/Index.vue @@ -1,118 +1,102 @@ - - + + if (type == 1) { + const testApi = serverUrl.value + '/test1/get'; + const cfg = { + method: 'get', + url: testApi, + params: { id: '1111111'}, + timeout: 1000, + } + axios(cfg).then(res => { + console.log('res:', res); + const data = res.data || null; + message.info(`服务返回: ${data}`); + }) + } else { + ipc.invoke(ipcApiRoute.cross.requestApi, {name: 'javaapp', urlPath: '/test1/get', params: { id: '1111111'}}).then(res => { + console.log('res:', res); + const data = res || null; + message.info(`服务返回: ${data}`); + }) + } +} + + \ No newline at end of file diff --git a/frontend/src/views/cross/python/Index.vue b/frontend/src/views/cross/python/Index.vue index e879d04..1983c55 100644 --- a/frontend/src/views/cross/python/Index.vue +++ b/frontend/src/views/cross/python/Index.vue @@ -1,117 +1,101 @@ - - + if (type == 1) { + const testApi = serverUrl.value + '/api/hello'; + const cfg = { + method: 'get', + url: testApi, + params: { id: '111'}, + timeout: 1000, + } + axios(cfg).then(res => { + console.log('res:', res); + const data = res.data || null; + message.info(`服务返回: ${JSON.stringify(data)}`); + }) + } else { + ipc.invoke(ipcApiRoute.cross.requestApi, {name: 'pyapp', urlPath: '/api/hello'}).then(res => { + console.log('res:', res); + const data = res || null; + message.info(`服务返回: ${JSON.stringify(data)}`); + }) + } +} + + \ No newline at end of file