diff --git a/src/frontend/devops-repository/index.html b/src/frontend/devops-repository/index.html index 0b15755d70..c3ad7e3274 100644 --- a/src/frontend/devops-repository/index.html +++ b/src/frontend/devops-repository/index.html @@ -64,6 +64,7 @@ // 是否显示制品分析菜单 var SHOW_ANALYST_MENU = '__BK_REPO_SHOW_ANALYST_MENU__' || 'false' SHOW_ANALYST_MENU = SHOW_ANALYST_MENU === 'true' + var ADD_FROM_LOGOUT = '__IS_FROM_LOGOUT__' || 'not' // 区分社区版与内部版 community -> 社区 tencent -> 内部 var RELEASE_MODE = '__BK_REPO_RELEASE_MODE__' || 'community' diff --git a/src/frontend/devops-repository/src/store/actions/index.js b/src/frontend/devops-repository/src/store/actions/index.js index bdd4b6d0f8..4bd1c4cac6 100644 --- a/src/frontend/devops-repository/src/store/actions/index.js +++ b/src/frontend/devops-repository/src/store/actions/index.js @@ -34,20 +34,20 @@ export default { "storageCredentialsKey": null } */ - createRepo ({ dispatch }, { body }) { + createRepo({dispatch}, {body}) { return Vue.prototype.$ajax.post( `${prefix}/repo/create`, body ) }, // 校验仓库名称 - checkRepoName (_, { projectId, name }) { + checkRepoName(_, {projectId, name}) { return Vue.prototype.$ajax.get( `${prefix}/repo/exist/${projectId}/${name}` ) }, // 分页查询仓库列表 - getRepoList (_, { projectId, current, limit, name, type }) { + getRepoList(_, {projectId, current, limit, name, type}) { return Vue.prototype.$ajax.get( `${prefix}/repo/page/${projectId}/${current}/${limit}`, { @@ -64,7 +64,7 @@ export default { })) // 前端隐藏report仓库/log仓库 }, // 查询所有仓库 - getRepoListWithoutPage (_, { projectId, name, type }) { + getRepoListWithoutPage(_, {projectId, name, type}) { return Vue.prototype.$ajax.get( `${prefix}/repo/list/${projectId}`, { @@ -81,7 +81,7 @@ export default { })) }, // 查询仓库列表 - getRepoListAll ({ commit }, { projectId }) { + getRepoListAll({commit}, {projectId}) { return Vue.prototype.$ajax.get( `${prefix}/repo/list/${projectId}` ).then(res => { @@ -90,38 +90,43 @@ export default { }) }, // 查询仓库信息 - getRepoInfo (_, { projectId, repoName, repoType }) { + getRepoInfo(_, {projectId, repoName, repoType}) { return Vue.prototype.$ajax.get( `${prefix}/repo/info/${projectId}/${repoName}/${repoType.toUpperCase()}` ) }, // 更新仓库信息 - updateRepoInfo (_, { projectId, name, body }) { + updateRepoInfo(_, {projectId, name, body}) { return Vue.prototype.$ajax.post( `${prefix}/repo/update/${projectId}/${name}`, body ) }, // 删除仓库 - deleteRepoList ({ dispatch }, { projectId, name, forced = false }) { + deleteRepoList({dispatch}, {projectId, name, forced = false}) { return Vue.prototype.$ajax.delete( `${prefix}/repo/delete/${projectId}/${name}?forced=${forced}` ) }, // 查询项目列表 - getProjectList ({ commit }) { + getProjectList({commit}) { return Vue.prototype.$ajax.get( `${prefix}/project/list` ).then(res => { commit('SET_PROJECT_LIST', res) }) }, - logout ({ commit }) { + logout({commit}) { if (MODE_CONFIG === 'ci' || MODE_CONFIG === 'saas') { window.postMessage({ action: 'toggleLoginDialog' }, '*') - location.href = window.getLoginUrl() + // eslint-disable-next-line no-undef + if (window.ADD_FROM_LOGOUT === 'not') { + location.href = window.getLoginUrl() + } else { + location.href = window.getLoginUrl() + '&is_from_logout=1' + } } else { cookie.remove('bkrepo_ticket') commit('SHOW_LOGIN_DIALOG', true)