Commit 50022109 authored by 张耀's avatar 张耀
parents 027587b5 42e9eb8a
......@@ -7,6 +7,9 @@
}">
<!-- 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>
</router-link>
......@@ -82,6 +85,7 @@
import { mapState, mapMutations } from "vuex";
import { clearCookie } from "../services/cookie.js";
import { resetRouter } from "../router/index";
import { getImageUrl } from "@/services/helper.js";
import { normalizeProps } from "vue-demi";
export default {
......@@ -95,6 +99,7 @@ export default {
},
data() {
return {
getImageUrl,
documentScrollTop: 0,
cartList: [],
showCart: true,
......@@ -158,6 +163,9 @@ export default {
return temp;
},
}),
systemLogo() {
return this.$store.state.systemLogo;
},
},
watch: {
nameFlag(n, o) {
......@@ -202,6 +210,7 @@ export default {
if (res.data.code == "200") {
window.location.href = "/so/manage/ui/#/login";
this.$store.commit("setUserInfo", null);
this.$store.commit("setMenu", null);
clearCookie("bgToken");
this.$message.success("退出成功");
resetRouter();
......
......@@ -129,7 +129,6 @@ const getMenu = (search) => {
};
const getUser = () => {
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) {
let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data);
......
......@@ -3,7 +3,7 @@
class="login-container"
:style="{
'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" />
......@@ -27,15 +27,15 @@
<div class="bg-msg">
<p v-if="configOptions && configOptions.patent">{{ configOptions.patent }}</p>
<p v-if="configOptions">
<span class="can_click_text" @click="open(configOptions.icpUrl)"> {{ configOptions.icpFiling }} | </span>
<span class="can_click_text" @click="open(configOptions.publicSecurityUrl)">
{{ configOptions.publicSecurityFiling }}
<span class="can_click_text" @click="open(configOptions.icp_url)"> {{ configOptions.icp }} | </span>
<span class="can_click_text" @click="open(configOptions.police_url)">
{{ configOptions.police }}
</span>
</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>
</div>
......@@ -73,7 +73,6 @@ const validityTips = ref("");
const showValidityDays = ref(false);
onBeforeMount(() => {
getLoginPageConfig();
getSysOptions();
});
......@@ -84,21 +83,14 @@ const switchPageType = (type) => {
const 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 = () => {
axios.get(`/v1/api/sysOptions`).then((res) => {
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) {
calculateValidityDays(
new Date().getTime(),
......
......@@ -131,7 +131,6 @@ watch(
const setForm = (data) => {
Object.assign(systemForm, data);
console.log("systemForm", systemForm);
};
const orgData = ref([]);
......
......@@ -28,6 +28,8 @@ const toLogin = () => {
let path = router.currentRoute.value.path;
//白名单中的401不做跳转
if (!store.state.whiteList.includes(path)) {
store.commit("setUserInfo", null);
store.commit("setMenu", null);
window.location.href = `/so/manage/ui/#/login`;
}
// 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