3 changed files with 253 additions and 4 deletions
-
1src/router/index.js
-
242src/views/common/login-token.vue
-
14src/views/modules/changeManagement/changeRecord.vue
@ -0,0 +1,242 @@ |
|||||
|
<template> |
||||
|
<div style="width: 100vw;height: 100vh" v-loading="true" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { getUUID } from '@/utils' |
||||
|
import {getConfigParams} from '@/api/sysConfig.js' |
||||
|
import { |
||||
|
getSiteData, |
||||
|
} from "@/api/base/site.js" |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
src: 'http://192.168.1.83/upload/ifs.png', |
||||
|
dataForm: { |
||||
|
userName: '', |
||||
|
password: '', |
||||
|
uuid: '', |
||||
|
captcha: '', |
||||
|
site:'' |
||||
|
}, |
||||
|
siteList: [], |
||||
|
dataRule: { |
||||
|
userName: [ |
||||
|
{ required: true, message: '帐号不能为空', trigger: 'blur' } |
||||
|
], |
||||
|
password: [ |
||||
|
{ required: true, message: '密码不能为空', trigger: 'blur' } |
||||
|
] |
||||
|
}, |
||||
|
captchaPath: '', |
||||
|
urlParam: {} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
multiLanguage: { |
||||
|
get() { |
||||
|
return this.$store.state.user.multiLanguage |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$store.commit('user/updateMultiLanguage', val) |
||||
|
} |
||||
|
}, |
||||
|
authControl: { |
||||
|
get() { |
||||
|
return this.$store.state.user.authControl |
||||
|
}, |
||||
|
set(val) { |
||||
|
this.$store.commit('user/updateAuthControl', val) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
this.userName() |
||||
|
this.getSiteData() |
||||
|
this.getUrlParams() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 解析url参数 |
||||
|
getUrlParams() { |
||||
|
let url = window.location.href |
||||
|
// 通过 ? 分割获取后面的参数字符串 |
||||
|
let urlStr = url.split('?')[1] |
||||
|
// 创建空对象存储参数 |
||||
|
let obj = {}; |
||||
|
// 再通过 & 将每一个参数单独分割出来 |
||||
|
let paramsArr = urlStr.split('&') |
||||
|
for(let i = 0,len = paramsArr.length;i < len;i++){ |
||||
|
// 再通过 = 将每一个参数分割为 key:value 的形式 |
||||
|
let arr = paramsArr[i].split('=') |
||||
|
obj[arr[0]] = arr[1]; |
||||
|
} |
||||
|
console.log(obj) |
||||
|
this.urlParam = obj |
||||
|
this.dataFormSubmit() |
||||
|
}, |
||||
|
|
||||
|
getSiteData () { |
||||
|
let data = {} |
||||
|
getSiteData(data).then(({data}) => { |
||||
|
this.siteList = data.rows |
||||
|
if (this.siteList.length > 0) { |
||||
|
this.dataForm.site = this.siteList[0].siteID |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 获取上次登陆的用户名 |
||||
|
userName () { |
||||
|
this.dataForm.userName = localStorage.getItem('userName') |
||||
|
}, |
||||
|
|
||||
|
// 提交表单 |
||||
|
dataFormSubmit () { |
||||
|
this.$http({ |
||||
|
url: this.$http.adornUrl('/sys/loginToken'), |
||||
|
method: 'post', |
||||
|
data: this.$http.adornData({ |
||||
|
'domainControlAccount': this.urlParam.dca, |
||||
|
'token': this.urlParam.token, |
||||
|
'site': this.urlParam.site |
||||
|
}) |
||||
|
}).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$cookie.set('token', data.token) |
||||
|
this.$router.replace({ |
||||
|
name: this.urlParam.path, |
||||
|
params: { |
||||
|
site: this.urlParam.site, |
||||
|
docNo: this.urlParam.docNo, |
||||
|
type: "tokenLogin" |
||||
|
} |
||||
|
}) |
||||
|
this.$i18n.locale = data.language |
||||
|
localStorage.setItem('locale', data.language) |
||||
|
localStorage.setItem('refresh', "0") |
||||
|
localStorage.setItem('userName', data.userName) |
||||
|
localStorage.setItem('accessSite', this.urlParam.site) |
||||
|
this.getConfigParams() |
||||
|
} else { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取全局参数变量 |
||||
|
getConfigParams() { |
||||
|
getConfigParams().then(({data}) => { |
||||
|
if (data && data.code == 0) { |
||||
|
localStorage.setItem('configParams', JSON.stringify(data.data)) |
||||
|
// this.multiLanguage = JSON.parse(localStorage.getItem('configParams')).multiLanguage |
||||
|
// this.authControl = JSON.parse(localStorage.getItem('configParams')).authControl |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.site-wrapper.site-page--login { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
background-color: rgba(38, 50, 56, 0); |
||||
|
overflow: hidden; |
||||
|
&:before { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
z-index: -1; |
||||
|
width: 80%; |
||||
|
height: 100%; |
||||
|
content: ""; |
||||
|
background-image: url(~@/assets/img/login_bg.jpg); |
||||
|
background-size: cover; |
||||
|
} |
||||
|
.site-content__wrapper { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
padding: 0; |
||||
|
margin: 0; |
||||
|
overflow-x: hidden; |
||||
|
overflow-y: auto; |
||||
|
background-color: transparent; |
||||
|
} |
||||
|
.site-content { |
||||
|
min-height: 100%; |
||||
|
padding: 15% 500px 30px 30px; |
||||
|
} |
||||
|
.brand-info { |
||||
|
margin: 220px 100px 0 90px; |
||||
|
color: #fff; |
||||
|
} |
||||
|
.brand-info__text { |
||||
|
margin: 0 0 22px 0; |
||||
|
font-size: 48px; |
||||
|
font-weight: 400; |
||||
|
text-transform : uppercase; |
||||
|
} |
||||
|
.brand-info__intro { |
||||
|
margin: 10px 0; |
||||
|
font-size: 16px; |
||||
|
line-height: 1.58; |
||||
|
opacity: .6; |
||||
|
} |
||||
|
.login-main { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
padding: 15% 60px 180px; |
||||
|
width: 350px; |
||||
|
min-height: 100%; |
||||
|
background-color: transparent; |
||||
|
} |
||||
|
.login-main-2 { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
padding: 15% 60px 180px; |
||||
|
width: 350px; |
||||
|
min-height: 100%; |
||||
|
background-color: transparent; |
||||
|
} |
||||
|
.login-title { |
||||
|
font-size: 30px; |
||||
|
} |
||||
|
.login-captcha { |
||||
|
overflow: hidden; |
||||
|
> img { |
||||
|
width: 100%; |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
} |
||||
|
.login-btn-submit { |
||||
|
width: 100%; |
||||
|
|
||||
|
} |
||||
|
.login-main .el-input__inner{ |
||||
|
margin-top: 10px; |
||||
|
height: 45px; |
||||
|
} |
||||
|
.el-button--medium { |
||||
|
margin-top: 0px; |
||||
|
padding: 5px 11px; |
||||
|
font-size: 16px; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.el-form-item { |
||||
|
margin-bottom: 5px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue