dai 4 years ago
parent
commit
5ce411ddef
  1. BIN
      epmet-oper-web/src/assets/img/index/bg.png
  2. BIN
      epmet-oper-web/src/assets/img/index/logo-1.png
  3. BIN
      epmet-oper-web/src/assets/img/index/logo-2.png
  4. BIN
      epmet-oper-web/src/assets/img/index/zhuangshi.png
  5. BIN
      epmet-oper-web/src/assets/img/login/bg.png
  6. BIN
      epmet-oper-web/src/assets/img/login/mima.png
  7. BIN
      epmet-oper-web/src/assets/img/login/zhanghao.png
  8. 115
      epmet-oper-web/src/assets/scss/pages/indexWork.scss
  9. 4
      epmet-oper-web/src/assets/scss/pages/login.scss
  10. 167
      epmet-oper-web/src/assets/scss/pages/loginWork.scss
  11. 127
      epmet-oper-web/src/router/index.js
  12. 86
      epmet-oper-web/src/views/pages/indexWork.vue
  13. 375
      epmet-oper-web/src/views/pages/loginWork.vue

BIN
epmet-oper-web/src/assets/img/index/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

BIN
epmet-oper-web/src/assets/img/index/logo-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
epmet-oper-web/src/assets/img/index/logo-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
epmet-oper-web/src/assets/img/index/zhuangshi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
epmet-oper-web/src/assets/img/login/bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

BIN
epmet-oper-web/src/assets/img/login/mima.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

BIN
epmet-oper-web/src/assets/img/login/zhanghao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

115
epmet-oper-web/src/assets/scss/pages/indexWork.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;
}
}
}

4
epmet-oper-web/src/assets/scss/pages/login.scss

@ -7,7 +7,7 @@
bottom: 0;
left: 0;
z-index: -1;
content: '';
content: "";
}
&::before {
background-image: url(~@/assets/img/login_bg.jpg);
@ -90,7 +90,7 @@
right: 0;
left: 0;
z-index: 1;
content: '';
content: "";
height: 1px;
margin-top: -0.5px;
background-color: $--border-color-base;

167
epmet-oper-web/src/assets/scss/pages/loginWork.scss

@ -0,0 +1,167 @@
@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/login/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
}
.m-fm {
position: absolute;
top: 0;
bottom: 0;
right: 13%;
margin: auto;
width: 484px;
height: 429px;
background: #ffffff;
box-shadow: 0px 5px 10px 0px rgba(213, 225, 238, 0.5);
border-radius: 12px 12px 12px 12px;
.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;
}
}
}

127
epmet-oper-web/src/router/index.js

@ -1,18 +1,21 @@
import Vue from 'vue'
import Router from 'vue-router'
import http from '@/utils/request'
import { isURL } from '@/utils/validate'
import {
isURL
} from '@/utils/validate'
import store from '@/js/store'
Vue.use(Router)
// 页面路由(独立页面)
export const pageRoutes = [
{
export const pageRoutes = [{
path: '/404',
component: () => import('@/views/pages/404'),
name: '404',
meta: { title: '404未找到' },
meta: {
title: '404未找到'
},
beforeEnter(to, from, next) {
// 拦截处理特殊业务场景
// 如果, 重定向路由包含__双下划线, 为临时添加路由
@ -26,13 +29,25 @@ export const pageRoutes = [
path: '/login',
component: () => import('@/views/pages/login'),
name: 'login',
meta: { title: '登录' }
meta: {
title: '登录'
}
},
{
path: '/loginWork',
component: () => import('@/views/pages/loginWork'),
name: 'loginWork',
meta: { title: '工作端登录' }
meta: {
title: '工作端登录'
}
},
{
path: '/indexWork',
component: () => import('@/views/pages/indexWork'),
name: 'indexWork',
meta: {
title: '工作端首页'
}
}
]
@ -41,14 +56,20 @@ export const moduleRoutes = {
path: '/',
component: () => import('@/views/main'),
name: 'main',
redirect: { name: 'home' },
meta: { title: '主入口布局' },
children: [
{
redirect: {
name: 'home'
},
meta: {
title: '主入口布局'
},
children: [{
path: '/home',
component: () => import('@/views/modules/home'),
name: 'home',
meta: { title: '首页', isTab: true }
meta: {
title: '首页',
isTab: true
}
}
// {
// path: '/homeWork',
@ -66,7 +87,10 @@ export function addDynamicRoute(routeParams, router) {
(item) => item.name === routeName
)[0]
if (dynamicRoute) {
return router.push({ name: routeName, params: routeParams.params })
return router.push({
name: routeName,
params: routeParams.params
})
}
// 否则: 添加并全局变量保存, 再跳转
dynamicRoute = {
@ -79,20 +103,23 @@ export function addDynamicRoute(routeParams, router) {
title: `${routeParams.title}`
}
}
router.addRoutes([
{
...moduleRoutes,
name: `main-dynamic__${dynamicRoute.name}`,
children: [dynamicRoute]
}
])
router.addRoutes([{
...moduleRoutes,
name: `main-dynamic__${dynamicRoute.name}`,
children: [dynamicRoute]
}])
window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute)
router.push({ name: dynamicRoute.name, params: routeParams.params })
router.push({
name: dynamicRoute.name,
params: routeParams.params
})
}
const router = new Router({
mode: 'hash',
scrollBehavior: () => ({ y: 0 }),
scrollBehavior: () => ({
y: 0
}),
routes: pageRoutes.concat(moduleRoutes)
})
@ -119,11 +146,11 @@ router.beforeEach((to, from, next) => {
// 获取菜单列表, 添加并全局变量保存
const userType = localStorage.getItem('userType')
if (userType === 'work') {
const customerId=localStorage.getItem('customerId')
console.log('customerId:' ,customerId)
const customerId = localStorage.getItem('customerId')
console.log('customerId:', customerId)
// if(customerId==='1e68188b8f7e9ab15658c164bd5b3676'){
// // if(customerId==='45687aa479955f9d06204d415238f7cc'){
// const menuList=[
@ -174,42 +201,60 @@ router.beforeEach((to, from, next) => {
// // next({ ...to, replace: true })
// next({ ...to, replace: true })
// }else{
http
http
.get('/gov/access/menu/nav')
.then(({ data: res }) => {
.then(({
data: res
}) => {
if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg)
return next({ name: 'loginWork' })
return next({
name: 'loginWork'
})
}
window.SITE_CONFIG['menuList'] = res.data
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// next({ ...to, replace: true })
next({ ...to, replace: true })
next({
...to,
replace: true
})
})
.catch(() => {
next({ name: 'loginWork' })
next({
name: 'loginWork'
})
})
// }
// localStorage.getItem('customerId')
// 1e68188b8f7e9ab15658c164bd5b3676
} else {
http
.get('/oper/access/menu/nav')
.then(({ data: res }) => {
.then(({
data: res
}) => {
if (res.code !== 0) {
// Vue.prototype.$message.error(res.msg)
return next({ name: 'login' })
return next({
name: 'login'
})
}
window.SITE_CONFIG['menuList'] = res.data
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
// next({ ...to, replace: true })
next({ ...to, replace: true })
next({
...to,
replace: true
})
})
.catch(() => {
next({ name: 'login' })
next({
name: 'login'
})
})
}
})
@ -273,16 +318,20 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
return fnAddDynamicMenuRoutes(temp, routes)
}
// 添加路由
router.addRoutes([
{
router.addRoutes([{
...moduleRoutes,
name: 'main-dynamic-menu',
children: routes
},
{ path: '*', redirect: { name: '404' } }
{
path: '*',
redirect: {
name: '404'
}
}
])
window.SITE_CONFIG['dynamicMenuRoutes'] = routes
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
}
export default router
export default router

86
epmet-oper-web/src/views/pages/indexWork.vue

@ -0,0 +1,86 @@
<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="" 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: 'home' })
} else if (k == 2) {
this.$router.replace({ name: 'home' })
}
},
//
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')
Cookies.set('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"></style>

375
epmet-oper-web/src/views/pages/loginWork.vue

@ -1,141 +1,93 @@
<template>
<div v-if="isShowLogin"
class="aui-wrapper aui-page__login">
<div class="aui-content__wrapper">
<main class="aui-content">
<div class="login-header">
<h2 class="login-brand">{{ $t('brand.work') }}</h2>
</div>
<div class="login-body">
<h3 class="login-title">{{ $t('login.title') }}</h3>
<el-form :model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
status-icon>
<!-- <el-form-item>
<el-select v-model="$i18n.locale"
class="w-percent-100">
<el-option v-for="(val, key) in i18nMessages"
:key="key"
:label="val._lang"
:value="key"></el-option>
</el-select>
</el-form-item> -->
<el-form-item prop="phone">
<el-input v-model="dataForm.phone"
placeholder="手机号">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-user"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password"
type="password"
:placeholder="$t('login.password')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-lock"></use>
</svg>
</span>
</el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha"
:placeholder="$t('login.captcha')">
<span slot="prefix"
class="el-input__icon">
<svg class="icon-svg"
aria-hidden="true">
<use xlink:href="#icon-safetycertificate"></use>
</svg>
</span>
</el-input>
</el-col>
<el-col :span="10"
class="login-captcha">
<img :src="captchaPath"
@click="getCaptcha()">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="dataFormSubmitHandle()"
class="w-percent-100">{{ $t('login.title') }}</el-button>
</el-form-item>
</el-form>
<div class="div_tip">
<p class="p_tip">
{{ '请使用小程序端的账号密码登录'}}
</p>
<div class="g-app">
<div class="g-bd" v-if="isShowLogin || true">
<div class="m-fm">
<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="https://demo.cloud.renren.io/renren-cloud"
target="_blank">{{ $t('login.demo') }}</a>
<a href="" target="_blank">{{ $t('login.copyright') }}</a>
</p>
<!-- 2020 © renren.io -->
<p><a href="https://www.renren.io/"
target="_blank">{{ $t('login.copyright') }}</a></p>
</div>
</main>
</div>
</div>
<c-dialog :showFooter='false'
:title="'选择客户'"
:isNest="false"
:visible="diaVisible"
:dialogHeight="0.8"
:width="30"
:top="'120px'"
@cancel="diaCancel">
<c-dialog
:showFooter="false"
:title="'选择客户'"
:isNest="false"
:visible="diaVisible"
:dialogHeight="0.8"
:width="30"
:top="'120px'"
@cancel="diaCancel"
>
<!-- <div class="div_total"> -->
<div v-for="(item,index) in tableData"
:key=index
class="div_row">
<span @click="selectCustomer(item)"
class="span_name">{{item.customerName}}</span>
<div v-for="(item, index) in tableData" :key="index" class="div_row">
<span @click="selectCustomer(item)" class="span_name">{{
item.customerName
}}</span>
</div>
<!-- </div> -->
<!-- <el-table v-loading="tableLoading"
:data="tableData"
border
style="width: 100%;">
<el-table-column prop="customerName"
label="客户名称"
header-align="left"
align="left"
width="300"></el-table-column>
<el-table-column label="操作"
fixed="right"
header-align="right"
align="right">
<template slot-scope="scope">
<el-button size="small"
@click="selectCustomer(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table> -->
</c-dialog>
</div>
</template>
<script>
import Cookies from 'js-cookie'
import CDialog from '@c/CDialog'
@ -143,11 +95,11 @@ import debounce from 'lodash/debounce'
import { messages } from '@/i18n'
import { getUUID } from '@/utils'
import { Loading } from 'element-ui' // Loading
import JSEncrypt from 'jsencrypt'//
import JSEncrypt from 'jsencrypt' //
let loading //
export default {
data () {
data() {
return {
pubKey: null, //
isShowLogin: true,
@ -173,11 +125,9 @@ export default {
CDialog
},
computed: {
dataRule () {
dataRule() {
return {
phone: [
{ required: true, message: '手机号不能为空', trigger: 'blur' }
],
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
@ -187,10 +137,10 @@ export default {
}
}
},
created () {
created() {
//
if (this.$route.query.platformToken) {
this.isShowLogin = false;
this.isShowLogin = false
this.getAutoLogin(this.$route.query.platformToken)
} else {
this.getCaptcha()
@ -198,29 +148,31 @@ export default {
this.getPubKey()
}
},
mounted () {
localStorage.removeItem('showHeader');
mounted() {
localStorage.removeItem('showHeader')
},
methods: {
//
getPubKey () {
this.$http.post('/auth/govweb/getKey').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
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(() => {
})
this.pubKey = res.data // ;
})
.catch(() => {})
},
//
getCaptcha () {
getCaptcha() {
this.dataForm.uuid = getUUID()
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
},
//
dataFormSubmitHandle () {
dataFormSubmitHandle() {
this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
@ -232,10 +184,11 @@ export default {
phone: this.dataForm.phone
}
window.app.ajax.post(
url, params,
url,
params,
(data, rspMsg) => {
if (data.length === 0) {//
if (data.length === 0) {
//
this.$message.error('账号不存在')
this.endLoading()
} else if (data.length === 1) {
@ -251,65 +204,66 @@ export default {
(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) {
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)
}
return this.$message.error(res.msg)
}
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' })
}).catch(() => {
})
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' })
})
.catch(() => {})
// epmet-ext9.elinkservice.cn/platform-admin
},
//
selectCustomer (row) {
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 }) => {
if (res.code !== 0) {
this.getCaptcha()
return this.$message.error(res.msg)
}
this.diaVisible = false
let param = {}
Object.assign(param, this.dataForm)
param.password = this.encryptedData(this.pubKey, this.dataForm.password)
this.$http
.post(url, param)
.then(({ data: res }) => {
if (res.code !== 0) {
this.getCaptcha()
return this.$message.error(res.msg)
}
this.diaVisible = false
localStorage.setItem('userType', 'work')
localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'home' }).catch(() => { })
}).catch(() => {
})
Cookies.set('token', res.data.token)
this.$router.replace({ name: 'indexWork' }).catch(() => {})
})
.catch(() => {})
this.endLoading()
},
//
diaCancel () {
diaCancel() {
this.diaVisible = false
},
//
startLoading () {
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
@ -317,64 +271,23 @@ export default {
})
},
//
endLoading () {
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
}
},
//
encryptedData (key, data) {
encryptedData(key, data) {
// JSEncrypt
let encryptor = new JSEncrypt();
let encryptor = new JSEncrypt()
//
encryptor.setPublicKey(key);
encryptor.setPublicKey(key)
//
return encryptor.encrypt(data);
return encryptor.encrypt(data)
}
}
}
</script>
<style scoped>
.div_tip {
float: left;
}
.p_tip {
color: rgb(255, 80, 80);
}
.div_total {
height: 80%;
width: 100%;
text-align: center;
}
.el-dialog__body {
width: 500px;
padding: 0px 0px 0px 20px;
}
.div_row {
height: 50px;
text-align: center;
line-height: 50px;
/* width: 100px; */
/* background-color: rgb(241, 241, 241); */
}
.div_row: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); */
}
</style>
<style lang="scss" src="@/assets/scss/pages/loginWork.scss"></style>

Loading…
Cancel
Save