🐛 打开公开的共享链接时清除shareToken
This commit is contained in:
parent
9bf8efc853
commit
8021e1413b
@ -11,7 +11,7 @@ import {
|
||||
setRememberName,
|
||||
removeRememberName,
|
||||
setShareToken,
|
||||
getShareToken
|
||||
getShareToken, removeShareToken
|
||||
} from '@/utils/auth'
|
||||
import { setLogo } from '@/utils/logo'
|
||||
import { resetRouter } from '@/router'
|
||||
@ -184,6 +184,15 @@ const actions = {
|
||||
commit('RESET_STATE')
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
|
||||
// remove share token
|
||||
resetShareToken({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
removeShareToken()
|
||||
commit('SET_SHARE_TOKEN', undefined)
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,10 @@ export function removeToken() {
|
||||
return Cookies.remove(tokenKey)
|
||||
}
|
||||
|
||||
export function removeShareToken() {
|
||||
return Cookies.remove(shareTokenKey)
|
||||
}
|
||||
|
||||
export function getConsumerId() {
|
||||
return Cookies.get(consumerId)
|
||||
}
|
||||
|
||||
@ -277,6 +277,7 @@ import Clipboard from "clipboard";
|
||||
import OfficePreview from "@/components/preview/OfficePreview";
|
||||
import Logo from "@/components/Logo";
|
||||
import getPageTitle from "@/utils/get-page-title";
|
||||
import store from "@/store";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -620,7 +621,9 @@ export default {
|
||||
this.getSharer(userId)
|
||||
}
|
||||
if (this.fileList.length > 0) {
|
||||
this.loadShareFileList(pagination, overload, res.count)
|
||||
store.dispatch('user/resetShareToken').then(() => {
|
||||
this.loadShareFileList(pagination, overload, res.count)
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
@ -988,7 +991,7 @@ export default {
|
||||
item['index'] = this.pathList.length
|
||||
this.pathList.push(item)
|
||||
this.pagination.pageIndex = 1
|
||||
this.$router.push(`/s?s=${this.shareId}&vmode=${this.vmode}`)
|
||||
this.$router.push(`?s=${this.shareId}&vmode=${this.vmode}`)
|
||||
this.accessShareOpenDir(row.id)
|
||||
} else {
|
||||
if (row.contentType.startsWith('image')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user