Browse Source

2024-05-17 更新

master
fengyuan_yang 2 years ago
parent
commit
d14f9c3c7d
  1. 1
      src/router/index.js
  2. 242
      src/views/common/login-token.vue
  3. 14
      src/views/modules/changeManagement/changeRecord.vue

1
src/router/index.js

@ -20,6 +20,7 @@ const _import = require('./import-' + process.env.NODE_ENV)
const globalRoutes = [
{ path: '/404', component: _import('common/404'), name: '404', meta: { title: '404未找到' } },
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } },
{ path: '/login-token', component: _import('common/login-token'), name: 'login', meta: { title: '登录' } },
{ path: '/BMPage', component: _import('modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail'), name: 'BM', meta: { title: '技术参数卡' } },
]

242
src/views/common/login-token.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>

14
src/views/modules/changeManagement/changeRecord.vue

@ -1714,8 +1714,14 @@
},
activated () {
if (this.$route.params.changeNo) {
this.searchData.changeNo = this.$route.params.changeNo
if (this.$route.params.type === 'tokenLogin') {
if (this.$route.params.docNo) {
this.searchData.changeNo = this.$route.params.docNo
}
} else {
if (this.$route.params.changeNo) {
this.searchData.changeNo = this.$route.params.changeNo
}
}
this.getDataList()
},
@ -2159,7 +2165,7 @@
changeNo: row.changeNo,
menuId: this.$route.meta.menuId
}
issueChange2(tempData).then(({data}) => {
issueChange(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({message: '操作成功', type: 'success'})
@ -2195,7 +2201,7 @@
menuId: this.$route.meta.menuId,
nodeConclusion: this.modalData.nodeConclusion
}
submitChange2(tempData).then(({data}) => {
submitChange(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({message: '操作成功', type: 'success'})

Loading…
Cancel
Save