Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
wx-notification
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 4bd49306
authored
Apr 14, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 企业微信授权优化
1 parent
a5841700
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
1 deletions
src/router/routes.js
src/store/modules/app.js
src/views/evection/authorize.vue
src/router/routes.js
View file @
4bd4930
...
...
@@ -98,6 +98,16 @@ const pages = {
showAction
:
true
}
},
{
name
:
'authorize'
,
meta
:
{
keepAlive
:
true
,
title
:
'登录授权'
,
noAuth
:
true
,
backgroundColor
:
'#f7f8fa'
,
showAction
:
true
}
},
]
}
let
routes
=
[
...
...
src/store/modules/app.js
View file @
4bd4930
...
...
@@ -81,7 +81,11 @@ const actions = {
}
else
throw
message
})
}
else
{
window
.
location
.
href
=
`
${
loginUrl
}
?redirect_uri=
${
encodeURIComponent
(
window
.
location
.
href
)}
&corpId=
${
corpId
}
&agentId=
${
agentId
}
&backLoginCode=BACKCODE`
util
.
setLocalStorage
(
'authorizeUrl'
,
window
.
location
.
href
);
let
locationHref
=
window
.
location
.
href
;
//把字符串 department, personage, company 替换为 authorize
locationHref
=
locationHref
.
replace
(
/
(
department|personage|company
)
/g
,
'authorize'
);
window
.
location
.
href
=
`
${
loginUrl
}
?redirect_uri=
${
encodeURIComponent
(
locationHref
)}
&corpId=
${
corpId
}
&agentId=
${
agentId
}
&backLoginCode=BACKCODE`
}
}
catch
(
error
)
{
if
(
!
error
)
error
=
'登录失败或无权限'
...
...
src/views/evection/authorize.vue
0 → 100644
View file @
4bd4930
<!-- 公司月度总结 -->
<
template
>
<div>
<div
class=
"pageBox"
>
{{
pageTitle
}}
</div>
</div>
</
template
>
<
script
>
import
{
util
}
from
'utils'
export
default
{
data
()
{
return
{
pageTitle
:
'正在登录授权中...'
,
}
},
mounted
()
{
const
code
=
this
.
getParams
(
'code'
);
if
(
code
)
{
this
.
pageTitle
=
'授权成功'
;
const
authorizeUrl
=
util
.
getLocalStorage
(
'authorizeUrl'
);
window
.
location
.
href
=
authorizeUrl
+
'&code='
+
code
;
}
else
{
this
.
pageTitle
=
'正在登录授权中...'
}
},
methods
:
{
getParams
(
name
)
{
let
[
url
,
paramsList
]
=
window
.
location
.
href
.
split
(
'?'
)
if
(
!
paramsList
)
return
name
?
null
:
{}
let
param
=
paramsList
.
split
(
'&'
)
let
obj
=
{}
param
.
map
(
e
=>
{
let
[
key
,
value
]
=
e
.
split
(
'='
)
obj
[
key
]
=
value
})
return
name
?
obj
[
name
]
:
obj
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.pageBox
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
</
style
>
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