Commit 23f01bd2 authored by “yiyousong”'s avatar “yiyousong”

pref:修改title和logo获取

parent 73277e5e
......@@ -10,4 +10,6 @@ VUE_APP_TBAS_TITLES_KEY=admin.tabs.titles
#VUE_APP_API_BASE_URL=http://api.iczer.com
#门户
VUE_APP_API_portal_URL=http://192.168.0.98:11072
# VUE_APP_API_portal_URL=http://10.12.185.213:11072
\ No newline at end of file
# VUE_APP_API_portal_URL=http://10.12.185.213:11072
# 系统名称
VUE_APP_sysName = "基础设置"
\ No newline at end of file
......@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- <title><%= process.env.VUE_APP_NAME %></title> -->
<title>基础设置系统</title>
<title></title>
<!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
......
......@@ -4,8 +4,14 @@
<a-layout-header class="header">
<div class="flex aic">
<router-link to="/" class="flex aic">
<img class="mr10" width="32" src="@/assets/img/logo.png" />
<h1 class="title">基础设置系统</h1>
<img
class="mr10"
width="32"
:src="sysLogo ? api + sysLogo : require('@/assets/img/logo.png')"
/>
<h1 class="title">
{{ sysName ? sysName : systemName }}
</h1>
</router-link>
<HeaderSite class="ml20"></HeaderSite>
</div>
......@@ -57,14 +63,19 @@ export default {
},
data() {
return {
systemName: process.env.VUE_APP_sysName,
api: process.env.VUE_APP_API_IMG_URL,
portalUrl: process.env.VUE_APP_API_portal_URL, // 门户地址
visibleInit: false,
};
},
computed: {
...mapState("setting", ["systemName", "menuData"]),
...mapState("site", ["sysName", "sysLogo"]),
...mapState("setting", ["menuData"]),
},
created() {
document.title = this.sysName ? this.sysName : this.systemName; // 设置项目标题
},
created() {},
methods: {},
};
</script>
......@@ -87,8 +98,10 @@ export default {
color: #fff;
}
.title {
font-size: 20px;
font-weight: bold;
font-size: 18px;
max-width: 200px;
line-height: normal;
}
}
.main {
......
......@@ -8,8 +8,13 @@
to="/"
:class="['logo', isMobile ? null : 'pc', headerTheme]"
>
<img width="32" src="@/assets/img/logo.png" />
<h1 v-if="!isMobile" style="padding-left: 10px">{{ systemName }}</h1>
<img
width="32"
:src="sysLogo ? api + sysLogo : require('@/assets/img/logo.png')"
/>
<h1 class="title" v-if="!isMobile" style="padding-left: 10px">
{{ sysName ? sysName : systemName }}
</h1>
</router-link>
<a-divider v-if="isMobile" type="vertical" />
<a-icon
......@@ -84,6 +89,8 @@ export default {
props: ["collapsed", "menuData"],
data() {
return {
api: process.env.VUE_APP_API_IMG_URL,
systemName: process.env.VUE_APP_sysName,
visibleInit: false,
langList: [
{ key: "CN", name: "简体中文", alias: "简体" },
......@@ -95,6 +102,7 @@ export default {
};
},
computed: {
...mapState("site", ["sysName", "sysLogo"]),
...mapState("setting", [
"theme",
"isMobile",
......@@ -127,7 +135,9 @@ export default {
return `calc(${headWidth} - ${extraWidth})`;
},
},
created() {},
created() {
document.title = this.sysName ? this.sysName : this.systemName; // 设置项目标题
},
methods: {
toggleCollapse() {
this.$emit("toggleCollapse");
......@@ -142,4 +152,10 @@ export default {
<style lang="less" scoped>
@import "index";
.title {
font-weight: bold;
font-size: 18px;
max-width: 200px;
line-height: normal;
}
</style>
......@@ -20,21 +20,21 @@ export default {
"SET_token",
"SET_SITE_ID",
"SET_siteName",
"SET_sysName",
"SET_sysLogo",
]),
// 获取token
getToken() {
let token = this.$route.query.token;
let userInfo = this.$route.query.userInfo;
let siteId = this.$route.query.siteid;
let siteName = this.$route.query.siteName;
let { token, userInfo, siteId, siteName, sysName, sysLogo } =
this.$route.query;
if (token && userInfo) {
userInfo = JSON.parse(userInfo);
this.SET_userInfo(userInfo);
this.SET_token(token);
this.SET_SITE_ID(siteId);
this.SET_siteName(siteName);
// local.setLocal("token", token);
// local.setLocal("baseUserInfo", userInfo);
this.SET_sysName(sysName);
this.SET_sysLogo(sysLogo);
local.setLocal("siteId", siteId);
local.setLocal("siteName", siteName);
this.$router.push("/website");
......
export default {
namespaced: true,
state: {
sysName: "", // 系统名称
sysLogo: "", // 系统logo
siteId: "", // 站点id
siteName: "", // 站点名称
imageResolution: [], // 皮肤设置分辨率
......@@ -38,6 +40,12 @@ export default {
},
},
mutations: {
SET_sysName(state, sysName) {
state.sysName = sysName;
},
SET_sysLogo(state, sysLogo) {
state.sysLogo = sysLogo;
},
SET_siteName(state, siteName) {
state.siteName = siteName;
},
......
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