Showing
3 changed files
with
9 additions
and
3 deletions
| @@ -40,10 +40,15 @@ export class Logger { | @@ -40,10 +40,15 @@ export class Logger { | ||
| 40 | Logger.domain = domain; | 40 | Logger.domain = domain; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | - static debug(...args: string[]) { | 43 | + static debug(prefixStr?:string,...args: string[]) { |
| 44 | if (!Logger.isDebug) { | 44 | if (!Logger.isDebug) { |
| 45 | return | 45 | return |
| 46 | } | 46 | } |
| 47 | + if(prefixStr){ | ||
| 48 | + Logger.prefix = prefixStr | ||
| 49 | + }else { | ||
| 50 | + Logger.prefix = 'SightApp'; | ||
| 51 | + } | ||
| 47 | Logger.logContent(LogLevel.DEBUG, ...args) | 52 | Logger.logContent(LogLevel.DEBUG, ...args) |
| 48 | } | 53 | } |
| 49 | 54 | ||
| @@ -150,4 +155,4 @@ export class Logger { | @@ -150,4 +155,4 @@ export class Logger { | ||
| 150 | } | 155 | } |
| 151 | } | 156 | } |
| 152 | 157 | ||
| 153 | -export default new Logger('SightApp', 0xFF00) | ||
| 158 | +// export default new Logger('SightApp', 0xFF00) |
| @@ -87,6 +87,7 @@ instance.interceptors.response.use(// 响应拦截器response类型就是Axios.r | @@ -87,6 +87,7 @@ instance.interceptors.response.use(// 响应拦截器response类型就是Axios.r | ||
| 87 | // return Promise.reject(new Error(message)) | 87 | // return Promise.reject(new Error(message)) |
| 88 | // } | 88 | // } |
| 89 | // const data: ResponseBean<any> = response.data | 89 | // const data: ResponseBean<any> = response.data |
| 90 | + | ||
| 90 | Logger.debug('HttpRequest', 'response ==============start=================') | 91 | Logger.debug('HttpRequest', 'response ==============start=================') |
| 91 | Logger.debug('HttpRequest', 'response: ' + JSON.stringify(response.data)) | 92 | Logger.debug('HttpRequest', 'response: ' + JSON.stringify(response.data)) |
| 92 | Logger.debug('HttpRequest', 'response ==============end=================') | 93 | Logger.debug('HttpRequest', 'response ==============end=================') |
| @@ -21,7 +21,7 @@ export enum HostEnum { | @@ -21,7 +21,7 @@ export enum HostEnum { | ||
| 21 | * 环境host管理工具类 | 21 | * 环境host管理工具类 |
| 22 | */ | 22 | */ |
| 23 | export class HostManager { | 23 | export class HostManager { |
| 24 | - private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT; | 24 | + private static _hostUrl: HostEnum = HostEnum.HOST_UAT; |
| 25 | 25 | ||
| 26 | static changeHost(host: HostEnum) { | 26 | static changeHost(host: HostEnum) { |
| 27 | HostManager._hostUrl = host; | 27 | HostManager._hostUrl = host; |
-
Please register or login to post a comment