Browse Source

登录页

feature
dai 3 years ago
parent
commit
9c3f10fe32
  1. 3
      .env.development
  2. 3
      .env.production.uat
  3. 1
      package.json
  4. 4
      public/index.html
  5. BIN
      src/assets/img/yantai/index/anniu.png
  6. BIN
      src/assets/img/yantai/index/db.png
  7. BIN
      src/assets/img/yantai/index/guanli.png
  8. BIN
      src/assets/img/yantai/index/shuju.png
  9. BIN
      src/assets/img/yantai/index/yd-by.png
  10. BIN
      src/assets/img/yantai/index/you.png
  11. BIN
      src/assets/img/yantai/index/yuanhu-you.png
  12. BIN
      src/assets/img/yantai/index/yuanhu-zuo.png
  13. BIN
      src/assets/img/yantai/index/zuo.png
  14. BIN
      src/assets/img/yantai/login/bg.png
  15. BIN
      src/assets/img/yantai/login/jiating.png
  16. BIN
      src/assets/img/yantai/login/jumin.png
  17. BIN
      src/assets/img/yantai/login/mima.png
  18. BIN
      src/assets/img/yantai/login/zhanghao.png
  19. 115
      src/assets/scss/pages/yantai-index.scss
  20. 210
      src/assets/scss/pages/yantai-login.scss
  21. 13
      src/router/index.js
  22. 88
      src/views/pages/yantai-index.vue
  23. 435
      src/views/pages/yantai-login.vue

3
.env.development

@ -9,4 +9,5 @@ VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev
#项目根路径 #项目根路径
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper
VUE_APP_CUSTOMER=yantai

3
.env.production.uat

@ -2,4 +2,5 @@ NODE_ENV=production
# VUE_APP_API_SERVER = http://120.27.18.76/api # VUE_APP_API_SERVER = http://120.27.18.76/api
VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
VUE_APP_NODE_ENV=prod:uat VUE_APP_NODE_ENV=prod:uat
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper
VUE_APP_CUSTOMER=yantai

1
package.json

@ -36,6 +36,7 @@
"mint-ui": "^2.2.13", "mint-ui": "^2.2.13",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"ol": "^6.9.0", "ol": "^6.9.0",
"particles.js": "^2.0.0",
"portfinder": "^1.0.21", "portfinder": "^1.0.21",
"qs": "^6.7.0", "qs": "^6.7.0",
"quill": "^1.3.6", "quill": "^1.3.6",

4
public/index.html

@ -7,6 +7,10 @@
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,viewport-fit=cover" /> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,viewport-fit=cover" />
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" /> <link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=LWBBZ-TIGC3-VFP3L-YNMWH-FJB7T-JFBLO"></script> <script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=LWBBZ-TIGC3-VFP3L-YNMWH-FJB7T-JFBLO"></script>
<script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script> <script charset="utf-8" src="https://map.qq.com/api/gljs?v=1.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<!-- f2图表 --> <!-- f2图表 -->

BIN
src/assets/img/yantai/index/anniu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/assets/img/yantai/index/db.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
src/assets/img/yantai/index/guanli.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
src/assets/img/yantai/index/shuju.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
src/assets/img/yantai/index/yd-by.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
src/assets/img/yantai/index/you.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/img/yantai/index/yuanhu-you.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

BIN
src/assets/img/yantai/index/yuanhu-zuo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

BIN
src/assets/img/yantai/index/zuo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/img/yantai/login/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
src/assets/img/yantai/login/jiating.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
src/assets/img/yantai/login/jumin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
src/assets/img/yantai/login/mima.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/img/yantai/login/zhanghao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

115
src/assets/scss/pages/yantai-index.scss

@ -0,0 +1,115 @@
@import "~@/assets/scss/c/config.scss";
@import "~@/assets/scss/c/function.scss";
.g-bd {
&::before,
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
content: "";
}
&::before {
background-image: url(~@/assets/img/index/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
}
.m-list {
position: fixed;
top: 50%;
left: 0;
right: 0;
margin: auto;
transform: translateY(-50%);
.list {
display: flex;
justify-content: space-around;
width: 100%;
.item {
width: 612px;
max-width: 612px;
text-align: center;
cursor: pointer;
&.z-on {
.name {
color: #ffffff;
background-color: transparent;
border-color: #ffffff;
&::before {
background-color: #ffffff;
}
}
}
.logo {
width: 100%;
}
.name {
position: relative;
width: auto;
display: inline-block;
text-align: center;
margin: 8px auto;
padding-left: 48px;
padding-right: 20px;
height: 42px;
line-height: 40px;
background: #ffffff;
border: 1px solid #b9b9b9;
border-radius: 21px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 500;
color: #002fec;
&::before {
content: "";
position: absolute;
display: block;
top: 0;
bottom: 0;
left: 20px;
margin: auto;
width: 14px;
height: 14px;
background: #0065f6;
border-radius: 50%;
}
}
.tip {
display: block;
margin: 0 auto;
}
}
}
}
.m-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
color: rgba(255, 255, 255, 0.6);
text-align: center;
p {
margin: 10px 0;
}
a {
padding: 0 5px;
color: rgba(255, 255, 255, 0.6);
&:focus,
&:hover {
color: #fff;
}
}
}

210
src/assets/scss/pages/yantai-login.scss

@ -0,0 +1,210 @@
@import "~@/assets/scss/c/config.scss";
@import "~@/assets/scss/c/function.scss";
.g-bd {
&::before,
&::after {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
content: "";
}
&::before {
background-image: url(~@/assets/img/yantai/login/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
}
.m-snow-box {
position: absolute;
top: 20vh;
width: 35vw;
height: 50vh;
left: 13vw;
border-radius: 40%;
// overflow: hidden;
}
.m-fm {
position: absolute;
top: 0;
bottom: 0;
right: 13%;
margin: auto;
width: 484px;
height: 429px;
background: rgba(#fff, 1);
box-shadow: 0px 0px 20px 8px rgba(213, 225, 238, 0.7);
border-radius: 12px 12px 12px 12px;
&:hover {
opacity: 1;
background: rgba(#fff, 1);
}
.wrap {
padding-top: 5px;
.title {
margin: 0 auto;
width: 400px;
line-height: 80px;
border-bottom: 1px solid #d4d4d4;
font-size: 34px;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
text-align: center;
}
.fm {
padding: 15px 30px;
.fm-item {
box-sizing: border-box;
margin: 0 auto;
margin-top: 16px;
width: 400px;
height: 46px;
line-height: 46px;
border: 1px solid #c6c6c6;
border-radius: 4px;
display: flex;
align-items: center;
.input {
width: 85%;
input {
display: block;
padding-left: 15px;
line-height: 44px;
height: 44px;
width: 100%;
border: none;
}
}
.ico {
position: relative;
width: 35px;
height: 46px;
img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
}
.fm-captcha {
box-sizing: border-box;
margin: 0 auto;
margin-top: 16px;
width: 400px;
display: flex;
align-items: center;
.fm-item {
margin: 0;
width: 200px;
}
.captcha {
position: relative;
margin-left: auto;
width: 180px;
height: 46px;
img {
display: block;
width: 100%;
height: 100%;
background-color: #eee;
border: none;
}
}
}
.fm-btn {
box-sizing: border-box;
margin: 0 auto;
margin-top: 40px;
width: 400px;
height: 56px;
line-height: 56px;
background: linear-gradient(90deg, #1a5afd, #26c4ff);
border-radius: 4px;
font-size: 23px;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
text-align: center;
cursor: pointer;
}
}
.hint {
display: none;
padding-left: 40px;
color: rgb(255, 80, 80);
}
}
}
.m-footer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
color: rgba(255, 255, 255, 0.6);
text-align: center;
p {
margin: 10px 0;
}
a {
padding: 0 5px;
color: rgba(255, 255, 255, 0.6);
&:focus,
&:hover {
color: #fff;
}
}
}
.m-pop {
height: auto;
.div_row {
height: 50px;
text-align: center;
line-height: 50px;
&:hover {
color: rgb(2, 119, 173);
font-weight: bold;
text-decoration: underline;
}
.i_icon {
width: 15px;
height: 15px;
margin-right: 10px;
float: left;
}
.span_name {
font-size: 18px;
cursor: pointer;
/* color: rgb(37, 156, 235); */
}
}
}

13
src/router/index.js

@ -6,6 +6,7 @@ import store from "@/js/store";
Vue.use(Router); Vue.use(Router);
const CUSTOMER = process.env.VUE_APP_CUSTOMER;
// 页面路由(独立页面) // 页面路由(独立页面)
export const pageRoutes = [ export const pageRoutes = [
{ {
@ -26,7 +27,11 @@ export const pageRoutes = [
}, },
{ {
path: "/login", path: "/login",
component: () => import("@/views/pages/login"), component: () => {
return CUSTOMER == "yantai"
? import("@/views/pages/yantai-login")
: import("@/views/pages/login");
},
name: "login", name: "login",
meta: { meta: {
title: "登录", title: "登录",
@ -35,7 +40,11 @@ export const pageRoutes = [
{ {
path: "/", path: "/",
name: "index", name: "index",
component: () => import("@/views/pages/index"), component: () => {
return CUSTOMER == "yantai"
? import("@/views/pages/yantai-index")
: import("@/views/pages/index");
},
}, },
{ {
path: "/indexWork", path: "/indexWork",

88
src/views/pages/yantai-index.vue

@ -0,0 +1,88 @@
<template>
<div class="g-app">
<div class="g-bd" v-if="true">
<div class="m-list">
<div class="list">
<div class="item" @click="handleClickItem(1)">
<img class="logo" src="@/assets/img/index/logo-1.png" alt="" />
<!-- 党建引领基层治理互联管理平台 -->
<div class="name">数字社区管理平台</div>
<img src="@/assets/img/index/zhuangshi.png" class="tip" />
</div>
<div class="item z-on" @click="handleClickItem(2)">
<img class="logo" src="@/assets/img/index/logo-2.png" alt="" />
<!-- 数据分析可视化平台 -->
<div class="name">数字社区可视化平台</div>
<img src="@/assets/img/index/zhuangshi.png" class="tip" />
</div>
</div>
</div>
<div class="m-footer">
<div class="login-footer">
<p>
<a href="http://www.elinkchina.com.cn/" target="_blank">{{ $t('login.copyright') }}</a>
</p>
</div>
</div>
</div>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
import { Loading } from 'element-ui' // Loading
import JSEncrypt from 'jsencrypt' //
let loading //
export default {
data() {
return {
pubKey: null, //
isShowLogin: true,
i18nMessages: messages
}
},
components: {},
computed: {},
created() {},
mounted() {},
methods: {
handleClickItem(k) {
if (k == 1) {
this.$router.replace({ name: 'main' })
} else if (k == 2) {
this.$router.replace({ name: 'main-shuju' })
}
},
//
getAutoLogin(platformToken) {
this.dataForm.thirdToken = platformToken
this.dataForm.platform = 'pyld'
this.$http
.post(`/auth/sso/oper/third/login`, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
if (res.code == 8302) {
return this.$message.error(res.msg)
}
return this.$message.error(res.msg)
}
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => {})
// epmet-ext9.elinkservice.cn/platform-admin
}
}
}
</script>
<style lang="scss" src="@/assets/scss/pages/indexWork.scss" scoped></style>

435
src/views/pages/yantai-login.vue

@ -0,0 +1,435 @@
<template>
<div class="g-app">
<div class="g-bd" v-if="isShowLogin || true">
<div class="m-snow-box" id="snow_box"></div>
<div class="m-fm animate__animated animate__backInLeft">
<div class="wrap">
<h2 class="title">{{ $t("brand.work") }}</h2>
<div class="fm">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon
>
<div class="fm-item">
<div class="ico">
<img src="@/assets/img/login/zhanghao.png" alt="" />
</div>
<div class="input">
<input
type="text"
v-model="dataForm.phone"
placeholder="账号"
/>
</div>
</div>
<div class="fm-item">
<div class="ico">
<img src="@/assets/img/login/mima.png" alt="" />
</div>
<div class="input">
<input
type="password"
v-model="dataForm.password"
:placeholder="$t('login.password')"
/>
</div>
</div>
<div class="fm-captcha">
<div class="fm-item">
<div class="input">
<input
type="text"
v-model="dataForm.captcha"
placeholder="验证码"
/>
</div>
</div>
<div class="captcha">
<img :src="captchaPath" @click="getCaptcha()" />
</div>
</div>
<div class="fm-btn" @click="dataFormSubmitHandle()">
{{ $t("login.title") }}
</div>
<div class="hint">请使用小程序端的账号密码登录</div>
</el-form>
</div>
</div>
</div>
<div class="m-footer">
<div class="login-footer">
<p>
<a href="" target="_blank">{{ $t("login.copyright") }}</a>
</p>
</div>
</div>
</div>
<c-dialog
:showFooter="false"
:title="'选择客户'"
:isNest="false"
:visible="diaVisible"
:dialogHeight="0.8"
:width="30"
:top="'120px'"
@cancel="diaCancel"
>
<div class="m-pop">
<div v-for="(item, index) in tableData" :key="index" class="div_row">
<span @click="selectCustomer(item)" class="span_name">{{
item.customerName
}}</span>
</div>
</div>
</c-dialog>
</div>
</template>
<script>
import CDialog from "@c/CDialog";
import particles_js from "particles.js/particles.js";
import { messages } from "@/i18n";
import { getUUID } from "@/utils";
import { Loading } from "element-ui"; // Loading
import JSEncrypt from "jsencrypt"; //
let loading; //
export default {
data() {
return {
pubKey: null, //
isShowLogin: true,
i18nMessages: messages,
captchaPath: "",
dataForm: {
customerId: "",
app: "gov",
client: "web",
username: "",
phone: "",
password: "",
uuid: "",
captcha: "",
},
//
diaVisible: false,
tableLoading: false,
tableData: [],
};
},
components: {
CDialog,
},
computed: {
dataRule() {
return {
phone: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
password: [
{ required: true, message: "密码不能为空", trigger: "blur" },
],
captcha: [
{ required: true, message: "验证码不能为空", trigger: "blur" },
],
};
},
},
created() {
//
if (this.$route.query.platformToken) {
this.isShowLogin = false;
this.getAutoLogin(this.$route.query.platformToken);
} else {
this.getCaptcha();
//
this.getPubKey();
}
},
mounted() {
localStorage.removeItem("showHeader");
particlesJS(
"snow_box",
{
particles: {
number: {
value: 380,
density: {
enable: true,
value_area: 800,
},
},
color: {
value: "#ffffff",
},
shape: {
type: "circle",
stroke: {
width: 0,
color: "#000000",
},
polygon: {
nb_sides: 5,
},
image: {
src: "img/github.svg",
width: 100,
height: 100,
},
},
opacity: {
value: 0.5,
random: false,
anim: {
enable: false,
speed: 1,
opacity_min: 0.1,
sync: false,
},
},
size: {
value: 3,
random: true,
anim: {
enable: false,
speed: 40,
size_min: 0.1,
sync: false,
},
},
line_linked: {
enable: true,
distance: 150,
color: "#ffffff",
opacity: 0,
width: 1,
},
move: {
enable: true,
speed: 6,
direction: "none",
random: false,
straight: false,
out_mode: "out",
bounce: false,
attract: {
enable: false,
rotateX: 600,
rotateY: 1200,
},
},
},
interactivity: {
detect_on: "canvas",
events: {
onhover: {
enable: true,
mode: "grab",
},
onclick: {
enable: true,
mode: "push",
},
resize: true,
},
modes: {
grab: {
distance: 140,
line_linked: {
opacity: 1,
},
},
bubble: {
distance: 400,
size: 40,
duration: 2,
opacity: 8,
speed: 3,
},
repulse: {
distance: 200,
duration: 0.4,
},
push: {
particles_nb: 4,
},
remove: {
particles_nb: 2,
},
},
},
retina_detect: true,
},
function () {
console.log("callback - particles.js config loaded");
}
);
},
methods: {
//
getPubKey() {
this.$http
.post("/auth/govweb/getKey")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.pubKey = res.data; // ;
})
.catch(() => {});
},
//
getCaptcha() {
this.dataForm.uuid = getUUID();
this.captchaPath = `${window.SITE_CONFIG["apiURL"]}/auth/login/captcha?uuid=${this.dataForm.uuid}`;
},
//
dataFormSubmitHandle() {
this.$refs["dataForm"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
}
this.startLoading();
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/epmetuser/customerstaff/customerlist'
const url = "/epmetuser/customerstaff/customerlist";
const params = {
phone: this.dataForm.phone,
};
// this.$http
// .post(url, params).then(({ data })=> {
// console.log('res--comll', data)
// if (data.data.length === 0) {
// //
// this.$message.error('')
// this.endLoading()
// } else if (data.data.length === 1) {
// this.selectCustomer(data.data[0])
// } else {
// this.endLoading()
// this.diaVisible = true
// this.$nextTick(() => {
// this.tableData = data.data
// })
// }
// }).catch((err) => {
// this.endLoading()
// this.$message.error(err)
// })
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
if (data.length === 0) {
//
this.$message.error("账号不存在");
this.endLoading();
} else if (data.length === 1) {
this.selectCustomer(data[0]);
} else {
this.endLoading();
this.diaVisible = true;
this.$nextTick(() => {
this.tableData = data;
});
}
},
(rspMsg, data) => {
this.endLoading();
this.$message.error(rspMsg);
}
);
});
},
//
getAutoLogin(platformToken) {
this.dataForm.thirdToken = platformToken;
this.dataForm.platform = "pyld";
this.$http
.post(`/auth/sso/oper/third/login`, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
if (res.code == 8302) {
return this.$message.error(res.msg);
}
return this.$message.error(res.msg);
}
localStorage.setItem("customerId", res.data.customerId);
localStorage.setItem("userType", "work");
localStorage.setItem("showHeader", "0");
localStorage.setItem("token", res.data.token);
this.$router.replace({ name: "home" });
})
.catch(() => {});
// epmet-ext9.elinkservice.cn/platform-admin
},
//
selectCustomer(row) {
localStorage.setItem("customerId", row.customerId);
localStorage.setItem("customerName", row.customerName);
this.startLoading();
// const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/auth/govweb/login'
const url = "/auth/govweb/login";
this.dataForm.customerId = row.customerId;
let param = {};
Object.assign(param, this.dataForm);
param.password = this.encryptedData(this.pubKey, this.dataForm.password);
this.$http
.post(url, param)
.then(({ data: res }) => {
this.endLoading();
if (res.code !== 0) {
this.getCaptcha();
return this.$message.error(res.msg);
}
this.diaVisible = false;
localStorage.setItem("userType", "work");
localStorage.setItem("token", res.data.token);
this.$router.replace({ name: "index" });
})
.catch(() => {
this.endLoading();
});
},
//
diaCancel() {
this.diaVisible = false;
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
//
encryptedData(key, data) {
// JSEncrypt
let encryptor = new JSEncrypt();
//
encryptor.setPublicKey(key);
//
return encryptor.encrypt(data);
},
},
};
</script>
<style lang="scss" src="@/assets/scss/pages/yantai-login.scss" scoped></style>
Loading…
Cancel
Save