From 74a1895fb26929038daa99c31dc66a8bfd2f3429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 7 Sep 2023 17:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8E=A5=E5=8F=A3=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E3=80=911=E3=80=81=E7=99=BB=E5=BD=95=E5=8F=8A=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E4=BC=98=E5=8C=96=EF=BC=8C2=E3=80=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E7=BB=B4=E6=8A=A4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91=EF=BC=8C3=E3=80=81?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=88=B0=E6=93=8D=E4=BD=9C=E5=88=97=E6=8C=89=E9=92=AE=E5=B0=81?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PC/InterFace.Dash/public/config.js | 3 - PC/InterFace.Dash/src/api/wms-auth.js | 9 +- .../src/components/tablePagination/index.vue | 3 +- .../src/components/umyTable/index.vue | 3 + .../src/mixins/TableHeaderMixins.js | 4 +- PC/InterFace.Dash/src/mixins/TableMixins.js | 10 +- PC/InterFace.Dash/src/permission.js | 19 +- .../src/store/modules/permission.js | 2 +- PC/InterFace.Dash/src/utils/defaultButtons.js | 3 +- PC/InterFace.Dash/src/views/login/index.vue | 7 +- .../views/menuList/AbpIdentityMarkRoles.vue | 4 +- .../views/menuList/AbpIdentityMarkUsers.vue | 624 +++++++++++++++++- .../menuList/ExportCustomUserSetting.vue | 52 +- 13 files changed, 692 insertions(+), 51 deletions(-) diff --git a/PC/InterFace.Dash/public/config.js b/PC/InterFace.Dash/public/config.js index 5398f1d..8cf43ae 100644 --- a/PC/InterFace.Dash/public/config.js +++ b/PC/InterFace.Dash/public/config.js @@ -1,10 +1,7 @@ // dev_win window.SITE_CONFIG['baseApi'] = 'http://dev.ccwin-in.com:60068' -// window.SITE_CONFIG['baseApi'] = 'http://192.168.0.190:60068' window.SITE_CONFIG['authApi'] = 'http://dev.ccwin-in.com:60068' -// window.SITE_CONFIG['authApi'] = 'http://192.168.0.190:60068' window.SITE_CONFIG['loginApi'] = 'http://dev.ccwin-in.com:60065' -// window.SITE_CONFIG['loginApi'] = 'http://192.168.0.190:60065' window.SITE_CONFIG['businessApi'] = 'http://dev.ccwin-in.com:10097' //是否登录配置信息【loginName】 window.SITE_CONFIG['isConfigLogin'] = false diff --git a/PC/InterFace.Dash/src/api/wms-auth.js b/PC/InterFace.Dash/src/api/wms-auth.js index 0fb286b..4b74e0b 100644 --- a/PC/InterFace.Dash/src/api/wms-auth.js +++ b/PC/InterFace.Dash/src/api/wms-auth.js @@ -195,10 +195,11 @@ export function getusersID(data) { }) } -//重置密码 -export function resetPassword(id) { +//修改登录用户的密码-强密码规则 +export function postLoginUserInfo(data, id) { return request({ - url: authApi + '/identity/users/reset-password/' + id, - method: 'post' + url: authApi + '/identity/users/change-password/' + id, + method: 'post', + data }) } \ No newline at end of file diff --git a/PC/InterFace.Dash/src/components/tablePagination/index.vue b/PC/InterFace.Dash/src/components/tablePagination/index.vue index 9e16895..a081346 100644 --- a/PC/InterFace.Dash/src/components/tablePagination/index.vue +++ b/PC/InterFace.Dash/src/components/tablePagination/index.vue @@ -307,7 +307,8 @@ export default { _list.push(item) }else{ if(this.noUsePermissionBtn.indexOf(item.name) < 0){ - item.permission = [this.$route.name+'.'+item.name] + let _scope = item.clientScope || localStorage.getItem('appClientScope') + item.permission = [_scope + '.' +this.$route.name+'.'+item.name] }else{ item.permission = [] } diff --git a/PC/InterFace.Dash/src/components/umyTable/index.vue b/PC/InterFace.Dash/src/components/umyTable/index.vue index aaad8fc..ab57c35 100644 --- a/PC/InterFace.Dash/src/components/umyTable/index.vue +++ b/PC/InterFace.Dash/src/components/umyTable/index.vue @@ -167,6 +167,7 @@ :key="indexButton" type="text" size="mini" + v-permission="itemButton.permission" :style="{color:itemButton.color || '#409EFF'}" @click="buttonOperationClick_right(scope.row, itemButton, indexButton)" >{{itemButton.label}} @@ -212,8 +213,10 @@ import { formatTimeStrToStr } from "@/utils/formatTime"; import _ from "lodash"; import { getMatchRegConformValue } from "@/utils/index" import showCopyJsonPop from "@/components/showCopyJsonPop" +import permission from "@/directive/permission/index" export default { name: "currenTable", + directives: { permission }, components:{ showCopyJsonPop }, filters: { formatDate(time) { diff --git a/PC/InterFace.Dash/src/mixins/TableHeaderMixins.js b/PC/InterFace.Dash/src/mixins/TableHeaderMixins.js index 85b2224..f468695 100644 --- a/PC/InterFace.Dash/src/mixins/TableHeaderMixins.js +++ b/PC/InterFace.Dash/src/mixins/TableHeaderMixins.js @@ -68,10 +68,10 @@ export const TableHeaderMixins = { // this.$store.dispatch("app/appMainLoading", true) } // 新增(原始前端写死配置) - else if (val == 'newly') { + else if (val == 'Create') { this.formTitle = "新增" + this.$route.meta.title; this.formReveal = true - this.theEvent = "newly" + this.theEvent = "Create" this.displayDialog.newDialog = true; } // Api新增(参数配置从api获取) diff --git a/PC/InterFace.Dash/src/mixins/TableMixins.js b/PC/InterFace.Dash/src/mixins/TableMixins.js index 32dbdd5..1fab8af 100644 --- a/PC/InterFace.Dash/src/mixins/TableMixins.js +++ b/PC/InterFace.Dash/src/mixins/TableMixins.js @@ -51,15 +51,19 @@ export const tableMixins = { }, methods: { // 主表-右侧操作列基础按钮 - buttonOperationList_rightBase(){ + buttonOperationList_rightBase(op_e,op_d){ return [{ label:'编辑', name:'edit', - color:'#ff9000' + color:'#ff9000', + hide:op_e && op_e.hide ? op_e.hide : false, + permission:op_e && op_e.permission ? op_e.permission : [] },{ label:'删除', name:'delete', - color:'red' + color:'red', + hide:op_d && op_d.hide ? op_d.hide : false, + permission:op_d && op_d.permission ? op_d.permission : [] }] }, // 主表-右侧操作列基础按钮 diff --git a/PC/InterFace.Dash/src/permission.js b/PC/InterFace.Dash/src/permission.js index ed2865d..6b26604 100644 --- a/PC/InterFace.Dash/src/permission.js +++ b/PC/InterFace.Dash/src/permission.js @@ -12,7 +12,7 @@ NProgress.configure({ }) // NProgress Configuration const whiteList = ['/login','/callback'] // no redirect whitelist -const noUserMsg = '获取用户信息失败,请重新登录 !' +const loginErr = '登录失败,请重新登录 !' const getErrMsg = '数据获取失败 !' @@ -45,10 +45,9 @@ const toPageInit = async (to, from, next) => { // toNextHandle(to, from, next) // }) // .catch(()=>{ - // // todo-fast:接口恢复后更改 - // toNextHandle(to, from, next) - // // Message.error(noUserMsg) - // // pageToLogin(to, from, next) + // // toNextHandle(to, from, next) + // Message.error(loginErr) + // pageToLogin(to, from, next) // }) // return // } @@ -80,7 +79,7 @@ const toNextHandle = async (to, from, next) => { .then(res=>{ // 没有权限(token失效处理) if(!res || res.length <=0){ - Message.error('用户无权限或者token失效,请重新登录') + Message.error('用户无权限或者token失效,请配置权限或重新登录') store.dispatch("user/logout") } }) @@ -142,6 +141,7 @@ router.beforeEach(async (to, from, next) => { } else { // 如果有单点登录方式使用下方配置 // mgr.signinRedirect(); //执行重定向 + if(isAutoLogin){ let _username = localStorage.getItem("isConfigLogin") && localStorage.getItem("isConfigLogin") != 'false' ? localStorage.getItem("configLoginName") : to.query.loginName await store.dispatch('user/login', { @@ -152,10 +152,9 @@ router.beforeEach(async (to, from, next) => { toPageInit(to, from, next) }) .catch(()=>{ - // todo-fast:接口恢复后更改 - toNextHandle(to, from, next) - // Message.error(noUserMsg) - // pageToLogin(to, from, next) + // toNextHandle(to, from, next) + Message.error(loginErr) + pageToLogin(to, from, next) }) }else{ console.log('没有token,不是登录页,不是自动登录,pageToLogin') diff --git a/PC/InterFace.Dash/src/store/modules/permission.js b/PC/InterFace.Dash/src/store/modules/permission.js index f800273..33c94e0 100644 --- a/PC/InterFace.Dash/src/store/modules/permission.js +++ b/PC/InterFace.Dash/src/store/modules/permission.js @@ -169,7 +169,7 @@ const actions = { } // 存储所有的表名 commit('SET_TABLESNAME', _menuList) - // 数据模拟,todo-new:接口获取 + // 数据模拟,todo-faster:接口获取 let _treeMenusAll = null//树形菜单 // _treeMenusAll = [ // {name:"aaaaaaa"}, diff --git a/PC/InterFace.Dash/src/utils/defaultButtons.js b/PC/InterFace.Dash/src/utils/defaultButtons.js index bbe5032..8dcf1c8 100644 --- a/PC/InterFace.Dash/src/utils/defaultButtons.js +++ b/PC/InterFace.Dash/src/utils/defaultButtons.js @@ -13,7 +13,7 @@ export function defaultAddBtn(option) { type: "primary", icon: "el-icon-plus", label: i18n.t('btns.add'), - name: "newly", + name: "Create", size: "mini", background:"#31bb99" }) @@ -123,5 +123,6 @@ function __defaultBtnOption(option,specific){ isDetailExport:option && option.isDetailExport ? option.isDetailExport : false, isRedundance:option && option.isRedundance ? option.isRedundance : false, permission:option && option.permission ? option.permission : null, + clientScope:option && option.clientScope ? option.clientScope : null, } } \ No newline at end of file diff --git a/PC/InterFace.Dash/src/views/login/index.vue b/PC/InterFace.Dash/src/views/login/index.vue index dbd4b97..d306364 100644 --- a/PC/InterFace.Dash/src/views/login/index.vue +++ b/PC/InterFace.Dash/src/views/login/index.vue @@ -38,10 +38,9 @@ { - this.$message.error('用户名或密码错误!') this.loading = false + if(!error){ + this.$message.error('用户名或密码错误!') + } }) } else { console.log('error submit!!') diff --git a/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkRoles.vue b/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkRoles.vue index 9518f06..1cabd61 100644 --- a/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkRoles.vue +++ b/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkRoles.vue @@ -130,7 +130,7 @@ diff --git a/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkUsers.vue b/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkUsers.vue index 3281d1b..13869c6 100644 --- a/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkUsers.vue +++ b/PC/InterFace.Dash/src/views/menuList/AbpIdentityMarkUsers.vue @@ -1,19 +1,637 @@ + + diff --git a/PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue b/PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue index 70b378c..119e5be 100644 --- a/PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue +++ b/PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue @@ -24,7 +24,10 @@ :primarySearchOption="primarySearchOption" @overallSearchFormClick="overallSearchFormClick" :httpOverallSearchData="httpOverallSearchData" - :buttonOperationList_right="buttonOperationList_rightBase" + :buttonOperationList_right="(row)=>{return buttonOperationList_rightBase( + {permission:['Z.ExportCustomUserSetting.Update'],hide:OperaButtonHide(row)}, + {permission:['Z.ExportCustomUserSetting.Delete'],hide:OperaButtonHide(row)} + )}" @buttonOperationClick_right="buttonOperationClick_right" >