Skip to content

Commit 443beed

Browse files
committed
1、处理 api 访问抛出的错误 2、 取消 listEngineConnInstances、getEcReleaseStrategyList、listEcKillHistory 三个接口请求
1 parent 8994062 commit 443beed

File tree

4 files changed

+10
-71
lines changed

4 files changed

+10
-71
lines changed

web/packages/shared/common/service/api.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ const success = function (response) {
219219
data = JSON.parse(response.data);
220220
} catch (e) {
221221
console.log(e, response.data)
222-
throw new Error(API_ERR_MSG);
222+
// throw new Error(API_ERR_MSG);
223+
return {}
223224
}
224225
} else if (util.isObject(response.data)) {
225226
// 兼容ds blob流下载
@@ -232,7 +233,10 @@ const success = function (response) {
232233
data = response.data
233234
}
234235
} else {
235-
throw new Error(API_ERR_MSG);
236+
console.log(response)
237+
console.log(API_ERR_MSG)
238+
// throw new Error(API_ERR_MSG);
239+
return {}
236240
}
237241
let res = getData(data);
238242
let code = res.codePath;
@@ -466,9 +470,9 @@ const showErrMsg = function (error) {
466470
const isShowErr = (url) => {
467471
const noShowUrlList = [
468472
'/dss/datapipe/datasource/getSchemaBaseInfo',
469-
'/validator/code-precheck',
470-
'/copilot/codecompletion',
471-
'/copilot/codeadoption',
473+
'/validator/code-precheck',
474+
'/copilot/codecompletion',
475+
'/copilot/codeadoption',
472476
'/copilot/user/isinwhitelist',
473477
'/dss/guide/solution/reportProblem'];
474478
if (noShowUrlList.includes(url)) {

web/packages/workspace/view/enginekill/index.vue

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -622,28 +622,6 @@ export default {
622622
methods: {
623623
doQuery() {
624624
this.pageData.pageNow = 1
625-
const params = {
626-
workspaceId: this.$route.query.workspaceId,
627-
}
628-
api.fetch(`${this.$API_PATH.WORKSPACE_PATH}getEcReleaseStrategyList`, params, 'get').then((res) => {
629-
this.pageData.totol = res.total
630-
this.list = (res.strategyList || []).filter(item => {
631-
let resItem = true
632-
if (this.searchBar.status) {
633-
resItem = item.status == this.searchBar.status
634-
}
635-
if (this.searchBar.crossCluster) {
636-
resItem = resItem && this.searchBar.crossCluster === String(!!item.crossCluster);
637-
}
638-
if (this.searchBar.yarnQueue && this.searchBar.yarnQueue.trim()) {
639-
resItem = resItem && this.searchBar.yarnQueue.trim() === item.queue
640-
}
641-
if (this.searchBar.name && this.searchBar.name.trim()) {
642-
resItem = resItem && new RegExp(this.searchBar.name.trim(), 'i').test(item.name)
643-
}
644-
return resItem
645-
})
646-
})
647625
},
648626
handleCrossCluster(crossCluster, type, queue) {
649627
if (type === 'search') {

web/packages/workspace/view/enginekill/list.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,7 @@ export default {
103103
this.getEngineList();
104104
},
105105
getEngineList() {
106-
this.loading = true;
107-
const params = {
108-
workspaceId: this.$route.query.workspaceId,
109-
pageNow: this.pageData.pageNow,
110-
pageSize: this.pageData.pageSize,
111-
}
112-
api.fetch(`${this.$API_PATH.WORKSPACE_PATH}listEcKillHistory`, params, 'get').then((res) => {
113-
this.list = res.engineList || []
114-
this.pageData.total = res.total
115-
this.loading = false;
116-
}).catch((err) => {
117-
console.error(err)
118-
this.loading = false;
119-
});
106+
120107
},
121108
122109
}

web/packages/workspace/view/enginelist/index.vue

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,36 +151,6 @@ export default {
151151
this.getEngineList()
152152
},
153153
getEngineList() {
154-
this.loading = true;
155-
const params = {
156-
workspaceId: this.$route.query.workspaceId,
157-
pageNow: this.pageData.pageNow,
158-
pageSize: this.pageData.pageSize,
159-
}
160-
if (this.searchBar.status) {
161-
params.status = this.searchBar.status
162-
}
163-
if (this.searchBar.createUser) {
164-
params.createUser = this.searchBar.createUser
165-
}
166-
if (this.searchBar.engineType) {
167-
params.engineType = this.searchBar.engineType
168-
}
169-
if (this.searchBar.yarnQueue) {
170-
params.yarnQueue = this.searchBar.yarnQueue
171-
}
172-
if (this.sort) {
173-
params.orderBy = this.sort.orderBy
174-
params.sortBy = this.sort.sortBy
175-
}
176-
api.fetch(`${this.$API_PATH.WORKSPACE_PATH}listEngineConnInstances`, params, 'post').then((res) => {
177-
this.list = res.engineList || [];
178-
this.pageData.total = res.total
179-
this.loading = false;
180-
}).catch((err) => {
181-
console.error(err)
182-
this.loading = false;
183-
});
184154
},
185155
getUserList() {
186156
if (this.$route.query.workspaceId) {

0 commit comments

Comments
 (0)