Skip to content

Commit

Permalink
Merge pull request #1324 from owenlxu/issue_master_1315
Browse files Browse the repository at this point in the history
 feat: 退出登录之后加上is_from_logout参数  #1315
  • Loading branch information
owenlxu authored Oct 25, 2023
2 parents 4011d3c + e9e5fd7 commit 4866809
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/frontend/devops-repository/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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'
</script>
Expand Down
27 changes: 16 additions & 11 deletions src/frontend/devops-repository/src/store/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
{
Expand All @@ -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}`,
{
Expand All @@ -81,7 +81,7 @@ export default {
}))
},
// 查询仓库列表
getRepoListAll ({ commit }, { projectId }) {
getRepoListAll({commit}, {projectId}) {
return Vue.prototype.$ajax.get(
`${prefix}/repo/list/${projectId}`
).then(res => {
Expand All @@ -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)
Expand Down

0 comments on commit 4866809

Please sign in to comment.