Browse Source

:sparkles: 食神科技域名

Ritchie 1 year ago
parent
commit
913f242231
4 changed files with 58 additions and 6 deletions
  1. BIN
      src/assets/login/shishenLogo.png
  2. 12 3
      src/styles/login/index.less
  3. 18 1
      src/views/home/index.vue
  4. 28 2
      src/views/login.vue

BIN
src/assets/login/shishenLogo.png


+ 12 - 3
src/styles/login/index.less

@@ -13,14 +13,21 @@
     .loginLogo {
       width: 200px;
       height: 140px;
-      position: absolute;
-      top: 40px;
+      position: relative;
+      z-index: 0;
+      top: 20px;
       left: 50%;
       transform: translateX(-50%);
-      background: url("../../assets/login/logo.png") center no-repeat;
+      // background: url("../../assets/login/logo.png") center no-repeat;
       background-size: 100%;
     }
 
+    .loginLogo img {
+      display: block;
+      width: 100%;
+      height: auto;
+    }
+
     .languageCon {
       width: 60px;
       right: 15px;
@@ -34,6 +41,8 @@
 
   .loginTitleBox {
     width: 100%;
+    position: relative;
+    z-index: 1;
 
     .loginTitle {
       height: 28px;

+ 18 - 1
src/views/home/index.vue

@@ -2,7 +2,7 @@
   <!-- 主页 -->
   <div class="homePage flex-col">
     <div class="homeBox">
-      <s-header :name="sys ? sys.title : $t('public.sysName')" :noback="true" :isFixed="false"></s-header>
+      <s-header :name="sys ? sys.title : sysTitle" :noback="true" :isFixed="false"></s-header>
       <!-- 留言滚动条 -->
       <template v-if="noticeContent.title">
         <van-notice-bar @click="noticeClk" mode="link" :scrollable="true" color="rgba(64,77,116,1)" background="#fff"
@@ -199,6 +199,8 @@ export default {
     const router = useRouter();
     const userName = ref(user.name);
     const sys = ref(null);
+    const sysTitle = ref('');
+
     // 自定义货币符号
     const currencySymbol = ref("¥");
     if (user.currencySymbol) {
@@ -430,8 +432,22 @@ export default {
           alarmList.value = data.data;
         }
       }
+      getDomainFunc();
     });
 
+
+    const getDomainFunc = async () => {
+      const currentDomain = window.location.href;
+      console.log("href >>>", currentDomain);
+      switch (true) {
+        case currentDomain.includes('sskj.qxfoodom'):  // 食神科技 sskj.qxfoodom.com
+          sysTitle.value = '食神科技';
+          break;
+        default: 
+          sysTitle.value = t('public.sysName');
+      }
+    }
+
     const confirmAlarm = () => {
       localStorage.setItem('firstLogin', false);
     }
@@ -633,6 +649,7 @@ export default {
       showAlarm,
       alarmList,
       confirmAlarm,
+      sysTitle,
     };
   },
 

+ 28 - 2
src/views/login.vue

@@ -2,10 +2,12 @@
   <!-- 登录 -->
   <div class="login">
     <s-header
-        :name="sys ? sys.title : $t('public.sysName')"
+        :name="sys ? sys.title : sysTitle"
     ></s-header>
     <div class="loginLogoBox l-re">
-      <div class="loginLogo"></div>
+      <div class="loginLogo">
+        <img :src="logoName" alt="Logo">
+      </div>
       <div class="l-ab pointer languageCon">
         <!-- <div class="c-text-b">
           {{ compLang }}
@@ -89,6 +91,8 @@ import enUS from "vant/es/locale/lang/en-US";
 import zhCN from "vant/es/locale/lang/zh-CN";
 // 引入日文语言包
 import jaJP from 'vant/es/locale/lang/ja-JP';
+import defaultLogo from '../assets/login/logo.png';
+import shishenLogo from '../assets/login/shishenLogo.png';
 
 export default {
   setup() {
@@ -124,6 +128,9 @@ export default {
     const route = useRoute();
     const sys = ref(null);
     const currentLan = ref(''); // 当前语言
+    const logoName = ref(defaultLogo);
+    const sysTitle = ref('');
+
     // 页面初始化
     onMounted(() => {
       // 加载样式
@@ -152,7 +159,24 @@ export default {
       } else {
         currentLan.value = "English";
       }
+
+      getDomainFunc();
     });
+
+    const getDomainFunc = async () => {
+      const currentDomain = window.location.href;
+      console.log("href >>>", currentDomain);
+      switch (true) {
+        // case currentDomain.includes('//localhost'):
+        case currentDomain.includes('sskj.qxfoodom'):  // 食神科技 sskj.qxfoodom.com
+          logoName.value = shishenLogo;
+          sysTitle.value = '食神科技';
+          break;
+        default: 
+          logoName.value = defaultLogo;
+          sysTitle.value = t('public.sysName');
+      }
+    }
     const getSysFun = async () => {
       const {data} = await getSys({
         relationAdminId: route.query.relation_admin_id,
@@ -290,6 +314,8 @@ export default {
       onSelect,
       showPopover,
       currentLan,
+      logoName,
+      sysTitle,
     };
   },
   components: {