Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
hrs_app_h5
/
bill
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
21a545e5
authored
Jun 16, 2020
by
展昭
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
599de2a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
src/router/index.js
src/router/index.js
View file @
21a545e5
...
...
@@ -4,7 +4,6 @@ import { vuexOidcCreateRouterMiddleware } from 'vuex-oidc'
import
store
from
'../store'
import
billRouters
from
'./bill-router.js'
import
moreRouters
from
'./more-router.js'
import
api
from
'../api/More'
import
qs
from
"qs"
;
import
axios
from
"axios"
;
...
...
@@ -34,18 +33,27 @@ const router = new VueRouter({
})
function
getAccessToken
(
authcode
)
{
console
.
log
(
'authcode='
,
authcode
);
console
.
log
(
'authcode='
,
authcode
);
return
new
Promise
((
resolve
,
reject
)
=>
{
api
.
getAccessToken
(
authcode
)
.
then
(
res
=>
{
if
(
res
&&
res
.
status
)
{
accessToken
=
res
.
data
.
accessToken
;
resolve
(
accessToken
);
}
else
{
reject
(
res
)
}
});
var
TEAMMIXURL
=
process
.
env
.
VUE_APP_API_TEAMMIXURL
;
let
url
=
`
${
TEAMMIXURL
}
/connect/token`
;
let
pms
=
{
"client_id"
:
oidc_config
.
client_id
,
"client_secret"
:
oidc_config
.
client_secret
,
"grant_type"
:
"auth_code"
,
"scope"
:
"openid offline_access"
,
"code"
:
authcode
}
axios
.
post
(
url
,
qs
.
stringify
(
pms
)).
then
(
res
=>
{
if
(
res
&&
res
.
status
)
{
accessToken
=
res
.
accessToken
;
resolve
(
accessToken
);
}
else
{
reject
(
res
)
}
})
});
}
...
...
@@ -61,7 +69,7 @@ async function getToken(access_token, appid, next) {
};
let
commonPms
=
GetCommonPms
();
let
url
=
`
${
oidc_config
.
authority
}
/connect/token?
${
commonPms
}
`
;
console
.
log
(
'url='
,
url
);
console
.
log
(
'url='
,
url
);
await
axios
.
post
(
url
,
qs
.
stringify
(
pms
))
.
then
(
...
...
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