Browse Source

Merge branch 'dev-role'

master
jiangyy 3 years ago
parent
commit
84d085ab4c
  1. 2
      src/js/dai/request.js
  2. 2
      src/js/dai/request2.js
  3. 226
      src/router/index.js
  4. 1
      src/utils/index.js
  5. 16
      src/views/modules/404.vue
  6. 4529
      src/views/modules/base/organization/organization.vue
  7. 16
      src/views/modules/visual/404.vue
  8. 2
      src/views/modules/visual/communityGovern/fivelayers/mapIndex copy.vue
  9. 2
      src/views/modules/visual/communityGovern/fivelayers/mapIndex.vue
  10. 379
      src/views/modules/workSys/role/role.vue
  11. 356
      src/views/modules/workSys/role/roleForm.vue
  12. 4
      src/views/pages/404.vue
  13. 65
      src/views/pages/index.vue
  14. 2
      src/views/pages/login.vue

2
src/js/dai/request.js

@ -4,6 +4,7 @@
import axios from "axios";
import curry from "dai-js/tools/curry";
import { Message } from "element-ui";
import { clearLoginInfo } from "@/utils";
const request = curry(
(method, url, data = {}, headers = {}, progress = () => {}) => {
@ -42,6 +43,7 @@ const request = curry(
// 10005 token为空 10006登陆超时 10007别处登录
console.log("登录失效");
Message.error(res.data.msg);
clearLoginInfo();
return next({
name: "login",
});

2
src/js/dai/request2.js

@ -4,6 +4,7 @@
import axios from "axios";
import curry from "dai-js/tools/curry";
import { Message } from "element-ui";
import { clearLoginInfo } from "@/utils";
const request = curry(
(method, url, data = {}, headers = {}, progress = () => {}) => {
@ -42,6 +43,7 @@ const request = curry(
// 10005 token为空 10006登陆超时 10007别处登录
console.log("登录失效");
Message.error(res.data.msg);
clearLoginInfo();
return next({
name: "login",
});

226
src/router/index.js

@ -94,6 +94,16 @@ export const moduleRoutes = {
isTab: true,
},
},
{
path: "404",
props: true,
component: () => import("@/views/modules/404"),
name: "main-404",
meta: {
title: "页面未找到或无权访问",
isTab: false,
},
},
],
};
@ -129,6 +139,16 @@ export const moduleShujuRoutes = {
isTab: false,
},
},
{
path: "404",
props: true,
component: () => import("@/views/modules/visual/404"),
name: "main-shuju-404",
meta: {
title: "页面未找到或无权访问",
isTab: false,
},
},
],
};
@ -193,194 +213,8 @@ router.beforeEach((to, from, next) => {
const customerId = localStorage.getItem("customerId");
console.log("customerId:", customerId);
window.SITE_CONFIG["menuShujuList"] = [
// {
// url: "/visual/plugin/power/organization",
// name: "动力主轴",
// id: "5feawfwaefwa577",
// },
{
id: "22213213",
name: "基础信息",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/basicinfo/basicInfoMain",
name: "人房信息统计",
id: "5feawfwaefwa5",
},
{
url: "/visual/basicinfo/personCategory/index",
name: "人员类别分析",
id: "5fwaefwaefawef5",
},
{
url: "/visual/basicinfo/houseStatic/houseStatic",
name: "人房概览统计",
id: "5fwaefwaefawef6",
},
],
},
{
icon: "icon-setting",
id: "2",
name: "人员图谱",
url: "visual/basicinfo/peopleSearch",
},
{
icon: "icon-setting",
id: "3",
name: "人员预警",
url: "visual/warning/index",
},
{
icon: "icon-setting",
id: "2221321001",
name: "社区党建",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/communityParty/gridParty",
name: "网格党建平面图",
id: "5feawfwaefwa579",
},
{
url: "/visual/communityParty/party",
name: "党员信息统计",
id: "5feawfwaefwa578",
},
{
url: "/visual/communityParty/community",
name: "联建单位分析",
id: "5fwaefwaefawef588",
},
{
url: "/visual/communityParty/elegant",
name: "党员风采榜",
id: "5fwaefwaefawef589",
},
],
},
{
icon: "icon-setting",
id: "2221321123",
name: "社区服务",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "/visual/measure/service",
name: "需求服务分析",
id: "5feawfwaefwa57",
},
{
url: "/visual/measure/volunteer",
name: "志愿服务分析",
id: "5fwaefwaefawef58",
},
],
},
{
icon: "icon-setting",
id: "6",
name: "社区治理",
children: [
{
url: "visual/communityGovern/shijianchuli/shijianchulifenxi",
name: "事件处理分析",
id: "shijianchulifenxi",
},
// {
// url: "visual/communityGovern/processAnalyze",
// name: "事件处置分析",
// id: "processAnalyze",
// },
{
url: "/visual/communityGovern/shijianfenlei/shijianfenleifenxi",
name: "事件分类分析",
id: "shijianfenleifenxi",
},
{
url: "/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi",
name: "多元服务分析",
id: "duoyuanfuwufenxi",
},
// {
// url: "/visual/communityGovern/typeAnalyze",
// name: "事件分类分析",
// id: "typeAnalyze",
// },
// {
// url: "/visual/communityGovern/resibuzz",
// name: "居民热议分析",
// id: "resibuzz",
// },
// {
// url: "/visual/communityGovern/distributionAnalyze",
// name: "事件分布分析",
// id: "distributionAnalyze",
// },
],
},
{
icon: "icon-setting",
id: "2221321fefefaewfa123",
name: "初心互助",
url: "visual/heart/index",
children: [],
},
{
icon: "icon-setting",
id: "2221321fefefaewfa122223",
name: "疫情防控",
url: "",
children: [],
},
{
icon: "icon-setting",
id: "44rq22222q2222",
name: "智慧安防",
// url: "visual/basicinfo/basicInfoMain",
children: [
{
url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/monitor-panel",
// url: "/visual/ai/index",
name: "视频监控",
id: "5feawfwa111111efwa57",
},
/*{
url: "/visual/ai/renliu",
name: "人流数据",
id: "5fwaefwae222112fawef58",
},
{
url: "/visual/ai/cheliu",
name: "车流数据",
id: "erawerwecsxefwaw",
},
{
url: "/visual/ai/shebei",
name: "设备数据",
id: "zfzffewaf",
},
{
url: "/visual/ai/gongdan",
name: "工单数据",
id: "fewafwafewaefddd",
},*/
{
// url: "/visual/ai/yujing",
url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/data-analysis",
name: "预警分析",
id: "545345fdsfs",
},
],
},
];
// fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
http
.get("/gov/access/menu/nav?tableName=data_menu")
.get("gov/access/menu/navDigitalCommunity?tableName=data_menu")
.then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录
@ -406,7 +240,7 @@ router.beforeEach((to, from, next) => {
});
http
.get("/gov/access/menu/nav")
.get("gov/access/menu/navDigitalCommunity")
.then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录
@ -519,10 +353,10 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
children: routes,
},
{
path: "*",
// redirect: {
// name: "404",
// },
path: "/main/*",
redirect: {
path: "/main/404",
},
},
]);
window.SITE_CONFIG["dynamicMenuRoutes"] = routes;
@ -593,10 +427,10 @@ function fnAddDynamicMenuRoutes2(menuList = [], routes = []) {
children: routes,
},
{
path: "*",
// redirect: {
// name: "404",
// },
path: "/main-shuju/*",
redirect: {
path: "/main-shuju/404",
},
},
]);
window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes;

1
src/utils/index.js

@ -45,6 +45,7 @@ export function getDictLabel(dictType, dictValue) {
export function clearLoginInfo() {
store.commit('resetStore')
Cookies.remove('token')
localStorage.setItem("token", '');
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false
}

16
src/views/modules/404.vue

@ -0,0 +1,16 @@
<template>
<div class="m-404">页面未找到或无权访问</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.m-404 {
margin-top: 200px;
font-size: 60px;
color: rgba(#000, 0.3);
text-align: center;
}
</style>

4529
src/views/modules/base/organization/organization.vue

File diff suppressed because it is too large

16
src/views/modules/visual/404.vue

@ -0,0 +1,16 @@
<template>
<div class="m-404">页面未找到或无权访问</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.m-404 {
margin-top: 200px;
font-size: 60px;
color: rgba(#fff, 0.6);
text-align: center;
}
</style>

2
src/views/modules/visual/communityGovern/fivelayers/mapIndex copy.vue

@ -923,7 +923,7 @@ const vueGis = {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icDangerousChemicals/detail"
let params = {
icSuperiorResourceId: info.id
icDangerousChemicalsId: info.id
}
const { data, code, msg } = await requestPost(url, params)

2
src/views/modules/visual/communityGovern/fivelayers/mapIndex.vue

@ -922,7 +922,7 @@ const vueGis = {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/icDangerousChemicals/detail"
let params = {
icSuperiorResourceId: info.id
icDangerousChemicalsId: info.id
}
const { data, code, msg } = await requestPost(url, params)

379
src/views/modules/workSys/role/role.vue

@ -0,0 +1,379 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'110px'">
<el-form-item label="角色名称"
prop="name">
<el-input v-model="formData.name"
size="small"
class="list_item_width_1"
clearable
placeholder="请输入角色名称">
</el-input>
</el-form-item>
<!-- <el-form-item label="创建时间"
label-width="110px"
prop="createdTime">
<el-date-picker v-model="formData.createdTime"
size="small"
type="datetime"
@change="handleTimeChange"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
placeholder="创建时间">
</el-date-picker>
</el-form-item> -->
<el-button style="margin-left:30px"
size="small"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
size="small"
class="diy-button--reset"
@click="resetSearch">重置</el-button>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--add"
size="small"
@click="handleAdd">新增</el-button>
</div>
<el-table class="table"
ref="ref_table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="name"
header-align="center"
align="center"
label="角色名称"
min-width="100">
</el-table-column>
<el-table-column prop="remark"
header-align="center"
align="center"
label="备注"
min-width="110">
</el-table-column>
<el-table-column prop="createdTime"
header-align="center"
align="center"
label="创建时间"
min-width="170">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button v-if="true"
type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
class="div-table-button--edit"
size="small"
@click="handleEdit(scope.row)">修改</el-button>
<el-button type="text"
class="div-table-button--delete "
size="small"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="850px"
top="5vh"
class="dialog-h"
@closed="diaClose">
<role-form ref="ref_form"
@dialogCancle="diaClose"
@dialogOk="addFormOk"></role-form>
</el-dialog>
</div>
</template>
<script>
import roleForm from './roleForm'
import { requestPost, requestGet } from '@/js/dai/request'
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 20,
pageNo: 0,
tableLoading: false,
isResiUser: true,
agencyId: '',
timeRange: [],
formData: {
name: '',//
// createdTime: '',//
},
tableData: [],
//form
formShow: false,
formTitle: '新增',
}
},
components: {
roleForm
},
async created () {
},
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
await this.loadTable()
},
activated () {
this.$refs['ref_table'].doLayout()
},
methods: {
async handleSearch () {
this.isResiUser = this.formData.orgType === 'current'
await this.loadTable()
this.$nextTick(() => {
this.$refs.ref_table.doLayout() //
})
},
async loadTable () {
this.tableLoading = true
const url = "/gov/access/govrole/page"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
handleTimeChange (time) {
if (time) {
this.formData.startTime = time[0]
this.formData.endTime = time[1]
} else {
this.formData.startTime = ''
this.formData.endTime = ''
}
},
diaClose () {
this.$refs.ref_form.resetData()
this.formShow = false
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('edit', row.id)
})
},
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
})
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async handleDelete (row) {
let message = '确认删除?'
this.$confirm(message, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteRole(row)
})
.catch(err => {
});
},
async deleteRole (row) {
const url = "/gov/access/govrole/del"
let params = [row.id]
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.$message({
type: "success",
message: "操作成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
name: '',//
}
this.pageNo = 0
this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 360 + this.iframeHeight : this.clientHeight - 360
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
</style>

356
src/views/modules/workSys/role/roleForm.vue

@ -0,0 +1,356 @@
<template>
<div class="epidemic-form">
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
:disabled="formType==='detail'"
class="form">
<el-form-item label="角色名称"
prop="name"
label-width="150px"
style="display: block">
<el-input class="item_width_2"
placeholder="请输入角色名称"
clearable
v-model="formData.name">
</el-input>
</el-form-item>
<el-form-item label="备注"
prop="remark"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="500"
show-word-limit
:autosize="{ minRows: 5, maxRows: 10 }"
clearable
placeholder="请输入备注"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="管理平台菜单"
prop="content"
label-width="150px"
style="display: block">
<el-tree class="item_width_1"
:data="menuList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
:default-expanded-keys="['000']"
ref="menuListTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
<el-form-item label="可视化平台菜单"
prop="content"
label-width="150px"
style="display: block">
<el-tree class="item_width_1 item_border"
:data="menuListShuju"
:props="{ label: 'name', children: 'children' }"
node-key="id"
:default-expanded-keys="['000']"
ref="menuListShujuTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
</el-form>
</div>
<div class="form_div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button v-if="formType != 'detail'"
size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request'
let loading //
export default {
data () {
return {
formType: 'add', // addeditdetail
btnDisable: false,
roleId: '',
menuList: [],
menuListShuju: [],
formData: {
id: '',
name: '',
remark: '',//
menuIdList: [],
customerId: ''
},
}
},
components: {},
async mounted () {
},
methods: {
async initForm (type, roleId) {
this.startLoading()
this.customerId = localStorage.getItem("customerId");
this.formData.customerId = this.customerId
//
await this.getMenuList()
await this.getMenuShujuList()
this.$refs.menuListTree.setCheckedKeys([])
this.$refs.menuListShujuTree.setCheckedKeys([])
this.formType = type
if (roleId) {
this.roleId = roleId
this.formData.id = roleId
this.loadFormData()
}
this.endLoading()
},
async getMenuList () {
const url = "/gov/access/menu/nav"
let params = {}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.menuList = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuList = data
} else {
this.$message.error(msg)
}
},
async getMenuShujuList () {
const url = "/gov/access/menu/nav"
let params = {
tableName: 'data_menu'
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.menuListShuju = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuListShuju = data
} else {
this.$message.error(msg)
}
},
async loadFormData () {
// const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/detail'
const url = '/gov/access/govrole/' + this.roleId
let params = {
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.formData = data
this.formData.menuIdList.forEach(item => {
this.$refs.menuListTree.setChecked(item, true)
})
this.formData.menuIdList.forEach(item => {
this.$refs.menuListShujuTree.setChecked(item, true)
})
this.formData.customerId = this.customerId
} else {
this.$message.error(msg)
}
},
handleComfirm () {
this.$refs['ref_form'].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj)
} else {
this.addNat()
}
})
},
async addNat () {
this.formData.menuIdList = []
this.formData.menuIdList = [
...this.$refs.menuListTree.getCheckedKeys(),
...this.$refs.menuListTree.getHalfCheckedKeys(),
...this.$refs.menuListShujuTree.getCheckedKeys(),
...this.$refs.menuListShujuTree.getHalfCheckedKeys()
]
this.formData.menuIdList = this.formData.menuIdList.filter(item => item !== '000')
console.log('menuAll', this.formData)
// return false
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 5000)
let url = ''
if (this.formType === 'add') {
url = '/gov/access/govrole/save'
this.formData.roleId = ''
} else {
url = '/gov/access/govrole/edit'
}
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.roleId = ''
this.formData = {
id: '',
name: '',
remark: '',//
menuIdList: [],
customerId: ''
}
this.$refs['ref_form'].resetFields()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
name: [
{ required: true, message: '角色名称不能为空', trigger: 'change' }
],
}
},
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
.item_border {
border: 1px;
border-radius: 50%;
}
</style>
<style lang='scss'>
//
.hide .el-upload--picture-card {
display: none;
}
// /
.el-upload-list__item {
transition: none !important;
}
</style>

4
src/views/pages/404.vue

@ -2,11 +2,11 @@
<div class="aui-wrapper aui-page__not-found">
<div class="aui-content__wrapper">
<div class="aui-content">
<h2 class="title">404</h2>
<h2 class="title" style="font-size: 60px">页面未找到或无权访问</h2>
<p class="desc" v-html="$t('notFound.desc')"></p>
<div class="btn-bar">
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button>
<el-button type="primary" @click="$router.push({ name: 'home' })">{{ $t('notFound.home') }}</el-button>
<el-button type="primary" @click="$router.push({ name: 'index' })">{{ $t('notFound.home') }}</el-button>
</div>
</div>
</div>

65
src/views/pages/index.vue

@ -5,14 +5,14 @@
<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>
@ -21,7 +21,9 @@
<div class="m-footer">
<div class="login-footer">
<p>
<a href="http://www.elinkchina.com.cn/" target="_blank">{{ $t('login.copyright') }}</a>
<a href="http://www.elinkchina.com.cn/" target="_blank">{{
$t("login.copyright")
}}</a>
</p>
</div>
</div>
@ -29,60 +31,69 @@
</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' //
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 //
let loading; //
export default {
data() {
return {
pubKey: null, //
isShowLogin: true,
i18nMessages: messages
}
i18nMessages: messages,
};
},
components: {},
computed: {},
created() {},
mounted() {},
beforeRouteEnter(to, from, next) {
console.log(from);
if (from.name == "login") {
next();
location.reload();
}
next();
},
methods: {
handleClickItem(k) {
if (k == 1) {
this.$router.replace({ name: 'main' })
this.$router.replace({ name: "main" });
} else if (k == 2) {
this.$router.replace({ name: 'main-shuju' })
this.$router.replace({ name: "main-shuju" });
}
},
//
getAutoLogin(platformToken) {
this.dataForm.thirdToken = platformToken
this.dataForm.platform = 'pyld'
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)
return this.$message.error(res.msg);
}
localStorage.setItem('customerId', res.data.customerId)
localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0')
localStorage.setItem('token', res.data.token)
this.$router.replace({ name: 'home' })
localStorage.setItem("customerId", res.data.customerId);
localStorage.setItem("userType", "work");
localStorage.setItem("showHeader", "0");
localStorage.setItem("token", res.data.token);
this.$router.replace({ name: "home" });
})
.catch(() => {})
.catch(() => {});
// epmet-ext9.elinkservice.cn/platform-admin
}
}
}
},
},
};
</script>
<style lang="scss" src="@/assets/scss/pages/indexWork.scss" scoped></style>

2
src/views/pages/login.vue

@ -247,7 +247,7 @@ export default {
localStorage.setItem("userType", "work");
localStorage.setItem("showHeader", "0");
localStorage.setItem("token", res.data.token);
this.$router.replace({ name: "home" });
this.$router.replace({ name: "index" });
})
.catch(() => {});
// epmet-ext9.elinkservice.cn/platform-admin

Loading…
Cancel
Save