mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: improve workspace ID assignment and use const for lastIndex
--bug=1057324 --user=刘瑞斌 【资源授权】企业版-进入资源授权页面显示工作空间-默认应该显示用户所在的工作空间 https://www.tapd.cn/62980211/s/1724719
This commit is contained in:
parent
da8a12cae7
commit
114c2985c0
|
|
@ -199,7 +199,7 @@ const settingTags = reactive([
|
|||
// 当前激活的数据类型(应用/知识库/模型/工具)
|
||||
|
||||
const activeData = computed(() => {
|
||||
var lastIndex = route.path.lastIndexOf('/')
|
||||
const lastIndex = route.path.lastIndexOf('/')
|
||||
const currentPathType = route.path.substring(lastIndex + 1).toUpperCase()
|
||||
return settingTags.filter((item) => {
|
||||
return item.type === currentPathType
|
||||
|
|
@ -430,7 +430,7 @@ const currentWorkspace = computed(() => {
|
|||
async function getWorkspaceList() {
|
||||
const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading)
|
||||
workspaceList.value = res.data
|
||||
currentWorkspaceId.value = 'default'
|
||||
currentWorkspaceId.value = user.getWorkspaceId() as string || 'default'
|
||||
}
|
||||
|
||||
function changeWorkspace(item: WorkspaceItem) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue