mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
JeecgBoot 2.4 微服务正式版本发布,基于SpringBoot的低代码平台
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
404 page
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "404"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -137,7 +137,7 @@
|
||||
return getFileAccessHttpUrl(this.avatar());
|
||||
},
|
||||
getTeams() {
|
||||
this.$http.get('/api/workplace/teams')
|
||||
this.$http.get('/mock/api/workplace/teams')
|
||||
.then(res => {
|
||||
this.teams = res.result
|
||||
this.teamSpinning = false
|
||||
|
||||
@ -205,20 +205,20 @@
|
||||
methods: {
|
||||
...mapGetters(["nickname", "welcome"]),
|
||||
getProjects() {
|
||||
this.$http.get('/api/list/search/projects')
|
||||
this.$http.get('/mock/api/list/search/projects')
|
||||
.then(res => {
|
||||
this.projects = res.result && res.result.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getActivity() {
|
||||
this.$http.get('/api/workplace/activity')
|
||||
this.$http.get('/mock/api/workplace/activity')
|
||||
.then(res => {
|
||||
this.activities = res.result
|
||||
})
|
||||
},
|
||||
getTeams() {
|
||||
this.$http.get('/api/workplace/teams')
|
||||
this.$http.get('/mock/api/workplace/teams')
|
||||
.then(res => {
|
||||
this.teams = res.result
|
||||
})
|
||||
@ -226,7 +226,7 @@
|
||||
initRadar() {
|
||||
this.radarLoading = true
|
||||
|
||||
this.$http.get('/api/workplace/radar')
|
||||
this.$http.get('/mock/api/workplace/radar')
|
||||
.then(res => {
|
||||
|
||||
const dv = new DataSet.View().source(res.result)
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Result from '../../result/Result'
|
||||
import Result from '../../../result/Result'
|
||||
|
||||
export default {
|
||||
name: "Step3",
|
||||
@ -192,7 +192,7 @@
|
||||
permissionList: null,
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return this.$http.get('/api/permission', {
|
||||
return this.$http.get('/mock/api/permission', {
|
||||
params: Object.assign(parameter, this.queryParam)
|
||||
}).then(res => {
|
||||
let result = res.result
|
||||
@ -128,7 +128,7 @@
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return this.$http.get('/api/role', {
|
||||
return this.$http.get('/mock/api/role', {
|
||||
params: Object.assign(parameter, this.queryParam)
|
||||
}).then(res => {
|
||||
return res.result
|
||||
@ -173,7 +173,7 @@
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return this.$http.get('/api/service', {
|
||||
return this.$http.get('/mock/api/service', {
|
||||
params: Object.assign(parameter, this.queryParam)
|
||||
}).then(res => {
|
||||
return res.result
|
||||
@ -75,7 +75,7 @@
|
||||
// 加载中
|
||||
spinning:false,
|
||||
url: {
|
||||
pdfList: "/api/pdfList",
|
||||
pdfList: "/mock/api/pdfList",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
components: { JTreeTable },
|
||||
data() {
|
||||
return {
|
||||
url: '/api/asynTreeList',
|
||||
url: '/mock/api/asynTreeList',
|
||||
columns: [
|
||||
{
|
||||
title: '菜单名称',
|
||||
|
||||
@ -130,7 +130,7 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选择职务">
|
||||
<j-select-position v-model="formData.selectPosition" />
|
||||
<j-select-position :buttons="false" :disabled="true" v-model="formData.selectPosition" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中值:{{ formData.selectPosition}}</a-col>
|
||||
@ -285,7 +285,7 @@
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="分类字典树">
|
||||
<j-category-select v-model="formData.selectCategory" pcode="A01" :multiple="true"/>
|
||||
<j-category-select v-model="formData.selectCategory" pcode="B01" :multiple="true"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">选中的值(v-model):{{ formData.selectCategory }}</a-col>
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
console.log('props sex: ',this.sex);
|
||||
console.log('props name: ',this.name);
|
||||
|
||||
getAction('/api/area').then((res) => {
|
||||
getAction('/mock/api/area').then((res) => {
|
||||
console.log("------------")
|
||||
console.log(res)
|
||||
this.areaOptions = res;
|
||||
|
||||
@ -71,6 +71,11 @@
|
||||
</a-row>
|
||||
|
||||
<a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in orderMainModel.jeecgOrderCustomerList" :key="index">
|
||||
<a-col :span="6" style="display: none">
|
||||
<a-form-item>
|
||||
<a-input placeholder="id" v-decorator="['jeecgOrderCustomerList['+index+'].id', {'initialValue':item.id}]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="5">
|
||||
<a-form-item>
|
||||
<a-input placeholder="客户名" v-decorator="['jeecgOrderCustomerList['+index+'].name', {'initialValue':item.name,rules: [{ required: true, message: '请输入用户名!' }]}]" />
|
||||
@ -112,6 +117,11 @@
|
||||
<a-col :span="6">操作</a-col>
|
||||
</a-row>
|
||||
<a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in orderMainModel.jeecgOrderTicketList" :key="index">
|
||||
<a-col :span="6" style="display: none">
|
||||
<a-form-item>
|
||||
<a-input placeholder="id" v-decorator="['jeecgOrderTicketList['+index+'].id', {'initialValue':item.id}]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-form-item>
|
||||
<a-input placeholder="航班号" v-decorator="['jeecgOrderTicketList['+index+'].ticketCode', {'initialValue':item.ticketCode,rules: [{ required: true, message: '请输入航班号!' }]}]" />
|
||||
@ -213,7 +223,6 @@
|
||||
this.form.setFieldsValue(pick(this.orderMainModel,'orderCode','ctype','orderMoney','content'))
|
||||
this.form.setFieldsValue({orderDate:this.orderMainModel.orderDate?moment(this.orderMainModel.orderDate):null}) //时间格式化
|
||||
});
|
||||
console.log(this.orderMainModel)
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
@ -242,7 +251,6 @@
|
||||
jeecgOrderCustomerList: orderMainData.jeecgOrderCustomerList,
|
||||
jeecgOrderTicketList: orderMainData.jeecgOrderTicketList
|
||||
}
|
||||
|
||||
console.log(formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
@ -309,4 +317,4 @@
|
||||
.ant-tabs-content .ant-form-item {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -396,7 +396,7 @@
|
||||
countBjl:"sps/register/bjlTenDaysCount",
|
||||
countISll:'sps/register/ISllTenDaysCount',
|
||||
countIBjl:'sps/register/IBjlTenDaysCount',
|
||||
queryDiskInfo:'api/queryDiskInfo'
|
||||
queryDiskInfo:'sys/actuator/redis/queryDiskInfo'
|
||||
},
|
||||
chartData:{
|
||||
sll:[],
|
||||
|
||||
@ -93,10 +93,10 @@
|
||||
// 统计图类型
|
||||
tabStatus:"bar",
|
||||
url: {
|
||||
getYearCountInfo: "/api/report/getYearCountInfo",
|
||||
getMonthCountInfo:"/api/report/getMonthCountInfo",
|
||||
getCntrNoCountInfo:"/api/report/getCntrNoCountInfo",
|
||||
getCabinetCountInfo:"/api/report/getCabinetCountInfo",
|
||||
getYearCountInfo: "/mock/api/report/getYearCountInfo",
|
||||
getMonthCountInfo:"/mock/api/report/getMonthCountInfo",
|
||||
getCntrNoCountInfo:"/mock/api/report/getCntrNoCountInfo",
|
||||
getCabinetCountInfo:"/mock/api/report/getCabinetCountInfo",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -183,11 +183,11 @@
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/message/sysMessage/list",
|
||||
delete: "/message/sysMessage/delete",
|
||||
deleteBatch: "/message/sysMessage/deleteBatch",
|
||||
exportXlsUrl: "message/sysMessage/exportXls",
|
||||
importExcelUrl: "message/sysMessage/importExcel",
|
||||
list: "/sys/message/sysMessage/list",
|
||||
delete: "/sys/message/sysMessage/delete",
|
||||
deleteBatch: "/sys/message/sysMessage/deleteBatch",
|
||||
exportXlsUrl: "sys/message/sysMessage/exportXls",
|
||||
importExcelUrl: "sys/message/sysMessage/importExcel",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -192,11 +192,11 @@
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/message/sysMessageTemplate/list",
|
||||
delete: "/message/sysMessageTemplate/delete",
|
||||
deleteBatch: "/message/sysMessageTemplate/deleteBatch",
|
||||
exportXlsUrl: "message/sysMessageTemplate/exportXls",
|
||||
importExcelUrl: "message/sysMessageTemplate/importExcel",
|
||||
list: "/sys/message/sysMessageTemplate/list",
|
||||
delete: "/sys/message/sysMessageTemplate/delete",
|
||||
deleteBatch: "/sys/message/sysMessageTemplate/deleteBatch",
|
||||
exportXlsUrl: "sys/message/sysMessageTemplate/exportXls",
|
||||
importExcelUrl: "sys/message/sysMessageTemplate/importExcel",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -109,8 +109,8 @@
|
||||
validatorRules: {},
|
||||
disableSubmit: true,
|
||||
url: {
|
||||
add: "/message/sysMessage/add",
|
||||
edit: "/message/sysMessage/edit",
|
||||
add: "/sys/message/sysMessage/add",
|
||||
edit: "/sys/message/sysMessage/edit",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -114,8 +114,8 @@
|
||||
templateType: {rules: [{required: true, message: '请输入模板类型!'}]},
|
||||
},
|
||||
url: {
|
||||
add: "/message/sysMessageTemplate/add",
|
||||
edit: "/message/sysMessageTemplate/edit",
|
||||
add: "/sys/message/sysMessageTemplate/add",
|
||||
edit: "/sys/message/sysMessageTemplate/edit",
|
||||
},
|
||||
useEditor:false,
|
||||
templateEditorContent:""
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
confirmLoading: false,
|
||||
url: {
|
||||
send: "/message/sysMessageTemplate/sendMsg",
|
||||
send: "/sys/message/sysMessageTemplate/sendMsg",
|
||||
},
|
||||
templateName: "",
|
||||
templateContent: "",
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
//数据集
|
||||
diskInfo:[],
|
||||
url:{
|
||||
queryDiskInfo:'actuator/redis/queryDiskInfo',
|
||||
queryDiskInfo:'sys/actuator/redis/queryDiskInfo',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -76,9 +76,9 @@
|
||||
dataIndex: 'value'
|
||||
}],
|
||||
url: {
|
||||
keysSize: '/actuator/redis/keysSize',
|
||||
memoryInfo: '/actuator/redis/memoryInfo',
|
||||
info: '/actuator/redis/info'
|
||||
keysSize: '/sys/actuator/redis/keysSize',
|
||||
memoryInfo: '/sys/actuator/redis/memoryInfo',
|
||||
info: '/sys/actuator/redis/info'
|
||||
},
|
||||
path: '/monitor/redis/info'
|
||||
}
|
||||
|
||||
@ -128,9 +128,9 @@
|
||||
}
|
||||
],
|
||||
url: {
|
||||
upload: "/oss/file/upload",
|
||||
list: "/oss/file/list",
|
||||
delete: "/oss/file/delete",
|
||||
upload: "/sys/oss/file/upload",
|
||||
list: "/sys/oss/file/list",
|
||||
delete: "/sys/oss/file/delete",
|
||||
minioUpload: "/sys/upload/uploadMinio"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,101 +1,111 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<div style="padding-bottom: 2px">
|
||||
<a-alert type="warning" show-icon>
|
||||
<div slot="message" style="width: 100%">
|
||||
<span>路由配置请慎重</span>
|
||||
<span style="display:inline-block;float:right;padding-right: 5px">
|
||||
<a @click="clearRedis"><a-icon type="reload" />清除缓存</a>
|
||||
</span>
|
||||
</div>
|
||||
</a-alert>
|
||||
<a-card :bordered="false">
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="showModal(null)" type="primary" icon="plus">新增</a-button>
|
||||
</div>
|
||||
<div :id="eleId" :style="{ height: editorHeight + 'px', width: '100%' }"></div>
|
||||
<div style="text-align: center;padding-top:10px">
|
||||
<a-button type="primary" @click="submitForm" style="width:160px">保存</a-button>
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
:scroll="{x:true}"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:loading="loading"
|
||||
class="j-table-force-nowrap"
|
||||
@change="handleTableChange">
|
||||
<span slot="status" slot-scope="text, record, index">
|
||||
<a-tag color="pink" v-if="text==0">禁用</a-tag>
|
||||
<a-tag color="#87d068" v-if="text==1" >正常</a-tag>
|
||||
</span>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="showModal(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<gate-way-route-modal ref="modalForm" @ok="modalFormOk"></gate-way-route-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JsonEditor from 'jsoneditor'
|
||||
import 'jsoneditor/dist/jsoneditor.min.css'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import { mixinDevice } from '@/utils/mixin'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import GateWayRouteModal from './modules/GateWayRouteModal'
|
||||
|
||||
export default {
|
||||
name: "SysGatewayRouteList",
|
||||
data () {
|
||||
name: 'TenantList',
|
||||
mixins: [JeecgListMixin, mixinDevice],
|
||||
components: {
|
||||
GateWayRouteModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
eleId:'jsoneditor',
|
||||
description: 'gateway路由管理管理页面',
|
||||
editor: null,
|
||||
editorWidth:400,
|
||||
editorHeight:500,
|
||||
url:{
|
||||
description: 'adad管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '路由ID',
|
||||
align: 'center',
|
||||
dataIndex: 'routerId'
|
||||
}, {
|
||||
title: '路由名称',
|
||||
align: 'center',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '路由URI',
|
||||
align: 'center',
|
||||
dataIndex: 'uri'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
scopedSlots: { customRender: 'status' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 147,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/sys/gatewayRoute/list',
|
||||
update: '/sys/gatewayRoute/updateAll',
|
||||
clear: '/sys/gatewayRoute/clearRedis'
|
||||
delete: '/sys/gatewayRoute/delete'
|
||||
},
|
||||
|
||||
dictOptions: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let winWidth = window.innerWidth;
|
||||
console.log("页面宽度",winWidth)
|
||||
this.editorWidth = winWidth
|
||||
|
||||
},
|
||||
mounted(){
|
||||
this.initJsonEditor();
|
||||
},
|
||||
methods: {
|
||||
initJsonEditor() {
|
||||
let container = document.getElementById(this.eleId);
|
||||
let options = {
|
||||
modes: ['text', 'code', 'tree', 'form', 'view'],
|
||||
mode: 'tree',
|
||||
ace: ace,
|
||||
sortObjectKeys: 'code',
|
||||
mainMenuBar:['format']
|
||||
};
|
||||
this.editor = new JsonEditor(container, options);
|
||||
this.initRouteData();
|
||||
},
|
||||
initRouteData(){
|
||||
getAction(this.url.list).then(res=>{
|
||||
if(res.success){
|
||||
let array = res.result
|
||||
console.log('当前路由配置信息为', array)
|
||||
this.editor.set(array)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取json
|
||||
submitForm() {
|
||||
let text = this.editor.getText()
|
||||
console.log("保存的json数据",text)
|
||||
if(!text || text.length<=0 || text=='{}' || text=='[]'){
|
||||
this.$message.warning('未录入任何信息')
|
||||
return ;
|
||||
}
|
||||
postAction(this.url.update,{
|
||||
routes:text
|
||||
}).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
}else{
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
clearRedis(){
|
||||
getAction(this.url.clear).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
}
|
||||
})
|
||||
showModal(record) {
|
||||
this.$refs['modalForm'].show(record)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
101
ant-design-vue-jeecg/src/views/system/SysGatewayRouteList2.vue
Normal file
101
ant-design-vue-jeecg/src/views/system/SysGatewayRouteList2.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<!--<template>-->
|
||||
<!-- <a-card :bordered="false" style="height: 100%">-->
|
||||
<!-- <div style="padding-bottom: 2px">-->
|
||||
<!-- <a-alert type="warning" show-icon>-->
|
||||
<!-- <div slot="message" style="width: 100%">-->
|
||||
<!-- <span>路由配置请慎重</span>-->
|
||||
<!-- <span style="display:inline-block;float:right;padding-right: 5px">-->
|
||||
<!-- <a @click="clearRedis"><a-icon type="reload" />清除缓存</a>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-alert>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div :id="eleId" :style="{ height: editorHeight + 'px', width: '100%' }"></div>-->
|
||||
<!-- <div style="text-align: center;padding-top:10px">-->
|
||||
<!-- <a-button type="primary" @click="submitForm" style="width:160px">保存</a-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-card>-->
|
||||
<!--</template>-->
|
||||
|
||||
<!--<script>-->
|
||||
<!-- import JsonEditor from 'jsoneditor'-->
|
||||
<!-- import 'jsoneditor/dist/jsoneditor.min.css'-->
|
||||
<!-- import { getAction, postAction } from '@/api/manage'-->
|
||||
|
||||
<!-- export default {-->
|
||||
<!-- name: "SysGatewayRouteList",-->
|
||||
<!-- data () {-->
|
||||
<!-- return {-->
|
||||
<!-- eleId:'jsoneditor',-->
|
||||
<!-- description: 'gateway路由管理管理页面',-->
|
||||
<!-- editor: null,-->
|
||||
<!-- editorWidth:400,-->
|
||||
<!-- editorHeight:500,-->
|
||||
<!-- url:{-->
|
||||
<!-- list: '/sys/gatewayRoute/list',-->
|
||||
<!-- update: '/sys/gatewayRoute/updateAll',-->
|
||||
<!-- clear: '/sys/gatewayRoute/clearRedis'-->
|
||||
<!-- },-->
|
||||
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- let winWidth = window.innerWidth;-->
|
||||
<!-- console.log("页面宽度",winWidth)-->
|
||||
<!-- this.editorWidth = winWidth-->
|
||||
|
||||
<!-- },-->
|
||||
<!-- mounted(){-->
|
||||
<!-- this.initJsonEditor();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- initJsonEditor() {-->
|
||||
<!-- let container = document.getElementById(this.eleId);-->
|
||||
<!-- let options = {-->
|
||||
<!-- modes: ['text', 'code', 'tree', 'form', 'view'],-->
|
||||
<!-- mode: 'tree',-->
|
||||
<!-- ace: ace,-->
|
||||
<!-- sortObjectKeys: 'code',-->
|
||||
<!-- mainMenuBar:['format']-->
|
||||
<!-- };-->
|
||||
<!-- this.editor = new JsonEditor(container, options);-->
|
||||
<!-- this.initRouteData();-->
|
||||
<!-- },-->
|
||||
<!-- initRouteData(){-->
|
||||
<!-- getAction(this.url.list).then(res=>{-->
|
||||
<!-- if(res.success){-->
|
||||
<!-- let array = res.result-->
|
||||
<!-- console.log('当前路由配置信息为', array)-->
|
||||
<!-- this.editor.set(array)-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- // 获取json-->
|
||||
<!-- submitForm() {-->
|
||||
<!-- let text = this.editor.getText()-->
|
||||
<!-- console.log("保存的json数据",text)-->
|
||||
<!-- if(!text || text.length<=0 || text=='{}' || text=='[]'){-->
|
||||
<!-- this.$message.warning('未录入任何信息')-->
|
||||
<!-- return ;-->
|
||||
<!-- }-->
|
||||
<!-- postAction(this.url.update,{-->
|
||||
<!-- routes:text-->
|
||||
<!-- }).then(res=>{-->
|
||||
<!-- if(res.success){-->
|
||||
<!-- this.$message.success(res.message)-->
|
||||
<!-- }else{-->
|
||||
<!-- this.$message.error(res.message)-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- clearRedis(){-->
|
||||
<!-- getAction(this.url.clear).then(res=>{-->
|
||||
<!-- if(res.success){-->
|
||||
<!-- this.$message.success(res.message)-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--</script>-->
|
||||
@ -155,10 +155,6 @@
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleAgentSettings(record.username)">代理人</a>
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
@ -169,10 +165,7 @@
|
||||
<!-- table区域-end -->
|
||||
|
||||
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
|
||||
|
||||
<password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
|
||||
|
||||
<sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal>
|
||||
<password-modal ref="passwordmodal"></password-modal>
|
||||
|
||||
<!-- 用户回收站 -->
|
||||
<user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/>
|
||||
@ -291,7 +284,7 @@
|
||||
{ type: 'select', value: 'sex', text: '性别', dictCode: 'sex' },
|
||||
],
|
||||
url: {
|
||||
syncUser: "/process/extActProcess/doSyncUser",
|
||||
syncUser: "/act/process/extActProcess/doSyncUser",
|
||||
list: "/sys/user/list",
|
||||
delete: "/sys/user/delete",
|
||||
deleteBatch: "/sys/user/deleteBatch",
|
||||
@ -375,13 +368,6 @@
|
||||
handleChangePassword(username) {
|
||||
this.$refs.passwordmodal.show(username);
|
||||
},
|
||||
handleAgentSettings(username){
|
||||
this.$refs.sysUserAgentModal.agentSettings(username);
|
||||
this.$refs.sysUserAgentModal.title = "用户代理人设置";
|
||||
},
|
||||
passwordModalOk() {
|
||||
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -177,9 +177,12 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="less" scoped>
|
||||
.ant-table-tbody .ant-table-row td{
|
||||
padding-top:10px;
|
||||
padding-bottom:10px;
|
||||
}
|
||||
/deep/ .ant-modal{
|
||||
height: 700px;
|
||||
}
|
||||
</style>
|
||||
@ -79,7 +79,7 @@
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules: {
|
||||
itemText: {rules: [{required: true, message: '请输入名称!'}]},
|
||||
itemValue: {rules: [{required: true, message: '请输入数据值!'}]},
|
||||
itemValue: {rules: [{required: true, message: '请输入数据值!'},{validator: this.validateItemValue}]},
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -153,6 +153,18 @@
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
validateItemValue(rule, value, callback){
|
||||
if(value){
|
||||
let reg=new RegExp("[`_~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
|
||||
if(reg.test(value)){
|
||||
callback("数据值不能包含特殊字符!")
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
}else{
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
:maskClosable="true"
|
||||
width="45%"
|
||||
placement="right"
|
||||
v-if="visible"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
style="overflow: auto;padding-bottom: 53px;">
|
||||
<a-form-model ref="form" :layout="layout" :label-col="labelCol" :wrapper-col="wrapperCol" :model="router">
|
||||
<a-form-model-item label="路由ID">
|
||||
<a-input v-model="router.routerId" placeholder="路由唯一ID"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="路由名称">
|
||||
<a-input v-model="router.name" placeholder="路由名称"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="路由URI">
|
||||
<a-input v-model="router.uri" placeholder="路由URL"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="路由状态" prop="status">
|
||||
<a-switch default-checked v-model="router.status"/>
|
||||
</a-form-model-item>
|
||||
|
||||
<a-form-model-item prop="predicates" label="路由条件">
|
||||
<div v-for="(item,index) in router.predicates">
|
||||
<a-divider>{{item.name}}
|
||||
<a-icon type="delete" size="22" @click="removePredicate(router,index)"/>
|
||||
</a-divider>
|
||||
<div>
|
||||
<template v-for="(tag, index) in item.args">
|
||||
<a-input v-if="index==currentTagIndex" ref="input" type="text" size="small"
|
||||
:style="{ width: '190px' }"
|
||||
:value="tag"
|
||||
@change="handleInputChange" @blur="handleInputEditConfirm(item,tag,index)"
|
||||
@keyup.enter="handleInputEditConfirm(item,tag,index)"/>
|
||||
<a-tag v-else :key="tag" :closable="true" @close="() => removeTag(item,tag)" @click="editTag(tag,index)">
|
||||
{{ tag }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<a-input v-if="inputVisible&&index==currentNameIndex" ref="input" type="text" size="small"
|
||||
:style="{ width: '100px' }"
|
||||
:value="inputValue"
|
||||
@change="handleInputChange" @blur="handleInputConfirm(item)"
|
||||
@keyup.enter="handleInputConfirm(item)"/>
|
||||
<a-tag v-else style="background: #fff; borderStyle: dashed;" @click="showInput(item,index)">
|
||||
<a-icon type="plus"/>
|
||||
新建{{item.name}}
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
<p class="btn" style="padding-top: 10px">
|
||||
<a-dropdown>
|
||||
<a-menu slot="overlay" @click="predicatesHandleMenuClick">
|
||||
<a-menu-item :key="item" v-for="item in tagArray">{{item}}</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button type="dashed" style="margin-left: 8px;width:100%"> 添加路由条件
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</p>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item prop="predicates" label="过滤器">
|
||||
<div v-for="(item,index) in router.filters">
|
||||
<a-divider>{{item.name}}
|
||||
<a-icon type="delete" size="22" @click="removeFilter(router,index)"/>
|
||||
</a-divider>
|
||||
<div v-for="(tag, index) in item.args" :key="tag.key">
|
||||
<a-input v-model="tag.key" placeholder="参数键" style="width: 45%; margin-right: 8px"/>
|
||||
<a-input v-model="tag.value" placeholder="参数值" style="width: 40%; margin-right: 8px"/>
|
||||
<a-icon class="dynamic-delete-button" type="minus-circle-o" @click="removeFilterParams(item,index)"/>
|
||||
</div>
|
||||
<a-button type="dashed" style="margin-left:28%;width: 30%" size="small" @click="addFilterParams(item)">
|
||||
<a-icon type="plus"/>
|
||||
添加参数
|
||||
</a-button>
|
||||
</div>
|
||||
<p class="btn" style="padding-top: 10px">
|
||||
<a-dropdown>
|
||||
<a-menu slot="overlay" @click="filterHandleMenuClick">
|
||||
<a-menu-item :key="item.key" :name="item.name" v-for="item in filterArray">{{item.name}}</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button type="dashed" style="margin-left: 8px;width:100%"> 添加过滤器
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</p>
|
||||
</a-form-model-item>
|
||||
<a-row :style="{textAlign:'right'}" class="drawer-bootom-button">
|
||||
<a-button :style="{marginRight: '8px'}" @click="handleCancel">
|
||||
关闭
|
||||
</a-button>
|
||||
<a-button @click="handleSubmit" type="primary">确定</a-button>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
|
||||
</a-drawer>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'GateWayRouteModal',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
layout: 'horizontal',
|
||||
labelCol: { span: 3 },
|
||||
wrapperCol: { span: 14 },
|
||||
currentNameIndex: 0,
|
||||
currentTagIndex:-1,
|
||||
predicates: {},
|
||||
filterArray: [{ key: 0, name: '熔断器' }, { key: 1, name: '限流过滤器' }],
|
||||
tagArray: ['Path', 'Host', 'Cookie', 'Header', 'Method', 'Query', 'After', 'Before', 'Between', 'RemoteAddr'],
|
||||
inputVisible: false,
|
||||
inputValue: '',
|
||||
url: {
|
||||
update: '/sys/gatewayRoute/updateAll',
|
||||
clear: '/sys/gatewayRoute/clearRedis'
|
||||
},
|
||||
router: this.getRouter(),
|
||||
title: '路由编辑',
|
||||
visible: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getRouter() {
|
||||
return {
|
||||
routerId: '',
|
||||
name: '',
|
||||
uri: '',
|
||||
predicates: [],
|
||||
filters: []
|
||||
}
|
||||
},
|
||||
show(router) {
|
||||
if (router) {
|
||||
router.status=Boolean(router.status)
|
||||
this.router = router
|
||||
} else {
|
||||
this.router = this.getRouter()
|
||||
this.inputValue=''
|
||||
}
|
||||
this.visible = true
|
||||
this.currentTagIndex=-1
|
||||
this.currentNameIndex=-1
|
||||
},
|
||||
close() {
|
||||
this.reset()
|
||||
this.$emit('close')
|
||||
this.$refs['form'].resetFields()
|
||||
this.visible = false
|
||||
},
|
||||
//删除路由条件配置项
|
||||
removeTag(item, removedTag) {
|
||||
const tags = item.args.filter(tag => tag !== removedTag)
|
||||
item.args = tags
|
||||
},
|
||||
//添加路由选项
|
||||
predicatesHandleMenuClick(e) {
|
||||
this.router.predicates.push({
|
||||
args: [],
|
||||
name: e.key
|
||||
})
|
||||
},
|
||||
editTag(tag,index){
|
||||
this.currentTagIndex=index
|
||||
},
|
||||
//显示输入框
|
||||
showInput(item, index) {
|
||||
this.inputVisible = true
|
||||
this.currentNameIndex = index
|
||||
this.$nextTick(function() {
|
||||
this.$refs.input.focus()
|
||||
})
|
||||
},
|
||||
//路由选项输入框失去焦点事件
|
||||
handleInputChange(e) {
|
||||
this.inputValue = e.target.value
|
||||
},
|
||||
//删除路由条件
|
||||
removePredicate(item, index) {
|
||||
item.predicates.splice(index, 1)
|
||||
},
|
||||
//删除过滤器参数
|
||||
removeFilterParams(item, index) {
|
||||
item.args.splice(index, 1)
|
||||
},
|
||||
//删除过滤器
|
||||
removeFilter(item, index) {
|
||||
item.filters.splice(index, 1)
|
||||
},
|
||||
//添加过滤器参数
|
||||
addFilterParams(item) {
|
||||
item.args.push({
|
||||
key: 'key' + item.args.length + 1,
|
||||
value: ''
|
||||
})
|
||||
},
|
||||
//过滤器添加事件
|
||||
filterHandleMenuClick(e) {
|
||||
if (e.key == 0) {
|
||||
this.router.filters.push({
|
||||
args: [ {
|
||||
key: 'name',
|
||||
value: 'default'
|
||||
},{
|
||||
key: 'fallbackUri',
|
||||
value: 'forward:/fallback'
|
||||
}],
|
||||
name:'Hystrix',
|
||||
title: this.filterArray[0].name
|
||||
})
|
||||
}
|
||||
if (e.key == 1) {
|
||||
this.router.filters.push({
|
||||
args: [ {
|
||||
key: 'key-resolver',
|
||||
value: '#{@ipKeyResolver}'
|
||||
}, {
|
||||
key: 'redis-rate-limiter.replenishRate',
|
||||
value: 20
|
||||
}, {
|
||||
key: 'redis-rate-limiter.burstCapacity',
|
||||
value: 20
|
||||
}],
|
||||
name:"RequestRateLimiter",
|
||||
title: this.filterArray[1].name
|
||||
})
|
||||
}
|
||||
},
|
||||
//输入框确认
|
||||
handleInputConfirm(item) {
|
||||
const inputValue = this.inputValue
|
||||
let tags = item.args
|
||||
if (inputValue && tags.indexOf(inputValue) === -1) {
|
||||
item.args = [...tags, inputValue]
|
||||
}
|
||||
console.log(tags)
|
||||
Object.assign(this, {
|
||||
tags,
|
||||
inputVisible: false,
|
||||
inputValue: ''
|
||||
})
|
||||
this.currentTagIndex=-1
|
||||
},
|
||||
//输入框确认
|
||||
handleInputEditConfirm(item,tag,index) {
|
||||
if(this.inputValue)
|
||||
{
|
||||
const inputValue = this.inputValue
|
||||
item.args[index]=inputValue
|
||||
}
|
||||
this.currentTagIndex=-1
|
||||
|
||||
},
|
||||
reset() {
|
||||
this.expandedKeysss = []
|
||||
this.checkedKeys = []
|
||||
this.defaultCheckedKeys = []
|
||||
this.loading = false
|
||||
},
|
||||
//关闭弹窗
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
//提交路由
|
||||
handleSubmit() {
|
||||
let { predicates, filters, ...other } = this.router
|
||||
let router = other
|
||||
router.predicates = JSON.stringify(this.router.predicates)
|
||||
router.filters = JSON.stringify(this.router.filters)
|
||||
postAction(this.url.update, {
|
||||
router
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.close()
|
||||
this.$emit('ok')
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.drawer-bootom-button {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
||||
@ -16,7 +16,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="职务编码">
|
||||
<a-input placeholder="请输入职务编码" v-decorator="['code', validatorRules.code]"/>
|
||||
<a-input placeholder="请输入职务编码" v-decorator="['code', validatorRules.code]" :read-only="readOnly"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
@ -110,6 +110,7 @@
|
||||
add: '/sys/position/add',
|
||||
edit: '/sys/position/edit',
|
||||
},
|
||||
readOnly:false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -122,6 +123,11 @@
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
if(record.id){
|
||||
this.readOnly=true
|
||||
}else{
|
||||
this.readOnly=false
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,
|
||||
'code',
|
||||
@ -177,4 +183,4 @@
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
|
||||
export default {
|
||||
@ -167,13 +167,16 @@
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
if("该编号已存在!" == res.message){
|
||||
this.model.id=""
|
||||
}
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
popupCallback(row){
|
||||
@ -181,4 +184,4 @@
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -269,7 +269,7 @@
|
||||
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
|
||||
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
|
||||
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
||||
syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
||||
queryTenantList: '/sys/tenant/queryList'
|
||||
},
|
||||
identity:"1",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
size="large"
|
||||
v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]"
|
||||
type="text"
|
||||
placeholder="请输入帐户名 / admin">
|
||||
placeholder="请输入帐户名 / jeecg">
|
||||
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
@ -104,13 +104,6 @@
|
||||
:disabled="loginBtn">确定
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
|
||||
<div class="user-login-other">
|
||||
<span>其他登录方式</span>
|
||||
<a @click="onThirdLogin('github')" title="github"><a-icon class="item-icon" type="github"></a-icon></a>
|
||||
<a @click="onThirdLogin('wechat_enterprise')" title="企业微信"><a-icon class="item-icon" type="wechat"></a-icon></a>
|
||||
<a @click="onThirdLogin('dingtalk')" title="钉钉"><a-icon class="item-icon" type="dingding"></a-icon></a>
|
||||
</div>
|
||||
</a-form>
|
||||
|
||||
<two-step-captcha
|
||||
@ -118,7 +111,8 @@
|
||||
:visible="stepCaptchaVisible"
|
||||
@success="stepCaptchaSuccess"
|
||||
@cancel="stepCaptchaCancel"></two-step-captcha>
|
||||
<login-select-modal ref="loginSelect" @success="loginSelectOk"></login-select-modal>
|
||||
<login-select-tenant ref="loginSelect" @success="loginSelectOk"></login-select-tenant>
|
||||
<third-login ref="thirdLogin"></third-login>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -134,12 +128,13 @@
|
||||
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
|
||||
import store from '@/store/'
|
||||
import { USER_INFO } from "@/store/mutation-types"
|
||||
import LoginSelectModal from './LoginSelectModal.vue'
|
||||
|
||||
import ThirdLogin from './third/ThirdLogin'
|
||||
import LoginSelectTenant from "./LoginSelectTenant";
|
||||
export default {
|
||||
components: {
|
||||
LoginSelectTenant,
|
||||
TwoStepCaptcha,
|
||||
LoginSelectModal
|
||||
ThirdLogin
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -171,7 +166,7 @@
|
||||
currentUsername:"",
|
||||
currdatetime:'',
|
||||
randCodeImage:'',
|
||||
requestCodeSuccess:false
|
||||
requestCodeSuccess:false,
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@ -184,34 +179,7 @@
|
||||
// update-end- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
|
||||
},
|
||||
methods: {
|
||||
...mapActions([ "Login", "Logout","PhoneLogin","ThirdLogin" ]),
|
||||
//第三方登录
|
||||
onThirdLogin(source){
|
||||
let url = window._CONFIG['domianURL']+`/thirdLogin/render/${source}`
|
||||
window.open(url, `login ${source}`, 'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
|
||||
let that = this;
|
||||
let receiveMessage = function(event){
|
||||
var origin = event.origin
|
||||
console.log("origin",origin);
|
||||
|
||||
let token = event.data
|
||||
//update-begin--Author:wangshuai Date:20200729 for:接口在签名校验失败时返回失败的标识码 #1441--------------------
|
||||
if (token === '登录失败') {
|
||||
that.$message.warning(token);
|
||||
}else{
|
||||
//update-end--Author:wangshuai Date:20200729 for:接口在签名校验失败时返回失败的标识码 #1441--------------------
|
||||
console.log("event.data",token)
|
||||
that.ThirdLogin(token).then(res=>{
|
||||
if(res.success){
|
||||
that.loginSuccess()
|
||||
}else{
|
||||
that.requestFailed(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
window.addEventListener("message", receiveMessage, false);
|
||||
},
|
||||
...mapActions(['Login', 'Logout', 'PhoneLogin']),
|
||||
// handler
|
||||
handleUsernameOrEmail (rule, value, callback) {
|
||||
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
|
||||
@ -337,9 +305,6 @@
|
||||
})
|
||||
},
|
||||
loginSuccess () {
|
||||
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
// this.loginBtn = false
|
||||
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
|
||||
console.log('登录跳转首页出错,这个错误从哪里来的')
|
||||
})
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
import store from './Login'
|
||||
|
||||
export default {
|
||||
name: 'LoginSelectModal',
|
||||
name: 'LoginSelectTenant',
|
||||
data(){
|
||||
return {
|
||||
visible: false,
|
||||
@ -29,7 +29,7 @@
|
||||
</a-col>
|
||||
<a-col :span="10" style="text-align: right">
|
||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
||||
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||
<img v-else style="margin-top: 2px;" src="../../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
||||
@ -4,7 +4,7 @@
|
||||
<a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister">
|
||||
<a-form-item
|
||||
fieldDecoratorId="username"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '用户名不能为空'}, { validator: this.checkUsername }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.checkUsername }]}">
|
||||
<a-input size="large" type="text" autocomplete="false" placeholder="请输入用户名"></a-input>
|
||||
</a-form-item>
|
||||
|
||||
@ -20,26 +20,25 @@
|
||||
</template>
|
||||
<a-form-item
|
||||
fieldDecoratorId="password"
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePasswordLevel }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePasswordLevel }]}">
|
||||
<a-input size="large" type="password" @click="handlePasswordInputClick" autocomplete="false" placeholder="至少8位密码,区分大小写"></a-input>
|
||||
</a-form-item>
|
||||
</a-popover>
|
||||
|
||||
<a-form-item
|
||||
fieldDecoratorId="password2"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '至少8位密码,区分大小写' }, { validator: this.handlePasswordCheck }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePasswordCheck }]}">
|
||||
|
||||
<a-input size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
fieldDecoratorId="email"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, type: 'email', message: '请输入正确的邮箱地址' }, { validator: this.handleEmailCheck }], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" type="text" placeholder="邮箱"></a-input>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item-->
|
||||
<!-- fieldDecoratorId="email">-->
|
||||
<!-- <a-input size="large" type="text" placeholder="邮箱"></a-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item
|
||||
fieldDecoratorId="mobile"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号' }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'], validateFirst: true}">
|
||||
<a-input size="large" placeholder="11 位手机号">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handlePhoneCheck }]}">
|
||||
<a-input size="large" placeholder="11 位手机号">
|
||||
<a-select slot="addonBefore" size="large" defaultValue="+86">
|
||||
<a-select-option value="+86">+86</a-select-option>
|
||||
<a-select-option value="+87">+87</a-select-option>
|
||||
@ -58,7 +57,7 @@
|
||||
<a-col class="gutter-row" :span="16">
|
||||
<a-form-item
|
||||
fieldDecoratorId="captcha"
|
||||
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur', validateFirst: true}">
|
||||
:fieldDecoratorOptions="{rules: [{ required: false}, { validator: this.handleCaptchaCheck }]}">
|
||||
<a-input size="large" type="text" placeholder="验证码">
|
||||
<a-icon slot="prefix" type="mail" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
@ -147,6 +146,9 @@
|
||||
},
|
||||
methods: {
|
||||
checkUsername(rule, value, callback) {
|
||||
if(!value){
|
||||
callback(new Error("请输入用户名"))
|
||||
}else{
|
||||
var params = {
|
||||
username: value,
|
||||
};
|
||||
@ -157,7 +159,8 @@
|
||||
callback("用户名已存在!")
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
handleEmailCheck(rule, value, callback) {
|
||||
var params = {
|
||||
email: value,
|
||||
@ -215,8 +218,18 @@
|
||||
}
|
||||
callback()
|
||||
},
|
||||
|
||||
handleCaptchaCheck(rule, value, callback){
|
||||
if(!value){
|
||||
callback(new Error("请输入验证码"))
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
},
|
||||
handlePhoneCheck(rule, value, callback) {
|
||||
var reg=/^1[3456789]\d{9}$/
|
||||
if(!reg.test(value)){
|
||||
callback(new Error("请输入正确手机号"))
|
||||
}else{
|
||||
var params = {
|
||||
phone: value,
|
||||
};
|
||||
@ -227,7 +240,8 @@
|
||||
callback("手机号已存在!")
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
handlePasswordInputClick() {
|
||||
if (!this.isMobile()) {
|
||||
@ -243,7 +257,6 @@
|
||||
var register = {
|
||||
username: values.username,
|
||||
password: values.password,
|
||||
email: values.email,
|
||||
phone: values.mobile,
|
||||
smscode: values.captcha
|
||||
};
|
||||
@ -0,0 +1,211 @@
|
||||
/**
|
||||
*第三方登录
|
||||
*/
|
||||
import { mapActions } from 'vuex'
|
||||
import { postAction } from '@api/manage'
|
||||
import { timeFix } from '@/utils/util'
|
||||
|
||||
export const JeecgThirdLoginMixin = {
|
||||
data() {
|
||||
return {
|
||||
//第三方登录相关信息
|
||||
thirdLoginInfo: '',
|
||||
thirdPasswordShow: false,
|
||||
thirdLoginPassword: '',
|
||||
thirdLoginUser: '',
|
||||
thirdConfirmShow: false,
|
||||
thirdCreateUserLoding: false,
|
||||
thirdLoginState: false,
|
||||
//绑定手机号弹窗
|
||||
bindingPhoneModal: false,
|
||||
thirdPhone: '',
|
||||
thirdCaptcha: '',
|
||||
//获取验证码按钮30s之内是否可点击
|
||||
thirdState: {
|
||||
time: 30,
|
||||
smsSendBtn: false
|
||||
},
|
||||
//第三方用户UUID
|
||||
thirdUserUuid: '',
|
||||
thirdType: '',
|
||||
url: {
|
||||
bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['ThirdLogin']),
|
||||
//第三方登录
|
||||
onThirdLogin(source) {
|
||||
let url = window._CONFIG['domianURL'] + `/sys/thirdLogin/render/${source}`
|
||||
window.open(url, `login ${source}`, 'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
|
||||
let that = this
|
||||
that.thirdType = source
|
||||
that.thirdLoginInfo = ''
|
||||
that.thirdLoginState = false
|
||||
let receiveMessage = function(event) {
|
||||
let token = event.data
|
||||
if (typeof token === 'string') {
|
||||
//如果是字符串类型 说明是token信息
|
||||
if (token === '登录失败') {
|
||||
that.$message.warning(token)
|
||||
} else if (token.includes('绑定手机号')) {
|
||||
that.bindingPhoneModal = true
|
||||
let strings = token.split(',')
|
||||
that.thirdUserUuid = strings[1]
|
||||
} else {
|
||||
that.doThirdLogin(token)
|
||||
}
|
||||
} else if (typeof token === 'object') {
|
||||
//对象类型 说明需要提示是否绑定现有账号
|
||||
if (token['isObj'] === true) {
|
||||
that.thirdConfirmShow = true
|
||||
that.thirdLoginInfo = { ...token }
|
||||
}
|
||||
} else {
|
||||
that.$message.warning('不识别的信息传递')
|
||||
}
|
||||
}
|
||||
window.addEventListener('message', receiveMessage, false)
|
||||
},
|
||||
// 根据token执行登录
|
||||
doThirdLogin(token) {
|
||||
if (this.thirdLoginState === false) {
|
||||
this.thirdLoginState = true
|
||||
let param={};
|
||||
param.thirdType=this.thirdType
|
||||
param.token=token
|
||||
this.ThirdLogin(param).then(res => {
|
||||
if (res.success) {
|
||||
this.loginSuccess()
|
||||
} else {
|
||||
this.requestFailed(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 绑定已有账号 需要输入密码
|
||||
thirdLoginUserBind() {
|
||||
this.thirdLoginPassword = ''
|
||||
this.thirdLoginUser = this.thirdLoginInfo.uuid
|
||||
this.thirdConfirmShow = false
|
||||
this.thirdPasswordShow = true
|
||||
},
|
||||
//创建新账号
|
||||
thirdLoginUserCreate() {
|
||||
this.thirdCreateUserLoding = true
|
||||
// 账号名后面添加两位随机数
|
||||
this.thirdLoginInfo['suffix'] = parseInt(Math.random() * 98 + 1)
|
||||
//this.thirdLoginInfo.operateCode = 123 //测试校验失败
|
||||
postAction('/sys/third/user/create', this.thirdLoginInfo).then(res => {
|
||||
if (res.success) {
|
||||
let token = res.result
|
||||
console.log('thirdCreateNewAccount', token)
|
||||
this.doThirdLogin(token)
|
||||
this.thirdConfirmShow = false
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.thirdCreateUserLoding = false
|
||||
})
|
||||
},
|
||||
// 核实密码
|
||||
thirdLoginCheckPassword() {
|
||||
//this.thirdLoginInfo.operateCode = 123 //测试校验失败
|
||||
let param = Object.assign({}, this.thirdLoginInfo, { password: this.thirdLoginPassword })
|
||||
postAction('/sys/third/user/checkPassword', param).then(res => {
|
||||
if (res.success) {
|
||||
this.thirdLoginNoPassword()
|
||||
this.doThirdLogin(res.result)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 没有密码 取消操作
|
||||
thirdLoginNoPassword() {
|
||||
this.thirdPasswordShow = false
|
||||
this.thirdLoginPassword = ''
|
||||
this.thirdLoginUser = ''
|
||||
},
|
||||
//获取第三方验证码
|
||||
getThirdCaptcha() {
|
||||
let that = this
|
||||
if (!this.thirdPhone) {
|
||||
that.cmsFailed('请输入手机号')
|
||||
} else {
|
||||
this.thirdState.smsSendBtn = true
|
||||
let interval = window.setInterval(() => {
|
||||
if (that.thirdState.time-- <= 0) {
|
||||
that.thirdState.time = 30
|
||||
that.thirdState.smsSendBtn = false
|
||||
window.clearInterval(interval)
|
||||
}
|
||||
}, 1000)
|
||||
const hide = this.$message.loading('验证码发送中..', 0)
|
||||
let smsParams = {}
|
||||
smsParams.mobile = this.thirdPhone
|
||||
smsParams.smsmode = '1'
|
||||
postAction('/sys/sms', smsParams).then(res => {
|
||||
if (!res.success) {
|
||||
setTimeout(hide, 0)
|
||||
this.cmsFailed(res.message)
|
||||
}
|
||||
setTimeout(hide, 500)
|
||||
}).catch(err => {
|
||||
setTimeout(hide, 1)
|
||||
clearInterval(interval)
|
||||
that.thirdState.time = 30
|
||||
that.thirdState.smsSendBtn = false
|
||||
this.requestFailed(err)
|
||||
})
|
||||
}
|
||||
},
|
||||
//绑定手机号点击确定按钮
|
||||
thirdHandleOk() {
|
||||
let bingingParams = {}
|
||||
bingingParams.mobile = this.thirdPhone
|
||||
bingingParams.captcha = this.thirdCaptcha
|
||||
bingingParams.thirdUserUuid = this.thirdUserUuid
|
||||
postAction(this.url.bindingThirdPhone, bingingParams).then(res => {
|
||||
if (res.success) {
|
||||
this.bindingPhoneModal = false
|
||||
this.doThirdLogin(res.result)
|
||||
} else {
|
||||
this.$message.$warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
loginSuccess () {
|
||||
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
// this.loginBtn = false
|
||||
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||
this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
|
||||
console.log('登录跳转首页出错,这个错误从哪里来的')
|
||||
})
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `${timeFix()},欢迎回来`,
|
||||
});
|
||||
},
|
||||
cmsFailed(err){
|
||||
this.$notification[ 'error' ]({
|
||||
message: "登录失败",
|
||||
description:err,
|
||||
duration: 4,
|
||||
});
|
||||
},
|
||||
requestFailed (err) {
|
||||
this.$notification[ 'error' ]({
|
||||
message: '登录失败',
|
||||
description: ((err.response || {}).data || {}).message || err.message || "请求出现错误,请稍后再试",
|
||||
duration: 4,
|
||||
});
|
||||
this.loginBtn = false;
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
109
ant-design-vue-jeecg/src/views/user/third/ThirdLogin.vue
Normal file
109
ant-design-vue-jeecg/src/views/user/third/ThirdLogin.vue
Normal file
@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="user-login-other">
|
||||
<span>其他登录方式</span>
|
||||
<a @click="onThirdLogin('github')" title="github"><a-icon class="item-icon" type="github"></a-icon></a>
|
||||
<a @click="onThirdLogin('wechat_enterprise')" title="企业微信"><a-icon class="item-icon" type="wechat"></a-icon></a>
|
||||
<a @click="onThirdLogin('dingtalk')" title="钉钉"><a-icon class="item-icon" type="dingding"></a-icon></a>
|
||||
<a @click="onThirdLogin('wechat_open')" title="微信"><a-icon class="item-icon" type="wechat"></a-icon></a>
|
||||
</div>
|
||||
<!-- 第三方登录绑定账号密码输入弹框 -->
|
||||
<a-modal title="请输入密码" :visible="thirdPasswordShow" @ok="thirdLoginCheckPassword" @cancel="thirdLoginNoPassword">
|
||||
<a-input-password placeholder="请输入密码" v-model="thirdLoginPassword" />
|
||||
</a-modal>
|
||||
|
||||
<!-- 第三方登录提示是否绑定账号弹框 -->
|
||||
<a-modal :footer="null" :closable="false" :visible="thirdConfirmShow" :class="'ant-modal-confirm'">
|
||||
<div class="ant-modal-confirm-body-wrapper">
|
||||
<div class="ant-modal-confirm-body">
|
||||
<a-icon type="question-circle" style="color:#faad14"/>
|
||||
<span class="ant-modal-confirm-title">提示</span>
|
||||
<div class="ant-modal-confirm-content">
|
||||
已有同名账号存在,请确认是否绑定该账号?
|
||||
</div>
|
||||
</div>
|
||||
<div class="ant-modal-confirm-btns">
|
||||
<a-button @click="thirdLoginUserCreate" :loading="thirdCreateUserLoding">创建新账号</a-button>
|
||||
<a-button @click="thirdLoginUserBind" type="primary">确认绑定</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<!-- 第三方登录绑定手机号 -->
|
||||
<a-modal :visible="bindingPhoneModal" :class="'ant-modal-confirm'">
|
||||
<template slot="footer">
|
||||
<a-button key="submit" type="primary" @click="thirdHandleOk">
|
||||
确定
|
||||
</a-button>
|
||||
</template>
|
||||
<div class="ant-modal-confirm-body-wrapper">
|
||||
<a-form-item>
|
||||
<span>绑定手机号</span>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-input
|
||||
size="large"
|
||||
type="text"
|
||||
placeholder="手机号"
|
||||
v-model="thirdPhone">
|
||||
<a-icon slot="prefix" type="mobile" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col class="gutter-row" :span="16">
|
||||
<a-form-item>
|
||||
<a-input
|
||||
size="large"
|
||||
type="text"
|
||||
placeholder="请输入验证码"
|
||||
v-model="thirdCaptcha">
|
||||
<a-icon slot="prefix" type="mail" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="gutter-row" :span="8">
|
||||
<a-button
|
||||
class="getCaptcha"
|
||||
tabindex="-1"
|
||||
:disabled="thirdState.smsSendBtn"
|
||||
@click.stop.prevent="getThirdCaptcha"
|
||||
v-text="!thirdState.smsSendBtn && '获取验证码' || (thirdState.time+' s')"></a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { JeecgThirdLoginMixin } from '@views/user/third/JeecgThirdLoginMixin'
|
||||
export default {
|
||||
name: 'thirdLogin',
|
||||
mixins: [JeecgThirdLoginMixin],
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.user-login-other {
|
||||
text-align: left;
|
||||
margin-top: 24px;
|
||||
line-height: 22px;
|
||||
|
||||
.item-icon {
|
||||
font-size: 24px;
|
||||
color: rgba(0, 0, 0, .2);
|
||||
margin-left: 16px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
transition: color .3s;
|
||||
|
||||
& :hover {
|
||||
color: #1890ff;
|
||||
}
|
||||
}
|
||||
.register {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user