Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-main
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 8c98b957
authored
Jun 29, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' into 'master'
分享增加分享时间戳 See merge request
!4
2 parents
c610f09b
2e52e763
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
src/config/env.development.js
src/mixins/shareMixin.js
src/store/modules/app.js
src/views/common/accountList.vue
src/config/env.development.js
View file @
8c98b95
...
...
@@ -11,7 +11,7 @@ module.exports = {
envVersion
:
'trial'
,
title
:
'嘀加企微管家'
,
request
:
{
baseURL
:
'http://scrm.
dev
.glsx.com.cn'
,
// 本地测试项目地址,
baseURL
:
'http://scrm.
test
.glsx.com.cn'
,
// 本地测试项目地址,
// 设置超时时间
timeout
:
180000
,
// 携带凭证
...
...
src/mixins/shareMixin.js
View file @
8c98b95
...
...
@@ -23,7 +23,7 @@ export default {
const
{
entry
}
=
this
const
{
materialName
,
id
,
titleUrl
,
materialTitle
,
description
}
=
i
const
imgUrl
=
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
let
query
=
`merchantId=
${
merchantId
}
&id=
${
id
}
&staffUuid=
${
uuid
}
`
let
query
=
`merchantId=
${
merchantId
}
&id=
${
id
}
&staffUuid=
${
uuid
}
&shareTime=
${
Date
.
now
()}
`
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
wxConfig
.
createMiniprogramUrlLink
({
path
,
...
...
src/store/modules/app.js
View file @
8c98b95
...
...
@@ -70,11 +70,12 @@ const actions = {
let
[
redirectUrl
]
=
window
.
location
.
href
.
split
(
'?'
)
const
code
=
getParams
(
'code'
)
if
(
code
)
{
const
{
corpId
}
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
const
{
corpId
,
agentId
}
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
ssoApi
.
login
({
code
,
corpId
corpId
,
getUserInfoFlag
:
agentId
?
true
:
false
})
.
then
(({
code
,
data
})
=>
{
let
url
=
`
${
redirectUrl
.
split
(
'#'
)[
0
]}
#/`
...
...
@@ -121,11 +122,13 @@ const actions = {
}
else
{
util
.
showLoading
()
let
appid
=
getParams
(
'corpId'
)
//从链接获取
let
agentid
=
getParams
(
'agentId'
)
//从链接获取
let
dj_scrm
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
const
IS_PROD
=
[
'production'
,
'prod'
].
includes
(
process
.
env
.
NODE_ENV
)
if
(
!
appid
)
{
if
(
dj_scrm
)
{
appid
=
dj_scrm
.
corpId
agentid
=
dj_scrm
.
agentId
}
else
{
if
(
IS_PROD
)
{
Notify
({
...
...
@@ -133,12 +136,23 @@ const actions = {
duration
:
15000
})
return
}
else
appid
=
'ww7ee69c648ae1b7e6'
}
else
{
appid
=
'ww7ee69c648ae1b7e6'
agentid
=
1000035
// appid = 'wwc1fefc2a3f70bd0b'
// agentid = 1000002
}
}
}
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
:
appid
})
const
wxUrl
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
window
.
location
.
href
=
`
${
wxUrl
}
?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
let
dj_scrm_storage
=
{
corpId
:
appid
}
let
wxUrl
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
wxUrl
=
`
${
wxUrl
}
?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&response_type=code&scope=snsapi_privateinfo`
if
(
agentid
)
{
wxUrl
=
`
${
wxUrl
}
&agentid=
${
agentid
}
`
dj_scrm_storage
.
agentId
=
agentid
}
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
dj_scrm_storage
)
window
.
location
.
href
=
`
${
wxUrl
}
&state=STATE#wechat_redirect`
}
},
navigation
({
dispatch
},
to
)
{
...
...
src/views/common/accountList.vue
View file @
8c98b95
...
...
@@ -83,7 +83,7 @@ export default {
let
redirect_uri
=
this
.
getLocalStorage
(
'dj_scrm_redirect_uri'
)
this
.
setLocalStorage
(
'dj_scrm_userInfo'
,
data
)
this
.
setSessionId
(
data
.
sessionId
)
let
{
corpId
}
=
this
.
getLocalStorage
(
'dj_scrm_corpId'
)
let
{
corpId
,
agentId
}
=
this
.
getLocalStorage
(
'dj_scrm_corpId'
)
store
.
dispatch
(
'registerHttp'
,
data
.
sessionId
)
this
.
removeLocalStorage
(
'dj_scrm_redirect_uri'
)
this
.
showLoading
(
'登录成功'
,
()
=>
{
...
...
@@ -91,6 +91,7 @@ export default {
if
(
redirect_uri
)
{
let
[
URL
,
query
]
=
decodeURIComponent
(
redirect_uri
).
split
(
'?'
)
URL
=
`
${
URL
}
?sessionId=
${
data
.
sessionId
}
&corpId=
${
corpId
}
`
if
(
agentId
)
URL
=
`
${
URL
}
&agentId=
${
agentId
}
`
if
(
query
)
URL
=
`
${
URL
}
&
${
query
}
`
window
.
location
.
href
=
URL
}
...
...
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