Commit e47f37c6 by 牛晓林

Merge branch 'master' of gitlab.juicestime.com:yangyuqiang/luqiao-admin-mobile

parents 6d69f634 b18e7ddd
import { Injectable, Injector } from '@angular/core';
import { Injectable, Injector, Inject } from '@angular/core';
import { Router } from '@angular/router';
import {
HttpInterceptor,
......@@ -39,7 +39,7 @@ const CODEMESSAGE = {
*/
@Injectable()
export class DefaultInterceptor implements HttpInterceptor {
constructor(private injector: Injector) {}
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, private injector: Injector) {}
private get notification(): NzNotificationService {
return this.injector.get(NzNotificationService);
......@@ -112,7 +112,25 @@ export class DefaultInterceptor implements HttpInterceptor {
// 统一加上服务端前缀
let url = req.url;
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;
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 });
......
......@@ -7,7 +7,7 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
})
export class ListService {
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;`;
/**
*获取资产台账列表
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment