登录初步页面

main
赵培友 3 years ago
parent 305cab1f48
commit 300283b7dc
  1. BIN
      src/assets/font/IMPACT.TTF
  2. 6
      src/assets/font/font.css
  3. 2
      src/lang/zh.js
  4. 236
      src/page/login/index.vue
  5. 27
      src/page/login/userlogin.vue
  6. 3
      src/styles/common.scss
  7. 16
      src/styles/custom/custom.scss
  8. 177
      src/styles/login.scss

Binary file not shown.

@ -0,0 +1,6 @@
@font-face {
font-family: "Impact";
src: url('./IMPACT.TTF');
font-weight: normal;
font-style: normal;
}

@ -80,7 +80,7 @@ export default {
title: '登录 ',
info: 'BladeX 企业级开发平台',
tenantId: '请输入租户ID',
username: '请输入账号',
username: '请输入用户名',
password: '请输入密码',
wechat: '微信',
qq: 'QQ',

@ -1,155 +1,137 @@
<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>
<p class="title">{{ $t('login.info') }}</p>
<div style="font-size: 15px">
<span>----------------------------------------------</span>
<br>
<span>管理租户编号000000</span>
<br>
<span>超级管理员账号: admin / admin</span>
<br>
<span>人事账号: hr / hr</span>
<br>
<span>经理账号: manager / manager</span>
<br>
<span>老板账号: boss / boss</span>
<br>
<span>----------------------------------------------</span>
<br>
<span>普通租户编号详见租户管理模块</span>
<br>
<span>租户管理员账号: admin / admin</span>
<br>
<span>----------------------------------------------</span>
</div>
<!--<img class="img" src="/img/logo.png" alt="">-->
</div>
<!-- 左侧 -->
<div class="login-border">
<div class="login-main">
<h4 class="login-title">
{{ $t('login.title') }}{{website.title}}
<top-lang></top-lang>
</h4>
<userLogin v-if="activeName==='user'"></userLogin>
<codeLogin v-else-if="activeName==='code'"></codeLogin>
<thirdLogin v-else-if="activeName==='third'"></thirdLogin>
<div class="login-menu">
<a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>
<!--<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>-->
<a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>
<a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a>
<div class="login-logo"></div>
<div class="login-title">运维管理系统欢迎您</div>
<div class="login-subTitle">
WELCOME TO THE OPERATION AND MAINTENANCE<br />
MANAGEMENT SYSTEM
</div>
<userLogin></userLogin>
</div>
</div>
<!-- 右侧 -->
<div class="login-right"></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",
components: {
userLogin,
codeLogin,
thirdLogin,
topLang,
topColor
},
data() {
return {
time: "",
activeName: "user",
socialForm: {
tenantId: "000000",
source: "",
code: "",
state: "",
}
};
},
watch: {
$route() {
this.handleLogin();
}
},
created() {
export default {
name: "login",
components: {
userLogin,
codeLogin,
thirdLogin,
topLang,
topColor,
},
data() {
return {
time: "",
socialForm: {
tenantId: "000000",
source: "",
code: "",
state: "",
},
};
},
watch: {
$route() {
this.handleLogin();
this.getTime();
},
mounted() {
},
computed: {
...mapGetters(["website", "tagWel"])
},
created() {
this.handleLogin();
this.getTime();
},
mounted() {},
computed: {
...mapGetters(["website", "tagWel"]),
},
props: [],
methods: {
getTime() {
setInterval(() => {
this.time = dateFormat(new Date());
}, 1000);
},
props: [],
methods: {
getTime() {
setInterval(() => {
this.time = dateFormat(new Date());
}, 1000);
},
handleLogin() {
const topUrl = getTopUrl();
const redirectUrl = "/oauth/redirect/";
const ssoCode = "?code=";
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;
}
if (topUrl.includes(redirectUrl) && !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(() => {
handleLogin() {
const topUrl = getTopUrl();
const redirectUrl = "/oauth/redirect/";
const ssoCode = "?code=";
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;
}
if (
topUrl.includes(redirectUrl) &&
!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});
this.$router.push({ path: this.tagWel.value });
loading.close();
}).catch(() => {
})
.catch(() => {
loading.close();
});
} else if (!topUrl.includes(redirectUrl) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) {
const loading = this.$loading({
lock: true,
text: '单点系统登录中,请稍后。。。',
spinner: "el-icon-loading"
});
this.$store.dispatch("LoginBySso", this.socialForm).then(() => {
} else if (
!topUrl.includes(redirectUrl) &&
!validatenull(this.socialForm.code) &&
!validatenull(this.socialForm.state)
) {
const loading = this.$loading({
lock: true,
text: "单点系统登录中,请稍后。。。",
spinner: "el-icon-loading",
});
this.$store
.dispatch("LoginBySso", this.socialForm)
.then(() => {
window.location.href = topUrl.split(ssoCode)[0];
this.$router.push({path: this.tagWel.value});
this.$router.push({ path: this.tagWel.value });
loading.close();
}).catch(() => {
})
.catch(() => {
loading.close();
});
}
}
}
};
},
},
};
</script>
<style lang="scss">
@import "@/styles/login.scss";
<style lang="scss" scoped>
@import "@/styles/login.scss";
</style>

@ -4,26 +4,26 @@
:rules="loginRules"
ref="loginForm"
:model="loginForm"
label-width="0">
<el-form-item v-if="tenantMode" prop="tenantId">
label-width="0"
label-position="top"
>
<!-- <el-form-item v-if="tenantMode" prop="tenantId" label="用户名">
<el-input size="small"
@keyup.enter.native="handleLogin"
v-model="loginForm.tenantId"
auto-complete="off"
:placeholder="$t('login.tenantId')">
<i slot="prefix" class="icon-quanxian"/>
</el-input>
</el-form-item>
<el-form-item prop="username">
</el-form-item> -->
<el-form-item prop="username" label="用户名">
<el-input size="small"
@keyup.enter.native="handleLogin"
v-model="loginForm.username"
auto-complete="off"
:placeholder="$t('login.username')">
<i slot="prefix" class="icon-yonghu"/>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-form-item prop="password" label="密码">
<el-input size="small"
@keyup.enter.native="handleLogin"
:type="passwordType"
@ -31,10 +31,10 @@
auto-complete="off"
:placeholder="$t('login.password')">
<i class="el-icon-view el-input__icon" slot="suffix" @click="showPassword"/>
<i slot="prefix" class="icon-mima"/>
</el-input>
</el-form-item>
<el-form-item v-if="this.website.captchaMode" prop="code">
<div><el-checkbox v-model="rememberPwd">记住密码</el-checkbox></div>
<!-- <el-form-item v-if="this.website.captchaMode" prop="code">
<el-row :span="24">
<el-col :span="16">
<el-input size="small"
@ -52,7 +52,7 @@
</div>
</el-col>
</el-row>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button type="primary"
size="small"
@ -80,6 +80,7 @@
data() {
return {
tenantMode: this.website.tenantMode,
rememberPwd: false,
loginForm: {
//ID
tenantId: "000000",
@ -101,9 +102,9 @@
image: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
},
loginRules: {
tenantId: [
{required: false, message: "请输入租户ID", trigger: "blur"}
],
// tenantId: [
// {required: false, message: "ID", trigger: "blur"}
// ],
username: [
{required: true, message: "请输入用户名", trigger: "blur"}
],

@ -18,7 +18,8 @@
@import './media.scss';
//通用配置
@import './normalize.scss';
// 字体
@import '~@/assets/font/font.css';
a{
text-decoration: none;
color:#333;

@ -0,0 +1,16 @@
// input输入框
.el-input--small .el-input__inner {
width: 420px;
height: 50px;
line-height: 50px;
border-radius: 3px 3px 3px 3px;
color: #333;
position: relative;
border: 1px solid #CFCFCF
}
// input输入框label
.el-form--label-top .el-form-item__label {
font-size: 16px;
color: #273240;
padding: 0!important;
}

@ -5,31 +5,32 @@
width: 100%;
height: 100%;
margin: 0 auto;
background-image: url("/img/bg/bg.jpg");
background-image: url("/img/bg/bg4.jpg");
background-size: 100% 100%;
}
.login-weaper {
margin: 0 auto;
width: 1000px;
box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4);
width: 1393px;
height: 775px;
// box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4);
.el-input-group__append {
border: none;
}
}
.login-left,
.login-right,
.login-border {
position: relative;
min-height: 500px;
min-height: 775px;
align-items: center;
display: flex;
}
.login-left {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
.login-right {
border-top-right-radius: 9px;
border-bottom-right-radius: 9px;
justify-content: center;
flex-direction: column;
background-color: #8b9aac;
@ -39,145 +40,87 @@
position: relative;
}
.login-left .img {
width: 140px;
}
.login-time {
position: absolute;
left: 25px;
top: 25px;
width: 100%;
color: #fff;
font-weight: 200;
opacity: 0.9;
font-size: 18px;
overflow: hidden;
}
.login-left .title {
text-align: center;
color: #fff;
font-weight: bold;
font-size: 30px;
letter-spacing: 2px;
}
.login-border {
border-left: none;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-top-left-radius: 9px;
border-bottom-left-radius: 9px;
color: #fff;
background-color: #fff;
width: 50%;
float: left;
padding-top: 63px;
box-sizing: border-box;
}
.login-main {
margin: 0 auto;
width: 65%;
width: 334px;
box-sizing: border-box;
position: absolute;
top: 63px;
left: 50%;
transform: translateX(-50%);
}
.login-logo {
width: 118px;
height: 124px;
background: pink;
display: flex;
margin: 0 auto;
}
.login-main > h3 {
margin-bottom: 20px;
}
.login-main > p {
color: #76838f;
}
.login-title {
color: #333;
margin-bottom: 40px;
color: #273240;
// 字体
font-size: 30px;
font-weight: 500;
font-size: 22px;
text-align: center;
letter-spacing: 4px;
margin-top: 21px;
}
.login-menu {
margin-top: 40px;
width: 100%;
text-align: center;
a {
color: #999;
font-size: 12px;
margin: 0px 8px;
}
.login-subTitle {
font-size: 10px;
color: #405364;
margin-top: 8px;
margin-bottom: 46px;
}
.login-submit {
width: 100%;
height: 45px;
border: 1px solid #409EFF;
background: none;
font-size: 18px;
height: 50px;
background: #2E92F6;
font-size: 16px;
color: #fff;
letter-spacing: 2px;
font-weight: 300;
color: #409EFF;
cursor: pointer;
margin-top: 30px;
margin-top: 50px;
font-family: "neo";
transition: 0.25s;
}
.login-form {
margin: 10px 0;
i {
color: #333;
}
.el-form-item__content {
width: 100%;
}
.el-form-item {
margin-bottom: 12px;
}
.el-input {
input {
padding-bottom: 10px;
text-indent: 5px;
background: transparent;
border: none;
border-radius: 0;
color: #333;
border-bottom: 1px solid rgb(235, 237, 242);
}
.el-input__prefix {
i {
padding: 0 5px;
font-size: 16px !important;
}
}
position: absolute;
right: 6px;
}
}
.login-code {
display: flex;
align-items: center;
justify-content: space-around;
margin: 0 0 0 10px;
.el-input--small .el-input__inner {
width: 330px;
height: 50px;
line-height: 50px;
border-radius: 3px 3px 3px 3px;
color: #333;
position: relative;
}
.login-code-img {
margin-top: 2px;
width: 100px;
height: 38px;
background-color: #fdfdfd;
border: 1px solid #f0f0f0;
.el-form--label-top .el-form-item__label {
font-size: 16px;
color: #333;
font-size: 14px;
font-weight: bold;
letter-spacing: 5px;
line-height: 38px;
text-indent: 5px;
text-align: center;
cursor:pointer!important;
padding: 0!important;
}
.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before {
display: none;
}
.el-checkbox__inner {
border-color: #999;
}
.el-checkbox__label {
color: #999;
}
Loading…
Cancel
Save