Compare commits

...

2 Commits

Author SHA1 Message Date
haozq db56c7914e 数据修改 2025-06-20 18:20:41 +08:00
haozq fc60289c32 添加数据自动解密 2025-04-07 16:01:43 +08:00
31 changed files with 800 additions and 429 deletions

View File

@ -8,6 +8,15 @@ export function login(data) {
})
}
export function sgccLogin(data) {
return request({
url: '/auth/sgccLogin',
method: 'post',
data
})
}
export function getInfo(token) {
return request({
url: '/vue-element-admin/user/info',
@ -79,4 +88,4 @@ export function logWarn(params) {
method: 'post',
data: params
})
}
}

View File

@ -68,7 +68,8 @@ export default {
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/';
// this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}
}
}

View File

@ -54,11 +54,11 @@ export const constantRoutes = [
component: () => import('@/views/login/ywgllogin'),
hidden: true
},
{
path: '/isclogin',
component: () => import('@/views/isclogin/index'),
hidden: true
},
// {
// path: '/isclogin',
// component: () => import('@/views/isclogin/index'),
// hidden: true
// },
{
path: '/sso',
name: 'sso',

View File

@ -1,4 +1,4 @@
import { login, logout, getInfo } from '@/api/user'
import { login, logout, getInfo ,sgccLogin} from '@/api/user'
import {getToken, setToken, removeToken, setUs, setIscId, getIscId} from '@/utils/auth'
import router, { resetRouter } from '@/router'
import {encryptData,decryptData} from '@/utils/test';
@ -57,7 +57,33 @@ const actions = {
})
})
},
sgccLogin({ commit }, userInfo) {
const { username, password ,token} = userInfo
console.log(userInfo)
console.log(token)
return new Promise((resolve, reject) => {
sgccLogin({ username: username, password: password,token: token }).then(response => {
const data = response.data
commit('SET_TOKEN', data.access_token)
setToken(data.access_token)
setUs(data.us)// 存储用户信息到缓存
setIscId(data.iscUserId)// 存储用户信息到缓存
commit('SET_ROLES', data.us.role)
commit('SET_NAME', data.us.userName)
if(JSON.parse(data.us).nickName){
sessionStorage.setItem('nickName',encryptData(JSON.parse(data.us).nickName))
}
if(JSON.parse(data.us).roleName){
sessionStorage.setItem('roleName',encryptData(JSON.parse(data.us).roleName))
}
resolve()
}).catch(error => {
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/';
reject(error)
})
})
},
ssoLogin({ commit }, userInfo) {
const { access_token, us } = userInfo
const { sysUser } = us
@ -126,11 +152,9 @@ const actions = {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
//resetRouter()
let iscId=getIscId();
//window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:8000/zhgd-ht/#/login';
// reset visited views and cached views
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
dispatch('tagsView/delAllViews', null, { root: true })
resolve()
}).catch(error => {

View File

@ -37,7 +37,7 @@ service.interceptors.request.use(config => {
let iscUserId=getIscId();
console.log("iscUserId==="+iscUserId);
// 是否需要加密
let aqEnnable = true;
let aqEnnable = false;
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
// 是否需要防止数据重复提交
@ -156,8 +156,8 @@ service.interceptors.response.use(
type: 'warning'
}).then(() => {
let iscId=getIscId();
// window.location.href = 'http://iscssotest.ah.sgcc.com.cn/isc_sso/logout?iscUserId='+iscId+'&service=http://27.50.49.56:8000/zhgd-ht/#/login';
router.push({ path: '/login' })
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/';
// router.push({ path: '/login' })
})
return
}

View File

@ -287,8 +287,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -319,7 +321,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -300,8 +300,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -239,7 +239,7 @@ export default {
this.list = response.rows
this.total = response.total
}).finally(() => {
})
setTimeout(()=>{
this.listLoading = false
@ -253,8 +253,10 @@ export default {
async handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
async isOpenEditDialog(){
let row = this.checkRow;
@ -263,7 +265,7 @@ export default {
// this.$set(this.bidCode,res.data.bidCode)
// this.$set(this.titleTwo,this.processType === '线' ? '' : '')
// this.temp = Object.assign({}, res.data)
this.processType = res.data.proType
this.titleTwo = this.processType === '线路' ? '杆塔' : '工序计划'
this.bidCode = res.data.bidCode
@ -276,7 +278,7 @@ export default {
this.$set(this.temp,'bidCode',res.data.bidCode)
// this.dialogStatus = 'update'
// this.dialogFormVisible = true
// this.temp = Object.assign({}, res.data)
})
await this.getTowerList();
@ -287,7 +289,7 @@ export default {
this.loadWaterMark();
})
},300)
},
updateData() {
this.$refs['dataForm'].validate((valid) => {
@ -308,7 +310,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -59,9 +59,9 @@
</el-table-column>
<el-table-column key="org" label="建管单位" align="center" prop="org" />
<el-table-column key="proName" label="工程名称" prop="proName" align="center" :show-overflow-tooltip="true" />
<el-table-column key="bidCode" label="标段编码" prop="bidCode" align="center" />
<el-table-column key="proCode" label="工程编码" prop="proCode" align="center" />
<el-table-column key="signCode" label="单项编码" prop="signCode" align="center" />
<el-table-column key="bidCode" label="工程编码" prop="bidCode" align="center" />
<!-- <el-table-column key="proCode" label="工程编码" prop="proCode" align="center" />-->
<!-- <el-table-column key="signCode" label="工程编码" prop="signCode" align="center" />-->
<el-table-column key="proType" label="工程类型" align="center" prop="proType" />
<el-table-column prop="proScale" label="规模" align="center" />
<el-table-column prop="jlUnit" label="监理单位" align="center" :show-overflow-tooltip="true" />
@ -71,7 +71,7 @@
<el-table-column prop="startTime" label="实际开始时间" align="center" />
<el-table-column prop="planEndTime" label="计划结束时间" align="center" />
<el-table-column prop="endTime" label="实际结束时间" align="center" />
<el-table-column prop="proCost" label="项目总成本" align="center" />
<!-- <el-table-column prop="proCost" label="项目总成本" align="center" />-->
<!-- <el-table-column prop="bidType" label="标段类型" align="center" /> -->
<el-table-column prop="sgManage" label="施工项目经理" align="center" />
<el-table-column prop="jlManage" label="监理工程师" align="center" />
@ -642,8 +642,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -209,20 +209,20 @@ export default {
this.dialogFormVisible = false
},
loadWaterMark() {
//
const nickName = sessionStorage.getItem('nickName');
const roleName = sessionStorage.getItem('roleName');
let str1 = nickName ? decryptData(nickName) : '';
let str2 = roleName ? decryptData(roleName) : '';
let str3 = '建设部';
if (nickName || roleName) {
setWaterMark(str1, str2, str3,this.$refs.content);
}
// //
// const nickName = sessionStorage.getItem('nickName');
// const roleName = sessionStorage.getItem('roleName');
// let str1 = nickName ? decryptData(nickName) : '';
// let str2 = roleName ? decryptData(roleName) : '';
// let str3 = '';
// if (nickName || roleName) {
// setWaterMark(str1, str2, str3,this.$refs.content);
// }
},
phoneFormatter(row, column, cellValue, index){
if(row.teamLeaderPhone){
let teamLeaderPhone = decryptData(row.teamLeaderPhone).replace(/\/g, '');
const formatPhone = desensitize(teamLeaderPhone,'phone').replace(/\/g, '');
let teamLeaderPhone = decryptData(row.teamLeaderPhone).replace(/\/g, '');
const formatPhone = desensitize(teamLeaderPhone,'phone').replace(/\/g, '');
return formatPhone;
}else{
return '';
@ -261,20 +261,24 @@ export default {
const currentTeam = this.teamList.find(item => item.id === val)
this.temp.teamName = currentTeam.name
this.temp.teamLeader = currentTeam.teamLeader
this.temp.teamLeaderPhone = currentTeam.teamLeaderPhone
let teamLeaderPhone = decryptData(currentTeam.teamLeaderPhone).replace(/\/g, '');
const formatPhone = desensitize(teamLeaderPhone,'phone').replace(/\/g, '');
this.temp.teamLeaderPhone = formatPhone
},
getList() {
this.listLoading = true
getQualityList(this.listQuery).then((response) => {
console.log(response)
this.list = response.rows.map(item => {
console.log(item)
const { score } = item
item.score = Number(score)
item.score = Number(score)
if (item.score > 5) item.score = 5
return item
})
this.total = response.total
}).finally(() => {
})
setTimeout(()=>{
this.listLoading = false
@ -303,7 +307,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
}
})
@ -311,8 +315,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -352,7 +358,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -393,8 +393,11 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -428,7 +431,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -295,8 +295,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -300,8 +300,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -334,7 +336,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -295,8 +295,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -220,7 +220,7 @@ export default {
this.loadWaterMark();
}
},
methods: {
closeDialog(){
removeWatermark(this.$refs.content);
@ -267,7 +267,7 @@ export default {
this.list = response.rows
this.total = response.total
}).finally(() => {
})
setTimeout(()=>{
this.listLoading = false
@ -298,7 +298,7 @@ export default {
this.dialogFormVisible = false
this.getList()
}).finally(() => {
})
}
})
@ -306,8 +306,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -345,7 +347,7 @@ export default {
this.dialogFormVisible = false
this.getList()
}).finally(() => {
})
},
//

View File

@ -1,337 +1,288 @@
<template>
<div class="login-container">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title">智慧工地后台管理系统</h3>
</div>
<el-form-item prop="username">
<span class="svg-container">
<svg-icon icon-class="user" />
</span>
<el-input
ref="username"
v-model="loginForm.username"
placeholder="请输入用户名"
name="username"
type="text"
tabindex="1"
autocomplete="on"
/>
</el-form-item>
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
:type="passwordType"
placeholder="请输入密码"
name="password"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
</span>
</el-form-item>
</el-tooltip>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登陆</el-button>
<!-- <div style="position:relative">-->
<!-- <div class="tips">-->
<!-- <span>Username : admin</span>-->
<!-- <span>Password : any</span>-->
<!-- </div>-->
<!-- <div class="tips">-->
<!-- <span style="margin-right:18px;">Username : editor</span>-->
<!-- <span>Password : any</span>-->
<!-- </div>-->
<!-- <el-button class="thirdparty-button" type="primary" @click="showDialog=true">
Or connect with
</el-button> -->
<!-- </div>-->
</el-form>
<el-dialog title="Or connect with" :visible.sync="showDialog">
Can not be simulated on local, so please combine you own business simulation! ! !
<br>
<br>
<br>
<social-sign />
</el-dialog>
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源请耐心等待</div>
</div>
</div>
</template>
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
}
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999;
}
#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 1001;
}
#loader:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}
#loader:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #FFF;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171C6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#loader-wrapper .loader-section.section-left {
left: 0;
}
#loader-wrapper .loader-section.section-right {
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}
.no-js #loader-wrapper {
display: none;
}
.no-js h1 {
color: #222222;
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #FFF;
font-size: 19px;
width: 100%;
text-align: center;
z-index: 9999999999999;
position: absolute;
top: 60%;
opacity: 1;
line-height: 30px;
}
#loader-wrapper .load_title span {
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #FFF;
opacity: 0.5;
}
</style>
<script>
import { validUsername } from '@/utils/validate'
import SocialSign from './components/SocialSignin'
import {sm2} from 'sm-crypto';
//import { getToken } from '@/utils/auth'
export default {
name: 'Login',
components: { SocialSign },
name: "YwglLogin",
data() {
const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) {
callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码不能小于6位'))
} else {
callback()
}
}
return {
loginRules: {},
loginForm: {
username: '',
password: ''
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",
},
loginRules: {
username: [{ required: true,message:"请输入用户名", trigger: 'blur', }],
password: [{ required: true,message:"请输入密码", trigger: 'blur',}]
},
passwordType: 'password',
capsTooltip: false,
public_key:"04211520e8dc6d2051e67e6e770bd5550268c98105cd3b5b58e9c65958e78e627442343c9f237e01b3f316b1b63d7ddd70a8e6c0690a84c620b2903cb44cdfbe64",
private_key:"00f98c8d29d2177ca303106b26adfedf3f8c74cb12fc67c4b42ade0b5d1cb43b1c",
loading: false,
showDialog: false,
//
captchaOnOff: true,
//
register: false,
redirect: undefined,
otherQuery: {}
}
};
},
watch: {
$route: {
handler: function(route) {
const query = route.query
if (query) {
this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query)
}
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
immediate: true,
},
},beforeRouteEnter (to, from, next) {
console.log('从 ' + from.path + ' 进入ywgllogin');
next(); // next()promise
},
created() {
// window.addEventListener('storage', this.afterQRScan)
},
mounted() {
if (this.loginForm.username === '') {
this.$refs.username.focus()
} else if (this.loginForm.password === '') {
this.$refs.password.focus()
}
},
destroyed() {
// window.removeEventListener('storage', this.afterQRScan)
// 202441611:23:58
this.getLoginByNameAndTokenJ();
},
methods: {
checkCapslock(e) {
const { key } = e
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
},
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
handleLogin() {
debugger
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
console.log(123);
let jmU=sm2.doEncrypt(this.loginForm.username,this.public_key,0);
let jmP=sm2.doEncrypt(this.loginForm.password,this.public_key,0);
let copydata={
username: "04"+jmU,
password: "04"+jmP
/**
* 只传递token
*/
getLoginByNameAndTokenJ() {
console.log(window.location.href);
let url=window.location.href.split("?");
let tokens='';
if(url.length>1){
let params=url[1].split("#");
if(params.length>0){
params=params[0].split("=");
if(params.length>1){
tokens=params[1]
}
console.log(copydata);
this.$store.dispatch('user/login', copydata)
.then(() => {
this.otherQuery.formLogin=true;
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.loading = false
})
.catch(() => {
}
}
if(!tokens){
tokens = this.$route.query.token;
}
console.log(tokens)
//
if (tokens) {
//
this.loading = true;
let loginForm = {
token: tokens,
loginType: 333
};
console.log(loginForm);
console.log("开始登录..")
//
this.$store.dispatch('user/sgccLogin', loginForm).then(() => {
console.log("登录成功了..")
this.$router.replace({path: "/#/home" || "/"}).catch(() => {
});
this.loading = false
})
.catch(() => {
this.loading = false
})
this.loading = false
})
} else {
console.log('error submit!!')
return false
}
})
// this.$message.error("token");
} else {
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/';
// console.log("tick..")
}
},
getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') {
acc[cur] = query[cur]
}
return acc
}, {})
}
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('')
// }
// }
// }
}
}
},
};
</script>
<style lang="scss">
/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg:#283443;
$light_gray:#fff;
$cursor: #fff;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input {
color: $cursor;
}
}
/* reset element-ui css */
.login-container {
.el-input {
display: inline-block;
height: 47px;
width: 85%;
input {
background: transparent;
border: 0px;
-webkit-appearance: none;
border-radius: 0px;
padding: 12px 5px 12px 15px;
color: $light_gray;
height: 47px;
caret-color: $cursor;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: $cursor !important;
}
}
}
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.1);
border-radius: 5px;
color: #454545;
}
}
</style>
<style lang="scss" scoped>
$bg:#2d3a4b;
$dark_gray:#889aa4;
$light_gray:#eee;
.login-container {
min-height: 100%;
width: 100%;
background-color: $bg;
overflow: hidden;
.login-form {
position: relative;
width: 520px;
max-width: 100%;
padding: 160px 35px 0;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.title-container {
position: relative;
.title {
font-size: 26px;
color: $light_gray;
margin: 0px auto 40px auto;
text-align: center;
font-weight: bold;
}
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
@media only screen and (max-width: 470px) {
.thirdparty-button {
display: none;
}
}
}
<style rel="stylesheet/scss" lang="scss">
</style>

View File

@ -0,0 +1,337 @@
<template>
<div class="login-container">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
<div class="title-container">
<h3 class="title">智慧工地后台管理系统</h3>
</div>
<el-form-item prop="username">
<span class="svg-container">
<svg-icon icon-class="user" />
</span>
<el-input
ref="username"
v-model="loginForm.username"
placeholder="请输入用户名"
name="username"
type="text"
tabindex="1"
autocomplete="on"
/>
</el-form-item>
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
:type="passwordType"
placeholder="请输入密码"
name="password"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"
@keyup.enter.native="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
</span>
</el-form-item>
</el-tooltip>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登陆</el-button>
<!-- <div style="position:relative">-->
<!-- <div class="tips">-->
<!-- <span>Username : admin</span>-->
<!-- <span>Password : any</span>-->
<!-- </div>-->
<!-- <div class="tips">-->
<!-- <span style="margin-right:18px;">Username : editor</span>-->
<!-- <span>Password : any</span>-->
<!-- </div>-->
<!-- <el-button class="thirdparty-button" type="primary" @click="showDialog=true">
Or connect with
</el-button> -->
<!-- </div>-->
</el-form>
<el-dialog title="Or connect with" :visible.sync="showDialog">
Can not be simulated on local, so please combine you own business simulation! ! !
<br>
<br>
<br>
<social-sign />
</el-dialog>
</div>
</template>
<script>
import { validUsername } from '@/utils/validate'
import SocialSign from './components/SocialSignin'
import {sm2} from 'sm-crypto';
export default {
name: 'Login',
components: { SocialSign },
data() {
const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) {
callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码不能小于6位'))
} else {
callback()
}
}
return {
loginForm: {
username: '',
password: ''
},
loginRules: {
username: [{ required: true,message:"请输入用户名", trigger: 'blur', }],
password: [{ required: true,message:"请输入密码", trigger: 'blur',}]
},
passwordType: 'password',
capsTooltip: false,
public_key:"04211520e8dc6d2051e67e6e770bd5550268c98105cd3b5b58e9c65958e78e627442343c9f237e01b3f316b1b63d7ddd70a8e6c0690a84c620b2903cb44cdfbe64",
private_key:"00f98c8d29d2177ca303106b26adfedf3f8c74cb12fc67c4b42ade0b5d1cb43b1c",
loading: false,
showDialog: false,
redirect: undefined,
otherQuery: {}
}
},
watch: {
$route: {
handler: function(route) {
const query = route.query
if (query) {
this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query)
}
},
immediate: true
}
},
created() {
// window.addEventListener('storage', this.afterQRScan)
},
mounted() {
if (this.loginForm.username === '') {
this.$refs.username.focus()
} else if (this.loginForm.password === '') {
this.$refs.password.focus()
}
},
destroyed() {
// window.removeEventListener('storage', this.afterQRScan)
},
methods: {
checkCapslock(e) {
const { key } = e
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z')
},
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
handleLogin() {
debugger
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
console.log(123);
let jmU=sm2.doEncrypt(this.loginForm.username,this.public_key,0);
let jmP=sm2.doEncrypt(this.loginForm.password,this.public_key,0);
let copydata={
username: "04"+jmU,
password: "04"+jmP
}
console.log(copydata);
this.$store.dispatch('user/login', copydata)
.then(() => {
this.otherQuery.formLogin=true;
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.loading = false
})
.catch(() => {
this.loading = false
})
} else {
console.log('error submit!!')
return false
}
})
},
getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') {
acc[cur] = query[cur]
}
return acc
}, {})
}
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('第三方登录失败')
// }
// }
// }
}
}
</script>
<style lang="scss">
/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg:#283443;
$light_gray:#fff;
$cursor: #fff;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input {
color: $cursor;
}
}
/* reset element-ui css */
.login-container {
.el-input {
display: inline-block;
height: 47px;
width: 85%;
input {
background: transparent;
border: 0px;
-webkit-appearance: none;
border-radius: 0px;
padding: 12px 5px 12px 15px;
color: $light_gray;
height: 47px;
caret-color: $cursor;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: $cursor !important;
}
}
}
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.1);
border-radius: 5px;
color: #454545;
}
}
</style>
<style lang="scss" scoped>
$bg:#2d3a4b;
$dark_gray:#889aa4;
$light_gray:#eee;
.login-container {
min-height: 100%;
width: 100%;
background-color: $bg;
overflow: hidden;
.login-form {
position: relative;
width: 520px;
max-width: 100%;
padding: 160px 35px 0;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 6px 5px 6px 15px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
}
.title-container {
position: relative;
.title {
font-size: 26px;
color: $light_gray;
margin: 0px auto 40px auto;
text-align: center;
font-weight: bold;
}
}
.show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
@media only screen and (max-width: 470px) {
.thirdparty-button {
display: none;
}
}
}
</style>

View File

@ -238,32 +238,32 @@ export default {
getLoginByNameAndTokenJ() {
console.log(window.location.href);
let url=window.location.href.split("?");
let tickets='';
let tokens='';
if(url.length>1){
let params=url[1].split("#");
if(params.length>0){
params=params[0].split("=");
if(params.length>1){
tickets=params[1]
tokens=params[1]
}
}
}
if(!tickets){
tickets = this.$route.query.ticket;
if(!tokens){
tokens = this.$route.query.token;
}
console.log(tickets)
console.log(tokens)
//
if (tickets) {
if (tokens) {
//
this.loading = true;
let loginForm = {
ticket:tickets,
token:tokens,
loginType: 333
};
console.log(loginForm);
console.log("开始登录..")
//
this.$store.dispatch('user/login', loginForm).then(() => {
this.$store.dispatch('user/sgccLogin', loginForm).then(() => {
console.log("登录成功了..")
this.$router.replace({ path:"/#/home" || "/" }).catch(()=>{});
this.loading = false
@ -275,6 +275,7 @@ export default {
// this.$message.error("token");
} else {
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/';
// console.log("tick..")
}
},

View File

@ -296,8 +296,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -347,7 +349,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -472,9 +472,10 @@ export default {
},
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.checkRow = _.cloneDeep(row);
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -544,7 +545,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//
@ -600,7 +601,7 @@ export default {
}
},
beforeAvatarUpload(file){
},
handleRemoveImageItem(file) {
if (!file?.hasOwnProperty('raw')) {
@ -640,7 +641,7 @@ export default {
this.getList()
this.bindVisible = false
}).finally(() => {
})
}
})
@ -659,7 +660,7 @@ export default {
this.getList()
this.bindVisible = false
}).finally(() => {
})
}
})

View File

@ -263,7 +263,7 @@ export default {
})
this.total = response.total
}).finally(() => {
})
setTimeout(()=>{
this.listLoading = false
@ -300,7 +300,7 @@ export default {
this.getList()
}
}).finally(() => {
})
}
})
@ -308,8 +308,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -347,7 +349,7 @@ export default {
if(this.temp.teamLeaderPhone.indexOf('*') > -1){
obj.teamLeaderPhone = this.temp.newTeamLeaderPhone;
}
updateTeamItem(obj).then((response) => {
if(response.code==200){
this.$message({
@ -358,10 +360,10 @@ export default {
})
this.checkRow = {};
this.dialogFormVisible = false
this.getList()
this.getList()
}
}).finally(() => {
})
},
//

View File

@ -100,7 +100,7 @@
<component :is="componentDialog.modulName" />
</modul-dialog>
</div>
</template>
<script>
@ -244,8 +244,10 @@ export default {
},
//
handleEdit(val) {
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
// this.checkRow = _.cloneDeep(row);
this.planEditMode = true
//this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
//
getList() {

View File

@ -263,8 +263,10 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -311,7 +313,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -172,8 +172,8 @@ export default {
phoneFormatter(row, column, cellValue, index){
if(row.emergencySource){ console.log(1111)
// console.log(row.emergencySource)
let en= decryptData(row.emergencySource);
let phone =en.replace(/\/g, '');
// let en= decryptData(row.emergencySource);
let phone =row.emergencySource.replace(/\/g, '');
const formatPhone = desensitize(phone,'phone');
// return row.emergencySource;
return formatPhone;
@ -245,8 +245,9 @@ export default {
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -263,9 +263,11 @@ export default {
},
//
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.checkRow = _.cloneDeep(row);
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
@ -312,7 +314,7 @@ export default {
this.getList()
this.dialogFormVisible = false
}).finally(() => {
})
},
//

View File

@ -238,7 +238,9 @@ export default {
},
handleUpdate(row) { //
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -345,8 +345,10 @@ export default {
},
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -224,7 +224,9 @@ export default {
},
handleUpdate(row) { //
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -310,7 +310,9 @@ export default {
},
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;

View File

@ -100,14 +100,14 @@
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog"> 关闭 </el-button>
<el-button type="primary" @click="dialogStatus === 'create' ? createData() : updateData()">
提交
</el-button>
</div>
</el-dialog>
<el-dialog title="重置密码" :visible.sync="dialogFormVisible2" width="600px">
@ -440,10 +440,12 @@ export default {
},
handleUpdate(row) {
this.checkRow = _.cloneDeep(row);
this.openModulDialog('验证密码', 'pwdVerifiers', '600px', true)
this.isOpenEditDialog();
// this.openModulDialog('', 'pwdVerifiers', '600px', true)
},
isOpenEditDialog(){
let row = this.checkRow;
getUserById({ userId: row.userId }).then((response) => {
this.temp = Object.assign({}, response.data)

View File

@ -24,7 +24,7 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'production' ? '/zhgd-ht/' : '/',
publicPath: process.env.ENV === 'production' ? '/zhgd-ht/' : '/zhgd-ht/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: false,
@ -36,8 +36,9 @@ module.exports = {
proxy: {
[process.env.VUE_APP_BASE_API]: {
// target: `http://36.33.26.201:19090/zhgd`,
// target: `http://27.50.49.56:8000/zhgd`,
target: `http://11.158.16.194:21624/zhgd`,
// target: `http://27.50.49.56:8000/zhgd`,
target: `http://192.168.0.38:13030/zhgd`,
// target: `http://11.158.16.194:21624/zhgd`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''