From 1b174ef738f30bf52a46994affc2fe45bb58245b Mon Sep 17 00:00:00 2001 From: djz8236 Date: Sat, 13 May 2023 12:26:40 +0800 Subject: [PATCH] =?UTF-8?q?flowable=E9=9B=86=E6=88=90=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yxt-portal-ui/.env.development | 2 +- yxt-portal-ui/.env.production | 2 +- yxt-portal-ui/src/api/User/user.js | 0 yxt-portal-ui/src/api/permission.js | 0 .../src/api/system/dictType/dictCommon.js | 6 +- .../src/api/system/postManage/index.js | 2 +- .../src/api/system/roleAdminister/index.js | 2 +- yxt-portal-ui/src/api/user.js | 11 +- yxt-portal-ui/src/main.js | 47 +++-- yxt-portal-ui/src/permission.js | 12 +- yxt-portal-ui/src/store/modules/permission.js | 20 +-- yxt-portal-ui/src/views/flow/doneList.vue | 2 +- yxt-portal-ui/src/views/flow/todoList.vue | 162 +++++++++++------- yxt-portal-ui/vue.config.js | 2 +- 14 files changed, 139 insertions(+), 131 deletions(-) create mode 100644 yxt-portal-ui/src/api/User/user.js create mode 100644 yxt-portal-ui/src/api/permission.js diff --git a/yxt-portal-ui/.env.development b/yxt-portal-ui/.env.development index 01c78fbe..bee6aa64 100644 --- a/yxt-portal-ui/.env.development +++ b/yxt-portal-ui/.env.development @@ -5,5 +5,5 @@ ENV = 'development' VUE_APP_BASE_API = '/api' ## 配置测试和本地开发时的 接口地址 -VUE_APP_URL = "http://192.168.3.173:8112" +VUE_APP_URL = "http://127.0.0.1:8112" ##VUE_APP_URL = "http://8.130.39.13:8112" diff --git a/yxt-portal-ui/.env.production b/yxt-portal-ui/.env.production index c4d0fd79..384d0949 100644 --- a/yxt-portal-ui/.env.production +++ b/yxt-portal-ui/.env.production @@ -5,5 +5,5 @@ ENV = 'production' VUE_APP_BASE_API = '/api' ## 配置 正式接口地址 -VUE_APP_URL = "http://120.46.131.15:8111" +VUE_APP_URL = "http://jianguan.yyundong.com/" diff --git a/yxt-portal-ui/src/api/User/user.js b/yxt-portal-ui/src/api/User/user.js new file mode 100644 index 00000000..e69de29b diff --git a/yxt-portal-ui/src/api/permission.js b/yxt-portal-ui/src/api/permission.js new file mode 100644 index 00000000..e69de29b diff --git a/yxt-portal-ui/src/api/system/dictType/dictCommon.js b/yxt-portal-ui/src/api/system/dictType/dictCommon.js index 634e88af..1c759e2d 100644 --- a/yxt-portal-ui/src/api/system/dictType/dictCommon.js +++ b/yxt-portal-ui/src/api/system/dictType/dictCommon.js @@ -15,7 +15,7 @@ export function dictCommonList(data) { //保存 字典子级 export function savedictCommon(data) { return request({ - url: '/portal/v1/dictcommons/save', + url: '/portal/v1/dictcommon/save', method: 'POST', data: data , headers: {'Content-Type': 'application/json', @@ -36,7 +36,7 @@ export function getRoleInfo(data) { //根据sid 修改 数据字典 export function putdictCommon(data) { return request({ - url: '/portal/v1/dictcommons/update/' + data.sid, + url: '/portal/v1/dictcommon/update/' + data.sid, method: 'POST', data: data , headers: {'Content-Type': 'application/json', @@ -48,7 +48,7 @@ export function putdictCommon(data) { //根据sid 删除菜单 信息 export function deldictCommon(data) { return request({ - url: '/portal/v1/dictcommons/delete/' + data.sid, + url: '/portal/v1/dictcommon/delete/' + data.sid, method: 'DELETE', data: data, headers: {'Content-Type': 'application/json', diff --git a/yxt-portal-ui/src/api/system/postManage/index.js b/yxt-portal-ui/src/api/system/postManage/index.js index a7c12ba5..1935cad9 100644 --- a/yxt-portal-ui/src/api/system/postManage/index.js +++ b/yxt-portal-ui/src/api/system/postManage/index.js @@ -62,7 +62,7 @@ export function delOrgroles(data){ export function pullDown(data){ return request({ - url: '/portal/v1/dictcommons/typeValues', + url: '/portal/v1/dictcommon/typeValues', method: 'get', params: data }) diff --git a/yxt-portal-ui/src/api/system/roleAdminister/index.js b/yxt-portal-ui/src/api/system/roleAdminister/index.js index d31c6f99..c0199867 100644 --- a/yxt-portal-ui/src/api/system/roleAdminister/index.js +++ b/yxt-portal-ui/src/api/system/roleAdminister/index.js @@ -26,7 +26,7 @@ export function postList(data){ // 获取数据字典下拉列表 export function typeValues(data) { return request({ - url: '/portal/v1/dictcommons/typeValues', + url: '/portal/v1/dictcommon/typeValues', method: 'get', params: data }) diff --git a/yxt-portal-ui/src/api/user.js b/yxt-portal-ui/src/api/user.js index 535b7c5f..c9ad6e8d 100644 --- a/yxt-portal-ui/src/api/user.js +++ b/yxt-portal-ui/src/api/user.js @@ -1,12 +1,10 @@ import request from '@/utils/request' -import qs from 'qs' -//登录 export function login(data) { return request({ url: '/portal/v1/sysuser/login', method: 'post', data: data, - headers: {'Content-Type': 'application/json'} + headers: { 'Content-Type': 'application/json' } }) } // 用户注册 @@ -15,8 +13,11 @@ export function registUser(data) { url: '/system/user/save', method: 'post', data, - headers:{'Content-Type':'application/x-www-form-urlencoded;'} + headers: { 'Content-Type': 'application/x-www-form-urlencoded;' } }) +} +export function logout() { + } // 获取手机验证码 export function getVerificationCode(data) { @@ -39,7 +40,7 @@ export function imgCode() { export function getInfo(token) { return request({ url: '/system/user/loginDetails', - method: 'post', + method: 'post' }) } diff --git a/yxt-portal-ui/src/main.js b/yxt-portal-ui/src/main.js index b3d0a73d..9f9bf397 100644 --- a/yxt-portal-ui/src/main.js +++ b/yxt-portal-ui/src/main.js @@ -14,23 +14,22 @@ import store from './store' import router from './router' import '@/icons' // icon -//import '@/permission' //权限控制 Vue.prototype.$userInfo = null // 用户信息 -Vue.prototype.msgSuccess = function (msg) { - alert(msg); +Vue.prototype.msgSuccess = function(msg) { + alert(msg) } // 全局自定义组件 import Pagination from '@/components/pagination/index.vue' -Vue.component("Pagination", Pagination) +Vue.component('Pagination', Pagination) import tabsearch from '@/components/tab-search/index.vue' -Vue.component("tab-search", tabsearch) -import eimage from "@/components/E-image/index.vue" +Vue.component('tab-search', tabsearch) +import eimage from '@/components/E-image/index.vue' -Vue.component("eimage", eimage); +Vue.component('eimage', eimage) // 全局组件挂载 Vue.component('Pagination', Pagination) @@ -38,31 +37,29 @@ Vue.component('Pagination', Pagination) import Print from '@/utils/print' // 引入附件的js文件 Vue.use(Print) // 注册 -import {setStorage, getStorage} from "./utils/auth.js" - -let token = null; -token = GetQueryString("token") +// let token = null +// token = GetQueryString('token') -//if (token) { -//setStorage(token) -//let href = window.location.href; -//href = href.split(`token=${token}`)[0]; -//window.location.href = href.slice(0, href.length - 1); -//} +// if (token) { +// setStorage(token) +// let href = window.location.href; +// href = href.split(`token=${token}`)[0]; +// window.location.href = href.slice(0, href.length - 1); +// } -function GetQueryString(name) { - var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); - var r = window.location.search.substr(1).match(reg); - if (r != null) return unescape(r[2]); - return null; -} +// function GetQueryString(name) { +// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') +// var r = window.location.search.substr(1).match(reg) +// if (r != null) return unescape(r[2]) +// return null +// } import VueAMap from 'vue-amap' Vue.use(VueAMap) VueAMap.initAMapApiLoader({ - key: 'ccda12d8bffc72e9f1a32c599323a876',//此处的key,在高德开放平台申请 - plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'],//此处的插件按需添加 + key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请 + plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加 v: '1.4.4', uiVersion: '1.0' }) diff --git a/yxt-portal-ui/src/permission.js b/yxt-portal-ui/src/permission.js index 6f38310e..b3626355 100644 --- a/yxt-portal-ui/src/permission.js +++ b/yxt-portal-ui/src/permission.js @@ -7,11 +7,9 @@ import 'nprogress/nprogress.css' // progress bar style import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) // NProgress Configuration -import { getStorage } from '@/utils/auth' // get token from cookie +// get token from cookie import { getRoleRouter } from '@/router/modules/components.js' -const whiteList = ['/login', '/registUser', '/registOrg'] // no redirect whitelist - router.beforeEach(async(to, from, next) => { // start progress bar NProgress.start() @@ -20,9 +18,8 @@ router.beforeEach(async(to, from, next) => { document.title = getPageTitle(to.meta.title) // determine whether the user has logged in -//const hasToken = getStorage() +// const hasToken = getStorage() const hasToken = window.sessionStorage.getItem('token') - console.log(hasToken) if (hasToken) { const userInfo = store.getters.userInfo if (userInfo) { @@ -33,18 +30,15 @@ router.beforeEach(async(to, from, next) => { } else { console.log('无 userInfo') await store.dispatch('user/getInfo') - let userRoles = await getRoleRouter(store.getters.userInfo.userSid) - console.log("userRoles",userRoles) + const userRoles = await getRoleRouter(store.getters.userInfo.userSid) router.options.routes = userRoles router.addRoutes(userRoles) // 动态添加可访问路由表 console.log(to) next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: } } else { - console.log('222') window.location.href = process.env.VUE_APP_URL } - }) router.afterEach(() => { diff --git a/yxt-portal-ui/src/store/modules/permission.js b/yxt-portal-ui/src/store/modules/permission.js index aeb5ee53..62d00282 100644 --- a/yxt-portal-ui/src/store/modules/permission.js +++ b/yxt-portal-ui/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRoutes, constantRoutes } from '@/router' +import { constantRoutes } from '@/router' /** * Use meta.role to determine if the current user has permission @@ -46,24 +46,8 @@ const mutations = { } } -const actions = { - generateRoutes({ commit }, roles) { - return new Promise(resolve => { - let accessedRoutes - if (roles.includes('admin')) { - accessedRoutes = asyncRoutes || [] - } else { - accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) - } - commit('SET_ROUTES', accessedRoutes) - resolve(accessedRoutes) - }) - } -} - export default { namespaced: true, state, - mutations, - actions + mutations } diff --git a/yxt-portal-ui/src/views/flow/doneList.vue b/yxt-portal-ui/src/views/flow/doneList.vue index 4292669e..3068bbaf 100644 --- a/yxt-portal-ui/src/views/flow/doneList.vue +++ b/yxt-portal-ui/src/views/flow/doneList.vue @@ -273,7 +273,7 @@ import flowRecords from '@/components/flow/flowRecord' selectUrl(this.selectUrl_list).then((response) => { if (response.success && response.data.url !== '') { // this.url = 'http://127.0.0.1:9531' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list))) - this.url = 'http://anrui.yyundong.com' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list))) + this.url = "http://jianguan.yyundong.com"+ response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list))) // this.url = 'http://120.46.172.184' + response.data.url + '?token=' + getStorage() + '&data=' + encodeURI((JSON.stringify(parameter_list))) } else if (response.success && response.data.url === '') { this.$notify({ diff --git a/yxt-portal-ui/src/views/flow/todoList.vue b/yxt-portal-ui/src/views/flow/todoList.vue index 2e4c4a87..8f51842b 100644 --- a/yxt-portal-ui/src/views/flow/todoList.vue +++ b/yxt-portal-ui/src/views/flow/todoList.vue @@ -2,7 +2,7 @@
- + 关闭
@@ -10,16 +10,24 @@
待办任务列表
- +
- - + +