mirror of https://github.com/veops/cmdb.git
fix(cmdb-ui):set localstorage '' after unsubscribe ci (#296)
This commit is contained in:
parent
4b133c56fd
commit
beb2f01ec9
|
@ -95,6 +95,10 @@ export default {
|
|||
const unsubTree = subscribeTreeView(citypeId, '')
|
||||
Promise.all([unsubCIType, unsubTree]).then(() => {
|
||||
that.$message.success('取消订阅成功')
|
||||
const lastTypeId = window.localStorage.getItem('ops_ci_typeid') || undefined
|
||||
if (Number(citypeId) === Number(lastTypeId)) {
|
||||
localStorage.setItem('ops_ci_typeid', '')
|
||||
}
|
||||
// 删除路由
|
||||
const href = window.location.href
|
||||
const hrefSplit = href.split('/')
|
||||
|
|
|
@ -879,6 +879,10 @@ export default {
|
|||
unsubscribe(ciType, type = 'all') {
|
||||
const promises = [subscribeCIType(this.typeId, ''), subscribeTreeView(this.typeId, '')]
|
||||
Promise.all(promises).then(() => {
|
||||
const lastTypeId = window.localStorage.getItem('ops_ci_typeid') || undefined
|
||||
if (Number(ciType) === Number(lastTypeId)) {
|
||||
localStorage.setItem('ops_ci_typeid', '')
|
||||
}
|
||||
this.$message.success('取消订阅成功')
|
||||
this.resetRoute()
|
||||
this.$router.push('/cmdb/preference')
|
||||
|
|
|
@ -314,6 +314,12 @@ export default {
|
|||
}
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
if (type === 'all' || type === 'ci') {
|
||||
const lastTypeId = window.localStorage.getItem('ops_ci_typeid') || undefined
|
||||
if (Number(ciType.id) === Number(lastTypeId)) {
|
||||
localStorage.setItem('ops_ci_typeid', '')
|
||||
}
|
||||
}
|
||||
that.$message.success('取消订阅成功')
|
||||
that.resetRoute()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue