|
@@ -18,12 +18,14 @@
|
|
|
// 根据app参数设置favicon
|
|
|
function setFavicon() {
|
|
|
const appParam = getAppParam();
|
|
|
- let faviconPath = '/favicon.ico'; // 默认图标
|
|
|
- console.log(appParam, 6666)
|
|
|
- if (appParam === '1') {
|
|
|
- faviconPath = '/fire.ico';
|
|
|
- } else if (appParam === '2') {
|
|
|
- faviconPath = '/police.ico';
|
|
|
+ // 获取基础路径
|
|
|
+ const basePath = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
|
|
|
+ let faviconPath = basePath + 'favicon.ico'; // 默认图标
|
|
|
+ console.log(appParam, basePath, 6666)
|
|
|
+ if (appParam == '1') {
|
|
|
+ faviconPath = basePath + 'fire.ico';
|
|
|
+ } else if (appParam == '2') {
|
|
|
+ faviconPath = basePath + 'police.ico';
|
|
|
}
|
|
|
|
|
|
// 查找现有的favicon链接元素
|