Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
luqiao-admin-mobile
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨子
luqiao-admin-mobile
Commits
e47f37c6
Commit
e47f37c6
authored
Apr 26, 2019
by
牛晓林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.juicestime.com:yangyuqiang/luqiao-admin-mobile
parents
6d69f634
b18e7ddd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
default.interceptor.ts
src/app/core/net/default.interceptor.ts
+20
-2
list.service.ts
src/app/core/services/list/list.service.ts
+1
-1
No files found.
src/app/core/net/default.interceptor.ts
View file @
e47f37c6
import
{
Injectable
,
Injector
}
from
'@angular/core'
;
import
{
Injectable
,
Injector
,
Inject
}
from
'@angular/core'
;
import
{
Router
}
from
'@angular/router'
;
import
{
Router
}
from
'@angular/router'
;
import
{
import
{
HttpInterceptor
,
HttpInterceptor
,
...
@@ -39,7 +39,7 @@ const CODEMESSAGE = {
...
@@ -39,7 +39,7 @@ const CODEMESSAGE = {
*/
*/
@
Injectable
()
@
Injectable
()
export
class
DefaultInterceptor
implements
HttpInterceptor
{
export
class
DefaultInterceptor
implements
HttpInterceptor
{
constructor
(
private
injector
:
Injector
)
{}
constructor
(
@
Inject
(
DA_SERVICE_TOKEN
)
private
tokenService
:
ITokenService
,
private
injector
:
Injector
)
{}
private
get
notification
():
NzNotificationService
{
private
get
notification
():
NzNotificationService
{
return
this
.
injector
.
get
(
NzNotificationService
);
return
this
.
injector
.
get
(
NzNotificationService
);
...
@@ -112,7 +112,25 @@ export class DefaultInterceptor implements HttpInterceptor {
...
@@ -112,7 +112,25 @@ export class DefaultInterceptor implements HttpInterceptor {
// 统一加上服务端前缀
// 统一加上服务端前缀
let
url
=
req
.
url
;
let
url
=
req
.
url
;
if
(
!
url
.
startsWith
(
'https://'
)
&&
!
url
.
startsWith
(
'http://'
))
{
if
(
!
url
.
startsWith
(
'https://'
)
&&
!
url
.
startsWith
(
'http://'
))
{
console
.
log
(
url
.
indexOf
(
'asset'
));
console
.
log
(
url
.
indexOf
(
'/login'
));
// asset/a/assets/.....
//asset/a/login
//qita
// const rg = /asset\/a\/[^(login)].*/g;
// if (rg.match(url)) url = environment.SERVER_URL + url;
// const reg = [/\/login/, /assets\//, /passport\//];
url
=
environment
.
SERVER_URL
+
url
;
url
=
environment
.
SERVER_URL
+
url
;
console
.
log
(
url
);
if
(
url
.
indexOf
(
'asset'
)
===
0
)
{
if
(
url
.
indexOf
(
'/login'
)
===
-
1
)
{
console
.
log
(
1111
);
url
+=
`JSESSIONID=
${
this
.
tokenService
.
get
().
token
}
?_ajax=true&mobileLogin=true`
;
}
else
{
console
.
log
(
2222
);
}
}
}
}
const
newReq
=
req
.
clone
({
url
});
const
newReq
=
req
.
clone
({
url
});
...
...
src/app/core/services/list/list.service.ts
View file @
e47f37c6
...
@@ -7,7 +7,7 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
...
@@ -7,7 +7,7 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
})
})
export
class
ListService
{
export
class
ListService
{
constructor
(@
Inject
(
DA_SERVICE_TOKEN
)
private
tokenService
:
ITokenService
,
private
http
:
_HttpClient
)
{}
constructor
(@
Inject
(
DA_SERVICE_TOKEN
)
private
tokenService
:
ITokenService
,
private
http
:
_HttpClient
)
{}
private
url
=
`asset/a/asset/assets/data;
JSESSIONID=
${
this
.
tokenService
.
get
().
token
}
?_ajax=true&mobileLogin=true
`
;
private
url
=
`asset/a/asset/assets/data;`
;
/**
/**
*获取资产台账列表
*获取资产台账列表
*
*
...
...
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