-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { HttpInterceptorFn } from '@angular/common/http' | ||
import { environment } from '../../../environments/environment' | ||
|
||
/** 请求地址前缀 */ | ||
const { baseURL } = environment | ||
|
||
/** | ||
* 请求地址拦截器 | ||
* | ||
* ### 主要用途 | ||
* 根据当前环境在请求路径加上请求地址前缀。 | ||
*/ | ||
export const urlInterceptor: HttpInterceptorFn = (req, next) => { | ||
if (req.url.startsWith('http://') || req.url.startsWith('https://')) { | ||
return next(req) | ||
} else { | ||
return next(req.clone({ url: baseURL + req.url })) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>LifeHelperWeb</title> | ||
<base href="/"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
<meta charset="utf-8"> | ||
<title>小鸣助手</title> | ||
<base href="/"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
</head> | ||
|
||
<body> | ||
<app-root></app-root> | ||
<app-root></app-root> | ||
</body> | ||
|
||
</html> |