Skip to content

Commit 114c298

Browse files
committed
fix: improve workspace ID assignment and use const for lastIndex
--bug=1057324 --user=刘瑞斌 【资源授权】企业版-进入资源授权页面显示工作空间-默认应该显示用户所在的工作空间 https://www.tapd.cn/62980211/s/1724719
1 parent da8a12c commit 114c298

File tree

1 file changed

+2
-2
lines changed
  • ui/src/views/system/resource-authorization

1 file changed

+2
-2
lines changed

ui/src/views/system/resource-authorization/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const settingTags = reactive([
199199
// 当前激活的数据类型(应用/知识库/模型/工具)
200200
201201
const activeData = computed(() => {
202-
var lastIndex = route.path.lastIndexOf('/')
202+
const lastIndex = route.path.lastIndexOf('/')
203203
const currentPathType = route.path.substring(lastIndex + 1).toUpperCase()
204204
return settingTags.filter((item) => {
205205
return item.type === currentPathType
@@ -430,7 +430,7 @@ const currentWorkspace = computed(() => {
430430
async function getWorkspaceList() {
431431
const res = await loadPermissionApi('workspace').getSystemWorkspaceList(loading)
432432
workspaceList.value = res.data
433-
currentWorkspaceId.value = 'default'
433+
currentWorkspaceId.value = user.getWorkspaceId() as string || 'default'
434434
}
435435
436436
function changeWorkspace(item: WorkspaceItem) {

0 commit comments

Comments
 (0)