Commit 50022109 authored by 张耀's avatar 张耀
parents 027587b5 42e9eb8a
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
}"> }">
<!-- LOGO --> <!-- LOGO -->
<router-link to="/" class="bg-logo"> <router-link to="/" class="bg-logo">
<img
style="width: 22px; height: 22px"
:src="systemLogo ? JSON.parse(systemLogo)[0].url : getImageUrl('img_logo.png')" />
<span>智能运维管理平台</span> <span>智能运维管理平台</span>
</router-link> </router-link>
...@@ -82,6 +85,7 @@ ...@@ -82,6 +85,7 @@
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";
import { clearCookie } from "../services/cookie.js"; import { clearCookie } from "../services/cookie.js";
import { resetRouter } from "../router/index"; import { resetRouter } from "../router/index";
import { getImageUrl } from "@/services/helper.js";
import { normalizeProps } from "vue-demi"; import { normalizeProps } from "vue-demi";
export default { export default {
...@@ -95,6 +99,7 @@ export default { ...@@ -95,6 +99,7 @@ export default {
}, },
data() { data() {
return { return {
getImageUrl,
documentScrollTop: 0, documentScrollTop: 0,
cartList: [], cartList: [],
showCart: true, showCart: true,
...@@ -158,6 +163,9 @@ export default { ...@@ -158,6 +163,9 @@ export default {
return temp; return temp;
}, },
}), }),
systemLogo() {
return this.$store.state.systemLogo;
},
}, },
watch: { watch: {
nameFlag(n, o) { nameFlag(n, o) {
...@@ -202,6 +210,7 @@ export default { ...@@ -202,6 +210,7 @@ export default {
if (res.data.code == "200") { if (res.data.code == "200") {
window.location.href = "/so/manage/ui/#/login"; window.location.href = "/so/manage/ui/#/login";
this.$store.commit("setUserInfo", null); this.$store.commit("setUserInfo", null);
this.$store.commit("setMenu", null);
clearCookie("bgToken"); clearCookie("bgToken");
this.$message.success("退出成功"); this.$message.success("退出成功");
resetRouter(); resetRouter();
......
...@@ -129,7 +129,6 @@ const getMenu = (search) => { ...@@ -129,7 +129,6 @@ const getMenu = (search) => {
}; };
const getUser = () => { const getUser = () => {
Promise.all([getUserInfo(), getMenu("1e99371c-187f-4966-94cf-32f116f42ce6")]).then((res) => { Promise.all([getUserInfo(), getMenu("1e99371c-187f-4966-94cf-32f116f42ce6")]).then((res) => {
console.log("res", res);
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = (res[1].data.data && res[1].data.data[0].children) || []; let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data); store.commit("setUserInfo", res[0].data.data);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class="login-container" class="login-container"
:style="{ :style="{
'background-image': `url(${ 'background-image': `url(${
configOptions.backgroundUrl ? JSON.parse(configOptions.backgroundUrl)[0].url : getImageUrl('bg.png') configOptions.bg_image ? JSON.parse(configOptions.bg_image)[0].url : getImageUrl('bg.png')
})`, })`,
}"> }">
<el-alert v-if="showValidityDays" class="bg-warning" :title="validityTips" type="warning" /> <el-alert v-if="showValidityDays" class="bg-warning" :title="validityTips" type="warning" />
...@@ -27,15 +27,15 @@ ...@@ -27,15 +27,15 @@
<div class="bg-msg"> <div class="bg-msg">
<p v-if="configOptions && configOptions.patent">{{ configOptions.patent }}</p> <p v-if="configOptions && configOptions.patent">{{ configOptions.patent }}</p>
<p v-if="configOptions"> <p v-if="configOptions">
<span class="can_click_text" @click="open(configOptions.icpUrl)"> {{ configOptions.icpFiling }} | </span> <span class="can_click_text" @click="open(configOptions.icp_url)"> {{ configOptions.icp }} | </span>
<span class="can_click_text" @click="open(configOptions.publicSecurityUrl)"> <span class="can_click_text" @click="open(configOptions.police_url)">
{{ configOptions.publicSecurityFiling }} {{ configOptions.police }}
</span> </span>
</p> </p>
<p> <p>
<span class="can_click_text" @click="open(configOptions.legalStatementUrl)">法律声明</span> <span class="can_click_text" @click="open(configOptions.legal_notice)">法律声明</span>
| |
<span class="can_click_text" @click="open(configOptions.privacyPolicyUrl)">隐私政策</span> <span class="can_click_text" @click="open(configOptions.privacy_policy)">隐私政策</span>
</p> </p>
</div> </div>
...@@ -73,7 +73,6 @@ const validityTips = ref(""); ...@@ -73,7 +73,6 @@ const validityTips = ref("");
const showValidityDays = ref(false); const showValidityDays = ref(false);
onBeforeMount(() => { onBeforeMount(() => {
getLoginPageConfig();
getSysOptions(); getSysOptions();
}); });
...@@ -84,21 +83,14 @@ const switchPageType = (type) => { ...@@ -84,21 +83,14 @@ const switchPageType = (type) => {
const password = () => { const password = () => {
router.push("/password"); router.push("/password");
}; };
const getLoginPageConfig = () => {
axios.get(`/apaas/system/v5/login/loginDetail`).then((res) => {
if (res.data.code == 200) {
configOptions.value = res.data.data || null;
store.commit("setSystemLogo", configOptions.value.logoUrl);
} else {
ElMessage.error(res.data.data);
}
});
};
//获取首选项配置 //获取首选项配置
const getSysOptions = () => { const getSysOptions = () => {
axios.get(`/v1/api/sysOptions`).then((res) => { axios.get(`/v1/api/sysOptions`).then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
const result = res.data.data || {}; const result = res.data.data;
configOptions.value = result;
store.commit("setSystemLogo", configOptions.value.logo);
if (result.license_dead_date && result.license_inform_day) { if (result.license_dead_date && result.license_inform_day) {
calculateValidityDays( calculateValidityDays(
new Date().getTime(), new Date().getTime(),
......
...@@ -131,7 +131,6 @@ watch( ...@@ -131,7 +131,6 @@ watch(
const setForm = (data) => { const setForm = (data) => {
Object.assign(systemForm, data); Object.assign(systemForm, data);
console.log("systemForm", systemForm);
}; };
const orgData = ref([]); const orgData = ref([]);
......
...@@ -28,6 +28,8 @@ const toLogin = () => { ...@@ -28,6 +28,8 @@ const toLogin = () => {
let path = router.currentRoute.value.path; let path = router.currentRoute.value.path;
//白名单中的401不做跳转 //白名单中的401不做跳转
if (!store.state.whiteList.includes(path)) { if (!store.state.whiteList.includes(path)) {
store.commit("setUserInfo", null);
store.commit("setMenu", null);
window.location.href = `/so/manage/ui/#/login`; window.location.href = `/so/manage/ui/#/login`;
} }
// router.replace({ // router.replace({
......
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