Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sys-sdk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
sys-sdk
Commits
6b319cc5
Commit
6b319cc5
authored
Dec 06, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/tenant' into 'master'
add tenantId See merge request
!1
parents
4e3ba6a0
49b4947e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
http.js
lib/http.js
+4
-0
package.json
package.json
+1
-1
No files found.
lib/http.js
View file @
6b319cc5
...
@@ -92,6 +92,7 @@ instance.interceptors.request.use(
...
@@ -92,6 +92,7 @@ instance.interceptors.request.use(
beforeRequest
(
config
.
headers
.
_loading
,
config
.
headers
.
_isLoading
);
beforeRequest
(
config
.
headers
.
_loading
,
config
.
headers
.
_isLoading
);
const
token
=
localStorage
.
get
(
'
token
'
);
const
token
=
localStorage
.
get
(
'
token
'
);
const
user
=
localStorage
.
get
(
'
user
'
);
const
user
=
localStorage
.
get
(
'
user
'
);
const
tenantId
=
localStorage
.
get
(
'
tenantId
'
);
if
(
user
)
{
if
(
user
)
{
config
.
headers
[
'
Account
'
]
=
user
.
account
;
config
.
headers
[
'
Account
'
]
=
user
.
account
;
config
.
headers
[
'
Account-Name
'
]
=
encodeURI
(
user
.
name
);
config
.
headers
[
'
Account-Name
'
]
=
encodeURI
(
user
.
name
);
...
@@ -101,6 +102,9 @@ instance.interceptors.request.use(
...
@@ -101,6 +102,9 @@ instance.interceptors.request.use(
config
.
headers
[
'
Access-Token
'
]
=
token
;
config
.
headers
[
'
Access-Token
'
]
=
token
;
config
.
headers
[
'
X-Requested-With
'
]
=
'
XMLHttpRequest
'
;
config
.
headers
[
'
X-Requested-With
'
]
=
'
XMLHttpRequest
'
;
}
}
if
(
tenantId
){
config
.
headers
[
'
qg-tenant-id
'
]
=
tenantId
;
}
let
rewriteMap
=
{};
let
rewriteMap
=
{};
...
...
package.json
View file @
6b319cc5
{
{
"name"
:
"@qg/sys-sdk"
,
"name"
:
"@qg/sys-sdk"
,
"version"
:
"1.0.1
4
"
,
"version"
:
"1.0.1
6
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
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