Skip to content

Commit

Permalink
feat: 全局配置问题修复
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 12384
  • Loading branch information
hyunfa committed Jul 17, 2024
1 parent 3fed67e commit a6706b6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@blueking/login-modal": "^1.0.1",
"@blueking/notice-component-vue2": "~2.0.1",
"@blueking/paas-login": "0.0.9",
"@blueking/platform-config": "^1.0.3",
"@blueking/platform-config": "^1.0.4",
"@icon-cool/bk-icon-node-manager": "latest",
"axios": "0.26.1",
"bk-magic-vue": "2.5.6",
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default class App extends Vue {
setDocumentTitle(PlatformConfigStore.defaults.i18n);
// 设置favicon
setShortcutIcon(PlatformConfigStore.defaults.favicon);
this.setFavicon()
const platform = window.navigator.platform.toLowerCase();
if (platform.indexOf('win') === 0) {
this.systemCls = 'win';
Expand All @@ -101,6 +102,18 @@ export default class App extends Vue {
});
});
}
// 全局配置只设置了shortcut icon,会失效,这里补充设置rel=icon的favicon
private setFavicon () {
var r = document.querySelector('link[rel="icon"]');
r || (r = document.createElement("link"),
r.setAttribute("rel", "icon"),
document.head.appendChild(r))
r.setAttribute("type", "image/x-icon");
r.setAttribute("href", PlatformConfigStore.defaults.favicon);
}
private mounted() {
window.LoginModal = this.$refs.login;
bus.$on('show-login-modal', () => {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/common/footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default class NmFooter extends Vue {
width: 100%;
padding: 19px 0;
text-align: center;
/deep/a.link-item {
color: #3a84ff;
}
p {
line-height: 1;
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ import ExceptionPage from '@/components/exception/exception-page.vue';
import routerBackMixin from '@/common/router-back-mixin';
import { bus } from '@/common/bus';
import { INavConfig } from '@/types';
import logoSrc from '@/images/logoIcon.png';
interface IUserItem {
id: string
Expand Down Expand Up @@ -214,7 +215,7 @@ export default class NodemanNavigation extends Mixins(routerBackMixin) {
return PlatformConfigStore.defaults;
}
private get appLogo() {
return PlatformConfigStore.defaults.appLogo;
return PlatformConfigStore.defaults.appLogo || logoSrc;
}
private get navList() {
return MainStore.navList.filter(item => !item.disabled);
Expand Down

0 comments on commit a6706b6

Please sign in to comment.