Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
f2a0ac00
Commit
f2a0ac00
authored
May 08, 2021
by
程默
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
第三方跳转 sso
parent
5babe6db
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
src/api/login.js
+5
-0
src/pages/login/index.vue
+0
-0
src/pages/wxArticle/index.vue
+16
-12
src/pages/wxArticle/main.json
+2
-1
No files found.
src/api/login.js
View file @
f2a0ac00
...
...
@@ -15,6 +15,10 @@ console.log(process.env,'-----------------config------')
//check unionid
checkUnionid
(
options
){
return
requestGET
(
`
${
process
.
env
.
OLSHOP_URL
}
/wx/mini_check_union_id`
,
options
)
},
// sso登录
getSsoBcakUrl
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/common/getSsoCallbackUrl`
,
options
)
}
}
\ No newline at end of file
src/pages/login/index.vue
View file @
f2a0ac00
This diff is collapsed.
Click to expand it.
src/pages/wxArticle/index.vue
View file @
f2a0ac00
...
...
@@ -26,38 +26,42 @@ export default {
};
},
async
onLoad
(
options
)
{
console
.
log
(
'wxarticle'
,
options
)
// options.scene="64a77cd6aeac4c1db46e3f7d53596fe6"
if
(
options
.
link
)
{
this
.
link
=
decodeURIComponent
(
options
.
link
);
}
else
if
(
options
.
scene
)
{
//扫码
let
data
=
await
this
.
getParams
(
options
.
scene
||
"959ce6ac97cf4f43a1759eb41ec12798"
);
if
(
data
.
sso
==
"sso"
&&
!
wx
.
getStorageSync
(
"sessionid"
))
{
let
data
=
await
this
.
getParams
(
options
.
scene
);
if
(
data
.
sso
)
{
if
(
!
wx
.
getStorageSync
(
"sessionid"
))
{
wx
.
redirectTo
({
url
:
`../login/main?scene=sso&back=
${
data
.
link
}
`
,
});
}
else
{
let
link
=
decodeURIComponent
(
data
.
link
).
replace
(
"${token}"
,
wx
.
getStorageSync
(
"sessionid"
)
);
wx
.
redirectTo
({
url
:
`../login/main?scene=sso&back=
${
link
}
`
,
});
}
else
{
this
.
link
=
data
.
link
;
this
.
link
=
decodeURIComponent
(
link
);
}
}
}
},
methods
:
{
getParams
(
options
)
{
return
indexApi
return
new
Promise
((
resolve
,
reject
)
=>
{
indexApi
.
getShareSceneRecord
(
options
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
"200"
)
{
console
.
log
(
"5666666"
,
res
);
let
scene
=
JSON
.
parse
(
res
.
data
.
data
.
scene
);
resolve
(
scene
.
link
);
resolve
(
scene
);
}
})
.
catch
((
err
)
=>
{});
});
},
//加载成功
handleLoad
()
{
...
...
src/pages/wxArticle/main.json
View file @
f2a0ac00
{
"navigationBarTitleText"
:
"文章"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment