权限和正式环境页面更改

yfy
严飞永 1 month ago
parent d2a44e5fb3
commit 6a43cde58a

@ -13,4 +13,4 @@ ENV = 'production'
# VUE_APP_BASE_API = 'http://39.101.188.84:7071'
# 正式环境
VUE_APP_BASE_API = 'https://gysl.sipac.gov.cn/api'
VUE_APP_BASE_API = '/api'

@ -2,7 +2,7 @@
<div>
<!-- 政务端消息通知数量 -->
<!-- 大于0的时候显示的图标 -->
<el-badge :is-dot="countstwo > 0" class="item" v-if="checkRole(['common'])">
<el-badge :is-dot="countstwo > 0" class="item" v-if="checkRole(['common','gov'])">
<img src="@/assets/images/icon-tz@2x.png" alt="">
</el-badge>
<!-- 企业端消息通知数量 -->
@ -26,7 +26,7 @@ export default {
computed: {
showCompanySection() {
const isCompany = this.checkRole(['company']);
const isCommon = this.checkRole(['common']);
const isCommon = this.checkRole(['common','gov']);
//
return isCompany && !isCommon;
}
@ -52,8 +52,8 @@ export default {
const response = await getMessageCounttwo();
if (response && response.code === 200) {
this.countstwo = response.data; // counts
} else { }
} catch (error) { }
} else { }
} catch (error) {}
},
}
}

@ -10,7 +10,7 @@
<!-- <bearicon /> -->
<div class="avatar-container right-menu-item hover-effect" style="display: flex;">
<div class="avatar-wrapper">
<div v-if="checkRole(['common'])">
<div v-if="checkRole(['common','gov'])">
<span>{{ name }}</span>
</div>
<div v-if="showCompanySection">
@ -69,7 +69,7 @@ export default {
//
showCompanySection() {
const isCompany = this.checkRole(['company'])
const isCommon = this.checkRole(['common'])
const isCommon = this.checkRole(['common','gov'])
return isCompany && !isCommon
},
topNav: {

@ -1,121 +1,155 @@
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken, setToken } from '@/utils/auth'
import { isPathMatch } from '@/utils/validate'
import { isRelogin } from '@/utils/request'
import { extractPrefix } from '@/utils/common'
import router from "./router";
import store from "./store";
import { Message } from "element-ui";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken, setToken } from "@/utils/auth";
import { isPathMatch } from "@/utils/validate";
import { isRelogin } from "@/utils/request";
import { extractPrefix } from "@/utils/common";
// 政务登录接口
import { governmentGetInfo } from '@/api/login/index'
import { governmentGetInfo } from "@/api/login/index";
NProgress.configure({ showSpinner: false })
NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/register']
const whiteList = ["/login", "/register"];
const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
}
return whiteList.some((pattern) => isPathMatch(pattern, path));
};
router.beforeEach((to, from, next) => {
if (!extractPrefix(to.path)) {
store.commit("SET_CRUMBS", false);
if(!extractPrefix(to.path)){
store.commit("SET_CRUMBS",false);
}
NProgress.start();
// 提取所有 URL 参数(包括 hash 后面的部分)
const search =
window.location.search || window.location.hash.split("?")[1] || "";
const params = new URLSearchParams(search);
const userToken = params.get("userToken");
const signature = params.get("signature");
const timespan = params.get("timespan");
console.log(userToken, signature, timespan, "参数");
// 如果已经处理过一次登录逻辑,不再重复执行
if (from.path === to.path && store.getters.token) {
next();
return;
}
NProgress.start()
const { userToken, signature, timespan } = to.query
console.log(userToken, signature, timespan, '参数')
if (userToken && signature && timespan) {
// 政务登录
governmentGetInfo({
userToken,
signature,
timespan
}).then(res => {
const token = res.token
if (token) {
setToken(token)
localStorage.setItem('otherToken', userToken)
const newQuery = { ...to.query }
delete newQuery.userToken
delete newQuery.signature
delete newQuery.timespan
const newPath = to.path + '?' + new URLSearchParams(newQuery).toString()
window.history.replaceState({}, '', newPath)
// 如果存在政务参数,并且不在登录页,则强制跳转过去
if (userToken && signature && timespan && to.path !== "/login") {
next({
path: "/login",
query: { userToken, signature, timespan },
replace: true,
});
return;
}
if (store.getters.roles.length === 0) {
isRelogin.show = true
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
router.addRoutes(accessRoutes)
next({ ...to, replace: true })
if (to.path === "/login" && userToken && signature && timespan) {
governmentGetInfo({ userToken, signature, timespan })
.then((res) => {
const token = res.data.token;
if (!token) {
// 清除 URL 参数,避免循环
const cleanPath =
window.location.pathname + window.location.hash.split("?")[0];
window.history.replaceState({}, "", cleanPath);
throw new Error("未获取到有效 token");
}
setToken(token);
localStorage.setItem("otherToken", userToken);
// 清除 URL 参数
const cleanPath =
window.location.pathname + (window.location.hash || "");
window.history.replaceState({}, "", cleanPath);
// 如果已有角色信息,直接跳转
if (store.getters.roles.length > 0) {
next("/"); // 或者 next(to.query.redirect || "/")
return;
}
// 否则获取用户信息并加载路由
isRelogin.show = true;
store
.dispatch("GetInfo")
.then(() => {
isRelogin.show = false;
return store.dispatch("GenerateRoutes");
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
.then((accessRoutes) => {
router.addRoutes(accessRoutes);
next(to.query.redirect || "/"); // 跳转到目标页或首页
})
})
} else {
next()
}
}
}).catch(err => {
console.error('政务系统登录失败:', err)
Message.error('政务系统登录失败,请重新登录')
})
return
}
.catch((err) => {
console.error("获取用户信息失败:", err);
return store.dispatch("LogOut").then(() => {
Message.error(err.message || "获取用户信息失败");
next("/login");
});
});
})
.catch((err) => {
console.error("政务系统登录失败:", err);
// 清除 URL 参数,避免循环
const cleanPath =
window.location.pathname + (window.location.hash || "");
window.history.replaceState({}, "", cleanPath);
Message.error(err.message || "政务系统登录失败");
next("/login");
});
return;
}
//原来的登录逻辑
const token = getToken()
// 原始本地登录逻辑
const token = getToken();
if (token) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
if (to.path === '/login') {
next({ path: '/' })
NProgress.done()
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
if (to.path === "/login") {
next({ path: "/" });
NProgress.done();
} else if (isWhiteList(to.path)) {
next()
next();
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
router.addRoutes(accessRoutes)
next({ ...to, replace: true })
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
isRelogin.show = true;
store
.dispatch("GetInfo")
.then(() => {
isRelogin.show = false;
store.dispatch("GenerateRoutes").then((accessRoutes) => {
router.addRoutes(accessRoutes);
next({ ...to, replace: true });
});
})
})
.catch((err) => {
store.dispatch("LogOut").then(() => {
Message.error(err);
next("/");
});
});
} else {
next()
next();
}
}
} else {
if (isWhiteList(to.path)) {
next()
next();
} else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
NProgress.done()
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`);
}
}
})
});
router.afterEach(() => {
NProgress.done()
})
NProgress.done();
});

@ -17,7 +17,7 @@ import Layout from "@/layout";
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
* query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
* roles: ['admin', 'common'] // 访问路由的角色权限
* roles: ['admin', 'common','gov'] // 访问路由的角色权限
* permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
* meta : {
noCache: true // 如果设置为true则不会被 <keep-alive> 缓存(默认 false)
@ -44,9 +44,14 @@ export const constantRoutes = [
{
path: "/login",
// 正式环境登录页
// component: () => import("@/views/login"),
component: () => import("@/views/login"),
// 测试
component: () => import("@/views/login_v1"),
// component: () => import("@/views/login_v1"),
hidden: true,
},
{
path: "/login_v2",
component: () => import("@/views/login_v2"),
hidden: true,
},
{

@ -13,7 +13,7 @@
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
编辑
</el-button>
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="编辑"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
@ -181,8 +181,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划投资额" prop="jhtze">
<el-input v-model="form.jhtze" maxlength="50" placeholder="请输入计划投资额"></el-input>
<el-form-item label="计划投资额(亿元)" prop="jhtze">
<el-input v-model="form.jhtze" maxlength="50" placeholder="请输入计划投资额(亿元)"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -447,7 +447,7 @@ export default {
{ label: '竣工验收时间', value: data.acceptanceTime },
{ label: '建设进度', value: data.jsjd },
{ label: '统一社会信用代码', value: data.tyshxydm },
{ label: '计划投资额', value: data.jhtze },
{ label: '计划投资额(亿元)', value: data.jhtze },
{ label: '所属产业目录', value: this.mlMap[data.ml] || '' },
{ label: '所属细分产业', value: this.xfMap[data.xfcy] || '' },
{ label: '项目法人单位简介', value: data.unitIntroduction },

@ -25,7 +25,7 @@
<i class="el-icon-download" style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"></i>
导入
</el-button>
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">

@ -13,7 +13,7 @@
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
新增
</el-button>
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
@ -80,10 +80,10 @@
<!-- 累计建成面积 -->
<div class="table-cell">
<template v-if="item.isEditing">
<el-input v-model="item.cumulativeArea" style="width: 100%;" />
<el-input v-model="item.jzmqjc" style="width: 100%;" />
</template>
<template v-else>
{{ item.cumulativeArea }}
{{ item.jzmqjc }}
</template>
</div>
@ -137,8 +137,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="截止目前累计建成面积(平方米)" prop="cumulativeArea">
<el-input v-model="form.cumulativeArea" placeholder="请输入面积"></el-input>
<el-form-item label="截止目前累计建成面积(平方米)" prop="jzmqjc">
<el-input v-model="form.jzmqjc" placeholder="请输入面积"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
@ -192,7 +192,7 @@ export default {
status: "已更新", //
monthDoneAmount: "", //
totalDoneAmount: "", //
cumulativeArea: "", //
jzmqjc: "", //
xmjzxq: "" //
},
rules: {
@ -250,7 +250,7 @@ export default {
status: "已更新",
monthDoneAmount: "",
totalDoneAmount: "",
cumulativeArea: "",
jzmqjc: "",
xmjzxq: ""
};
this.dialogVisible = true;
@ -309,7 +309,7 @@ export default {
status: '已更新',
monthDoneAmount: item.monthDoneAmount ?? 0,
totalDoneAmount: item.totalDoneAmount ?? 0,
cumulativeArea: item.cumulativeArea ?? '',
jzmqjc: item.jzmqjc ?? '',
xmjzxq: item.xmjzxq ?? ''
}));
} else {
@ -337,7 +337,7 @@ export default {
month: row.month,
monthDoneAmount: row.monthDoneAmount,
totalDoneAmount: row.totalDoneAmount,
cumulativeArea: row.cumulativeArea,
jzmqjc: row.jzmqjc,
xmjzxq: row.xmjzxq
};

@ -7,7 +7,7 @@
<span>其他信息</span>
</div>
<div class="topright" v-if="action === 'fill' || !action || action === 'okay'">
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="openDialog('add')">
<img src="../../../assets/images/detailsicon/icon-bj@2x.png" alt="新增"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
@ -20,7 +20,7 @@
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
{{ isEditMode ? '保存' : '编辑' }}
</el-button>
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
@ -41,7 +41,7 @@
<template v-else>
{{ item.zdinfor }}
</template>
<el-button v-if="checkRole(['admin', 'common']) && isEditMode" type="text" size="small" @click="handleDeleteField(item)"
<el-button v-if="checkRole(['admin', 'common','gov']) && isEditMode" type="text" size="small" @click="handleDeleteField(item)"
style="margin-left: 1rem;color: #F25353;">删除</el-button>
</el-descriptions-item>
</el-descriptions>

@ -19,7 +19,7 @@
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
保存
</el-button>
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common','gov'])"
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">

@ -6,7 +6,7 @@
<img style="width: 1.2rem;height: 1.13rem;" src="@/assets/images/标签管理.png" alt="">
<span style="margin-top: -0.1rem;">标签管理</span>
</div>
<div class="headright" @click="showAddTagModal" v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common'])">
<div class="headright" @click="showAddTagModal" v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common','gov'])">
添加标签
</div>
</div>
@ -18,7 +18,7 @@
<i :class="isGroupOpen(group.type) ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
<dict-tag :options="dict.type.bqlx" :value="group.type" />
</div>
<div v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common'])">
<div v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common','gov'])">
<el-button size="mini" type="text" icon="el-icon-delete" style="color: #F25353;"
@click.stop="handleDeleteType(group.type)" :disabled="isSaving">删除</el-button>
</div>
@ -35,7 +35,7 @@
<el-table-column label="操作" width="155">
<template slot-scope="scope">
<div
v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common'])">
v-if="(action === 'fill' || !action || action === 'okay') && checkRole(['admin', 'common','gov'])">
<el-button size="mini" @click="startEdit(scope.row)" v-if="!scope.row.editing"
:disabled="isSaving">编辑</el-button>
<el-button size="mini" type="success" @click="saveEdit(scope.row)" v-else

@ -68,7 +68,7 @@
<div class="itemone">
<img src="@/assets/images/icon-yjsl@2x.png" alt="">
<div class="itemleft">
<div class="lefttitle">计划投资额</div>
<div class="lefttitle">计划投资额(亿元)</div>
<div class="number">{{ projectData.allInvest2 }}</div>
</div>
</div>
@ -158,7 +158,7 @@
<div class="itemone">
<img src="@/assets/images/icon-yjsl@2x.png" alt="">
<div class="itemleft">
<div class="lefttitle">计划投资额</div>
<div class="lefttitle">计划投资额(亿元)</div>
<div class="number">{{ currentYearData.currentAllInvest2 }}</div>
</div>
</div>

@ -68,7 +68,7 @@
<div class="itemone">
<img src="@/assets/images/icon-yjsl@2x.png" alt="">
<div class="itemleft">
<div class="lefttitle">计划投资额</div>
<div class="lefttitle">计划投资额(亿元)</div>
<div class="number">{{ projectData.allInvest2 }}</div>
</div>
</div>
@ -158,7 +158,7 @@
<div class="itemone">
<img src="@/assets/images/icon-yjsl@2x.png" alt="">
<div class="itemleft">
<div class="lefttitle">计划投资额</div>
<div class="lefttitle">计划投资额(亿元)</div>
<div class="number">{{ currentYearData.currentAllInvest2 }}</div>
</div>
</div>

@ -14,7 +14,7 @@ export default {
return {};
},
created(){
if(this.$auth.hasRoleOr(["admin", "common"])){//admin,
if(this.$auth.hasRoleOr(["admin", "common","gov"])){//admin,,
this.$router.push({path:"/statistics"})
}else{
//

@ -0,0 +1,356 @@
<template>
<div class="login">
<div class="loginleft">
</div>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<img src="@/assets/images/logo@2x.png" alt="">
<div class="title">苏州工业园区工业上楼管理系统</div>
<div class="logintabs">
<el-tabs v-model="activeName" :stretch="true" color="#216CDC">
<el-tab-pane label="企业用户登录" name="first"></el-tab-pane>
<el-tab-pane label="政务人员登录" name="second"></el-tab-pane>
</el-tabs>
</div>
<el-form-item prop="username" class="loginitem" style="margin-top: 1rem;">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password" class="loginitem">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled" class="loginitem">
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img" style="width: 8.56rem;" />
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:1rem 18.6rem 25px 0px;"></el-checkbox>
<el-form-item style="width:24rem;;margin-top: 1rem;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;background: #2B62F1;"
@click.native.prevent="handleLogin">
<span v-if="!loading"> </span>
<span v-else> ...</span>
</el-button>
<el-button v-if="showGovernmentLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleGovernmentLogin">
<span>政务统一身份认证登录</span>
</el-button>
<el-button v-if="showEnterpriseLoginButton" size="medium" type="primary" class="tongyidenglu"
style="width:100%;background: #2B62F1;" @click.native.prevent="handleEnterpriseLogin">
<span>企业统一身份认证登录</span>
</el-button>
</el-form-item>
<div style="font-size: 0.88rem;color: #333;">主办单位苏州工业园区经济发展委员会</div>
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span></span>
</div>
</div>
</template>
<script>
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
import forge from 'node-forge'
export default {
name: 'Login',
data() {
return {
codeUrl: '',
activeName: 'second',
loginForm: {
username: '',
password: '',
rememberMe: false,
code: '',
uuid: '',
loginRole: 2
},
loginRules: {
username: [
{ required: true, trigger: 'blur', message: '请输入您的账号' }
],
password: [
{ required: true, trigger: 'blur', message: '请输入您的密码' }
],
code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
},
loading: false,
captchaEnabled: true,
register: false,
redirect: undefined,
a1: `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl8bS1kYTiMhIS5MZU253bc0ukaxrA1lfCziABFxQrC2c09tMrQGjuH6V1x2ofNBMGhOD9uWN/qkAQy/HwOe/NKUqCw6N0ov6guSrqMDW/BdZ3Bl0rmM1/95jTC1xffFFvej7xWNffIbaPI+bJ4WLX9NViNi9HmT0BRNzJ4d2R86LPPCa+bxLaPjsh2R2tBkbLkUot9769aJaPPiwPCZHMkuQenjHSmpWL0okleqMH8EGX7j6A5A/4IUXPMNKMMzkiSRpsIJ65GJmDAbnR3ZXRfC8MzVBBJB6zr5N0F4N9xZfF+JS/Yx726tCu+rA6GDCyTxtQ/wnKpPdwFP5nUWCWQIDAQAB`
}
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
},
activeName(newVal) {
if (newVal === 'first') {
this.loginForm.loginRole = 2
} else if (newVal === 'second') {
this.loginForm.loginRole = 1
}
}
},
computed: {
showGovernmentLoginButton() {
return this.activeName === 'second'
},
showEnterpriseLoginButton() {
return this.activeName === 'first'
}
},
created() {
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
}
});
},
getCookie() {
const username = Cookies.get('username')
const password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
}
// 2048 RSA
const lines = [];
lines.push('-----BEGIN PUBLIC KEY-----');
for (let i = 0; i < this.a1.length; i += 64) {
lines.push(this.a1.slice(i, i + 64));
}
lines.push('-----END PUBLIC KEY-----');
lines.join('\n')
const publicKey = forge.pki.publicKeyFromPem(lines.join('\n'));
//
var dataBytes = forge.util.encodeUtf8(this.loginForm.password);
//
var encryptedBytes = publicKey.encrypt(dataBytes, 'RSA-OAEP', {
md: forge.md.sha256.create(),
mgf1: {
md: forge.md.sha1.create()
}
});
// Base64
var encryptedBase64 = forge.util.encode64(encryptedBytes);
//
const loginData = {
username: this.loginForm.username,
password: encryptedBase64,
code: this.loginForm.code,
uuid: this.loginForm.uuid,
loginRole: this.activeName === 'first' ? 2 : 1
};
this.$store.dispatch('Login', loginData)
.then(() => {
this.$router.push({ path: this.redirect || '/' }).catch(() => { });
})
.catch((error) => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
console.error('登录失败:', error);
});
}
});
},
handleGovernmentLogin() {
window.location.href = 'https://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/login'
},
handleEnterpriseLogin() {
window.location.href = 'https://gysl.sipac.gov.cn';
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-tabs__active-bar {
width: 2rem !important;
margin-left: 3rem;
background-color: #216CDC;
height: 0.21rem;
border-radius: 0.16rem;
}
::v-deep .el-tabs__header {
border-bottom: none !important;
}
::v-deep .el-tabs__item {
font-size: 1rem;
padding: 0 20px;
color: #3D424C;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #3D424C;
}
::v-deep .el-tabs__item.is-active {
color: #216CDC;
}
::v-deep .el-tabs__nav-wrap::after {
display: none !important;
}
.tongyidenglu {
margin-top: 1rem;
margin-left: 0rem;
}
.login {
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px 0 0 6px;
height: 100%;
background-image: url('../assets/images/loginbackground.png');
background-size: cover;
}
.loginleft {
width: 35rem;
height: 40rem;
background-image: url('../assets/images/loginleft.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.title {
width: 29.13rem;
height: 1.94rem;
font-family: Alibaba PuHuiTi;
font-weight: 500;
font-size: 2rem;
color: #292C33;
line-height: 3.5rem;
text-align: center;
margin-top: 1rem;
}
.loginitem {
width: 24rem;
}
.login-form {
border-radius: 0 6px 6px 0;
background: #ffffff;
width: 50rem;
height: 40rem;
padding: 25px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
img {
width: 6.56rem;
height: 3.56rem;
}
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.logintabs {
margin-top: 2.88rem;
width: 18rem;
}
.login-code {
width: 35%;
height: 1.8rem;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #333;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
.el-tabs__item.is-active {
color: #216CDC;
position: relative;
padding-bottom: 0.5rem;
}
</style>

@ -6,10 +6,10 @@
<div class="containerheadone" id="listtop">
<Title :basicInfo="basicInformation"></Title>
<div style="display: flex; gap: 5%; width: auto">
<div v-if="checkRole(['common']) && action === 'okay'">
<div v-if="checkRole(['common','gov']) && action === 'okay'">
<el-button
type="primary"
v-if="checkRole(['common'])"
v-if="checkRole(['common','gov'])"
@click="aduitAlltwo"
>保存</el-button
>
@ -129,8 +129,8 @@
>
</Others>
</div>
<div class="footer" v-if="checkRole(['common']) && action === 'fill'">
<el-button type="primary" v-if="checkRole(['common'])" @click="aduitAll"
<div class="footer" v-if="checkRole(['common','gov']) && action === 'fill'">
<el-button type="primary" v-if="checkRole(['common','gov'])" @click="aduitAll"
>审核通过</el-button
>
</div>

@ -6,7 +6,7 @@
<qiyeduan />
</div>
<!-- 政务端 -->
<div v-if="checkRole(['common'])">
<div v-if="checkRole(['common','gov'])">
<zhengwuduan />
</div>
</div>
@ -26,7 +26,7 @@ export default {
computed: {
showCompanySection() {
const isCompany = this.checkRole(['company']);
const isCommon = this.checkRole(['common']);
const isCommon = this.checkRole(['common','gov']);
//
return isCompany && !isCommon;
}

@ -1,7 +1,7 @@
<template>
<div>
<!-- 政务端 -->
<div v-if="checkRole(['common'])">
<div v-if="checkRole(['common','gov'])">
<div class="headerbox">
<el-form size="small" :inline="true" label-width="7rem">
<el-row style="margin-top: 1rem;">
@ -213,7 +213,7 @@ export default {
computed: {
showCompanySection() {
const isCompany = this.checkRole(['company']);
const isCommon = this.checkRole(['common']);
const isCommon = this.checkRole(['common','gov']);
return isCompany && !isCommon;
}
},

@ -3,7 +3,7 @@
<el-row :gutter="20">
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
<!--部门数据-->
<pane size="16">
<!-- <pane size="16">
<el-col>
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
@ -12,7 +12,7 @@
<el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current @node-click="handleNodeClick" />
</div>
</el-col>
</pane>
</pane> -->
<!--用户数据-->
<pane size="84">
<el-col>
@ -61,7 +61,7 @@
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<!-- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> -->
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<template slot-scope="scope">
@ -103,10 +103,17 @@
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="归属部门" prop="deptId">
<treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true" placeholder="请选择归属部门" />
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
@ -149,7 +156,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
@ -164,7 +171,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
<el-row>
<el-col :span="24">
<el-form-item label="备注">

Loading…
Cancel
Save