Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e52b0c3e
authored
Jan 12, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix 逻辑修改
1 parent
aca7c7f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
src/store/modules/auth.js
src/store/modules/auth.js
View file @
e52b0c3
...
@@ -81,12 +81,18 @@ function handleSpecialMenuFilter(menus, merchant) {
...
@@ -81,12 +81,18 @@ function handleSpecialMenuFilter(menus, merchant) {
if
(
!
config
)
{
if
(
!
config
)
{
return
menus
return
menus
}
}
console
.
log
(
'config'
,
config
,
merchant
,
location
)
const
{
accountName
,
merchantName
}
=
merchant
||
{}
const
{
accountName
,
merchantName
}
=
merchant
||
{}
// 检查是否满足特殊账号条件
// 检查是否满足特殊账号条件
const
isSpecialAccount
=
accountName
===
config
.
accountName
&&
merchantName
===
config
.
merchantName
&&
location
.
pathname
===
config
.
pathname
const
isSpecialAccount
=
accountName
===
config
.
accountName
&&
merchantName
===
config
.
merchantName
&&
location
.
pathname
===
config
.
pathname
console
.
log
(
isSpecialAccount
,
Array
.
isArray
(
menus
))
// console.log((isSpecialAccount = accountName === config.accountName && merchantName === config.merchantName && location.pathname === config.pathname))
if
(
isSpecialAccount
&&
Array
.
isArray
(
menus
))
{
if
(
isSpecialAccount
&&
Array
.
isArray
(
menus
))
{
// 1. 过滤逻辑:只留下 label == "客户" 的菜单
// 1. 过滤逻辑:只留下 label == "客户" 的菜单(兼容 null/undefined)
const
filteredMenus
=
menus
.
filter
(
item
=>
item
.
label
===
config
.
keepLabel
)
const
normalizedMenus
=
menus
.
filter
(
Boolean
)
const
filteredMenus
=
normalizedMenus
.
filter
(
item
=>
item
?.
label
===
config
.
keepLabel
)
// 如果过滤后为空,回退为原菜单,避免后续流程异常
if
(
!
filteredMenus
.
length
)
return
menus
// 2. 新增菜单 (TODO: 请根据实际菜单数据结构配置以下内容)
// 2. 新增菜单 (TODO: 请根据实际菜单数据结构配置以下内容)
const
findByLabel
=
(
list
,
label
)
=>
{
const
findByLabel
=
(
list
,
label
)
=>
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment