shuishen
2022-03-15 85c7235b4fe8d38f6e635d6af17d19642d6f3421
样式更改
4 files modified
203 ■■■■■ changed files
public/img/bg/bg.jpg patch | view | raw | blame | history
src/main.js 72 ●●●● patch | view | raw | blame | history
src/page/login/index.vue 73 ●●●● patch | view | raw | blame | history
src/styles/login.scss 58 ●●●● patch | view | raw | blame | history
public/img/bg/bg.jpg

src/main.js
@@ -1,62 +1,62 @@
import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import './cache';//页面缓存
import store from './store';
import Vue from 'vue'
import axios from './router/axios'
import VueAxios from 'vue-axios'
import App from './App'
import router from './router/router'
import './permission' // 权限
import './error' // 日志
import './cache'//页面缓存
import store from './store'
import {loadStyle} from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import * as urls from '@/config/env'
import Element from 'element-ui'
import {
  iconfontUrl,
  iconfontVersion
} from '@/config/env';
import i18n from './lang'; // Internationalization
import './styles/common.scss';
import basicBlock from './components/basic-block/main';
import basicContainer from './components/basic-container/main';
import thirdRegister from './components/third-register/main';
import avueUeditor from 'avue-plugin-ueditor';
import website from '@/config/website';
import crudCommon from '@/mixins/crud';
} from '@/config/env'
import i18n from './lang' // Internationalization
import './styles/common.scss'
import basicBlock from './components/basic-block/main'
import basicContainer from './components/basic-container/main'
import thirdRegister from './components/third-register/main'
import avueUeditor from 'avue-plugin-ueditor'
import website from '@/config/website'
import crudCommon from '@/mixins/crud'
// 注册全局crud驱动
window.$crudCommon = crudCommon;
window.$crudCommon = crudCommon
// 加载Vue拓展
Vue.use(router);
Vue.use(VueAxios, axios);
Vue.use(router)
Vue.use(VueAxios, axios)
Vue.use(Element, {
  i18n: (key, value) => i18n.t(key, value)
});
})
Vue.use(window.AVUE, {
  size: 'small',
  tableSize: 'small',
  calcHeight: 65,
  i18n: (key, value) => i18n.t(key, value)
});
})
// 注册全局容器
Vue.component('basicContainer', basicContainer);
Vue.component('basicBlock', basicBlock);
Vue.component('thirdRegister', thirdRegister);
Vue.component('avueUeditor', avueUeditor);
Vue.component('basicContainer', basicContainer)
Vue.component('basicBlock', basicBlock)
Vue.component('thirdRegister', thirdRegister)
Vue.component('avueUeditor', avueUeditor)
// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key];
});
    Vue.prototype[key] = urls[key]
})
// 加载website
Vue.prototype.website = website;
Vue.prototype.website = website
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele));
});
    loadStyle(iconfontUrl.replace('$key', ele))
})
Vue.config.productionTip = false;
Vue.config.productionTip = false
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app');
}).$mount('#app')
src/page/login/index.vue
@@ -1,16 +1,14 @@
<template>
  <div class="login-container"
       ref="login"
       @keyup.enter.native="handleLogin">
    <div class="login-container" ref="login" @keyup.enter.native="handleLogin">
    <top-color v-show="false"></top-color>
    <div class="login-weaper animated bounceInDown">
      <div class="login-left">
        <div class="login-time">
          {{time}}
        </div>
        <img class="img" src="/img/logos.png" alt="">
                <div class="login-time">{{time}}</div>
                <img class="img" src="/img/logos.png" alt />
        <p class="title">{{ $t('login.info') }}</p>
      </div>
            <div class="login-radius"></div>
            <div class="login-radius-bg"></div>
      <div class="login-border">
        <div class="login-main">
          <h4 class="login-title">
@@ -26,21 +24,20 @@
<!--            <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>-->
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import userLogin from "./userlogin";
  import codeLogin from "./codelogin";
  import thirdLogin from "./thirdlogin";
  import {mapGetters} from "vuex";
  import {dateFormat} from "@/util/date";
  import {validatenull} from "@/util/validate";
  import topLang from "@/page/index/top/top-lang";
  import topColor from "@/page/index/top/top-color";
  import {getQueryString, getTopUrl} from "@/util/util";
import userLogin from "./userlogin"
import codeLogin from "./codelogin"
import thirdLogin from "./thirdlogin"
import { mapGetters } from "vuex"
import { dateFormat } from "@/util/date"
import { validatenull } from "@/util/validate"
import topLang from "@/page/index/top/top-lang"
import topColor from "@/page/index/top/top-color"
import { getQueryString, getTopUrl } from "@/util/util"
  export default {
    name: "login",
@@ -61,16 +58,16 @@
          code: "",
          state: "",
        }
      };
        }
    },
    watch: {
      $route() {
        this.handleLogin();
            this.handleLogin()
      }
    },
    created() {
      this.handleLogin();
      this.getTime();
        this.handleLogin()
        this.getTime()
    },
    mounted() {
    },
@@ -81,33 +78,33 @@
    methods: {
      getTime() {
        setInterval(() => {
          this.time = dateFormat(new Date());
        }, 1000);
                this.time = dateFormat(new Date())
            }, 1000)
      },
      handleLogin() {
        const topUrl = getTopUrl();
        const redirectUrl = "/oauth/redirect/";
        this.socialForm.source = getQueryString("source");
        this.socialForm.code = getQueryString("code");
        this.socialForm.state = getQueryString("state");
            const topUrl = getTopUrl()
            const redirectUrl = "/oauth/redirect/"
            this.socialForm.source = getQueryString("source")
            this.socialForm.code = getQueryString("code")
            this.socialForm.state = getQueryString("state")
        if (validatenull(this.socialForm.source) && topUrl.includes(redirectUrl)) {
          let source = topUrl.split("?")[0];
          source = source.split(redirectUrl)[1];
          this.socialForm.source = source;
                let source = topUrl.split("?")[0]
                source = source.split(redirectUrl)[1]
                this.socialForm.source = source
        }
        if (!validatenull(this.socialForm.source) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) {
          const loading = this.$loading({
            lock: true,
            text: '第三方系统登录中,请稍后。。。',
            spinner: "el-icon-loading"
          });
                })
          this.$store.dispatch("LoginBySocial", this.socialForm).then(() => {
            window.location.href = topUrl.split(redirectUrl)[0];
            this.$router.push({path: this.tagWel.value});
            loading.close();
                    window.location.href = topUrl.split(redirectUrl)[0]
                    this.$router.push({ path: this.tagWel.value })
                    loading.close()
          }).catch(() => {
            loading.close();
          });
                    loading.close()
                })
        }
      }
    }
@@ -115,5 +112,5 @@
</script>
<style lang="scss">
  @import "@/styles/login.scss";
@import '@/styles/login.scss';
</style>
src/styles/login.scss
@@ -10,8 +10,15 @@
}
.login-weaper {
  margin: 0 auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
  width: 1000px;
    height: 500px;
    min-height: 500px;
  box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4);
  .el-input-group__append {
@@ -20,7 +27,9 @@
}
.login-left,
.login-border {
.login-border,
.login-radius,
.login-radius-bg {
  position: relative;
  min-height: 500px;
  align-items: center;
@@ -28,15 +37,30 @@
}
.login-left {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
    position: absolute;
    left: 0;
    top: -40px;
    padding: 40px 0;
    width: 34%;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
  justify-content: center;
  flex-direction: column;
  background-color: #409EFF;
    background-color: #02255e;
  color: #fff;
  float: left;
  width: 50%;
  position: relative;
    z-index: 10;
}
.login-radius {
    position: absolute;
    left: 34%;
    top: -40px;
    padding: 40px 0;
    width: 16%;
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
    background-color: #02255e;
    z-index: 10;
}
.login-left .img {
@@ -65,14 +89,22 @@
}
.login-border {
    position: absolute;
    right: 0;
  border-left: none;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
  color: #fff;
  background-color: #fff;
  width: 50%;
  float: left;
  box-sizing: border-box;
}
.login-radius-bg {
    position: absolute;
    left: 34%;
    background-color: #fff;
    width: 16%;
}
.login-main {
@@ -113,12 +145,12 @@
.login-submit {
  width: 100%;
  height: 45px;
  border: 1px solid #409EFF;
    border: 1px solid #02255e;
  background: none;
  font-size: 18px;
  letter-spacing: 2px;
  font-weight: 300;
  color: #409EFF;
    color: #02255e;
  cursor: pointer;
  margin-top: 30px;
  font-family: "neo";