diff --git a/Code/Fe/src/api/wms-auth.js b/Code/Fe/src/api/wms-auth.js index 0fb286b..4b74e0b 100644 --- a/Code/Fe/src/api/wms-auth.js +++ b/Code/Fe/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/Code/Fe/src/components/tablePagination/index.vue b/Code/Fe/src/components/tablePagination/index.vue index 9e16895..a081346 100644 --- a/Code/Fe/src/components/tablePagination/index.vue +++ b/Code/Fe/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/Code/Fe/src/components/umyTable/index.vue b/Code/Fe/src/components/umyTable/index.vue index 5c494de..ab57c35 100644 --- a/Code/Fe/src/components/umyTable/index.vue +++ b/Code/Fe/src/components/umyTable/index.vue @@ -12,6 +12,7 @@ :border="tableBorder" style="width: 100%" :cell-style="cellStyle" + :cell-class-name="cellClassName" use-virtual :height="uTableHeight" header-row-class-name="uTableHeader" @@ -93,7 +94,7 @@ size="mini" > {{itemButton.label}} @@ -211,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) { @@ -316,6 +320,12 @@ export default { return Function; } }, + cellClassName: { + type: Function, + default: () => { + return Function; + } + }, // 已app-main高度为100% 需要减掉的高度 setUTableHeight: { type: Number, @@ -388,6 +398,12 @@ export default { this.setTableHeightHandle() }, methods: { + // 重新渲染表格 + doFreshLayout(){ + if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) { + this.$refs.multipleTable.doLayout() + } + }, // 设置表格高度 setTableHeightHandle(height){ let _height = height || this.setUTableHeight @@ -640,9 +656,11 @@ export default { // 转义枚举值 initApiEnumList(item,data){ let _item_enumList = {} - item.enums_list.forEach((item,key)=>{ - _item_enumList[item.value] = item.label - }) + if(item.enums_list){ + item.enums_list.forEach((item,key)=>{ + _item_enumList[item.value] = item.label + }) + } return _item_enumList[data] || '未定义' }, // 其他类型转义,直接显示 | 点击可出详情 | 点击可点出json @@ -666,24 +684,6 @@ export default { if(type == 'detail')this.showDetailInfo(row) if(type == 'json')this.showJsonTable(row) }, - // 可编辑表单:获取枚举、布尔 - getItemEnums(item){ - let _option = [] - // 布尔 - if(item.apiBaseType == 'boolean'){ - _option = [{ - value: true, - label: '是' - },{ - value: false, - label: '否' - },] - } - if(item.isEnums){ - _option = item.enums_list - } - return _option - }, // 可编辑表单:值更改函数 changeValue(prop,item,val) { this.$emit("changeValue", prop, item, val) diff --git a/Code/Fe/src/mixins/TableHeaderMixins.js b/Code/Fe/src/mixins/TableHeaderMixins.js index 041576c..f468695 100644 --- a/Code/Fe/src/mixins/TableHeaderMixins.js +++ b/Code/Fe/src/mixins/TableHeaderMixins.js @@ -50,12 +50,13 @@ export const TableHeaderMixins = { // 全部导出处理 if(type && type == 'all'){ _data.MaxResultCount = this.totalCount} this.closeExportDrop() - this.Loading.appMainLoading = true + this.Loading.tableLoading = true postExport(_params,_data, _exportUrl, _special).then(res => { this.blob(res, name)//使用前端导出名称 - this.Loading.appMainLoading = false + this.Loading.tableLoading = false }).catch(err => { - this.Loading.appMainLoading = false + this.Loading.tableLoading = false + this.$errorMsg('导出失败,请重试!') }) }, // 点击常用按钮 @@ -66,11 +67,11 @@ export const TableHeaderMixins = { this.paging() // 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获取) @@ -289,7 +290,7 @@ export const TableHeaderMixins = { * list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 detailPage_api表头来自api的明细页面列表 * list: 表头固定的列表 detail: 表头固定列表的明细 */ - rowDrop(data,type) { + rowDrop(data,type) { if(!type || type == 'list_api'){ this.apiColumns_Table = data } if(type && type == 'detail_api'){ this.apiColumns_DetailsTable = data } // if(type && type == 'detailPage_api'){ this.apiColumns_DetailsPage = data } diff --git a/Code/Fe/src/mixins/TableMixins.js b/Code/Fe/src/mixins/TableMixins.js index fa85886..1fab8af 100644 --- a/Code/Fe/src/mixins/TableMixins.js +++ b/Code/Fe/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 : [] }] }, // 主表-右侧操作列基础按钮 @@ -187,7 +191,7 @@ export const tableMixins = { "name": "CreationTime", "apiBaseType": "datetime", "baseApiName": _apiName + 'CreationTime', - "label": zhApiColumnsLable(_apiName + 'CreationTime') || _apiName + 'CreationTime', + "label": zhApiColumnsLable(_apiName + 'CreationTime') || 'CreationTime', "prop": "creationTime", } ) @@ -199,7 +203,7 @@ export const tableMixins = { "name": "CreatorId", "apiBaseType": "string", "baseApiName": _apiName + 'CreatorId', - "label": zhApiColumnsLable(_apiName + 'CreatorId') || _apiName + 'CreatorId', + "label": zhApiColumnsLable(_apiName + 'CreatorId') || 'CreatorId', "prop": "creatorId", } ) @@ -211,7 +215,7 @@ export const tableMixins = { "name": "LastModificationTime", "apiBaseType": "datetime", "baseApiName": _apiName + 'LastModificationTime', - "label": zhApiColumnsLable(_apiName + 'LastModificationTime') || _apiName + 'LastModificationTime', + "label": zhApiColumnsLable(_apiName + 'LastModificationTime') || 'LastModificationTime', "prop": "lastModificationTime", } ) @@ -223,7 +227,7 @@ export const tableMixins = { "name": "LastModifierId", "apiBaseType": "string", "baseApiName": _apiName + 'LastModifierId', - "label": zhApiColumnsLable(_apiName + 'LastModifierId') || _apiName + 'LastModifierId', + "label": zhApiColumnsLable(_apiName + 'LastModifierId') || 'LastModifierId', "prop": "lastModifierId", } ) @@ -235,7 +239,7 @@ export const tableMixins = { "name": "TenantId", "apiBaseType": "string", "baseApiName": _apiName + 'TenantId', - "label": zhApiColumnsLable(_apiName + 'TenantId') || _apiName + 'TenantId', + "label": zhApiColumnsLable(_apiName + 'TenantId') || 'TenantId', "prop": "tenantId", } ) diff --git a/Code/Fe/src/permission.js b/Code/Fe/src/permission.js index ed2865d..cd0d850 100644 --- a/Code/Fe/src/permission.js +++ b/Code/Fe/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 // } @@ -61,6 +60,16 @@ const toPageInit = async (to, from, next) => { } +// 获取数据失败处理 +const getErrHandle = (to, from, next) => { + let isAutoLogin = JSON.parse(localStorage.getItem('isConfigLogin')) || to.query.loginName + Message.error(getErrMsg) + if(!isAutoLogin){ + store.dispatch("user/logout") + } + NProgress.done() +} + // 跳转处理 const toNextHandle = async (to, from, next) => { let isFresh = false @@ -68,8 +77,7 @@ const toNextHandle = async (to, from, next) => { // 获取表头转义 if(!store.getters.columZHList){ await store.dispatch('definition/getColumZHList').catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) } @@ -80,21 +88,19 @@ const toNextHandle = async (to, from, next) => { .then(res=>{ // 没有权限(token失效处理) if(!res || res.length <=0){ - Message.error('用户无权限或者token失效,请重新登录') + Message.error('用户无权限或者token失效,请配置权限或重新登录') store.dispatch("user/logout") } }) .catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) } // 获取枚举数据 if(!store.getters.enumList || store.getters.enumList.length <= 0){ await store.dispatch('definition/getDefinitionConfig').catch(()=>{ - Message.error(getErrMsg) - NProgress.done() + getErrHandle(to, from, next) }) } @@ -142,6 +148,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 +159,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/Code/Fe/src/store/modules/permission.js b/Code/Fe/src/store/modules/permission.js index f800273..33c94e0 100644 --- a/Code/Fe/src/store/modules/permission.js +++ b/Code/Fe/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/Code/Fe/src/utils/defaultButtons.js b/Code/Fe/src/utils/defaultButtons.js index dc9a1fc..8dcf1c8 100644 --- a/Code/Fe/src/utils/defaultButtons.js +++ b/Code/Fe/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" }) @@ -122,5 +122,7 @@ function __defaultBtnOption(option,specific){ class:option && option.class ? option.class : specific.class, 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/Code/Fe/src/views/login/index.vue b/Code/Fe/src/views/login/index.vue index dbd4b97..d306364 100644 --- a/Code/Fe/src/views/login/index.vue +++ b/Code/Fe/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/Code/Fe/src/views/menuList/AbpIdentityMarkRoles.vue b/Code/Fe/src/views/menuList/AbpIdentityMarkRoles.vue index 9518f06..1cabd61 100644 --- a/Code/Fe/src/views/menuList/AbpIdentityMarkRoles.vue +++ b/Code/Fe/src/views/menuList/AbpIdentityMarkRoles.vue @@ -130,7 +130,7 @@ diff --git a/Code/Fe/src/views/menuList/AbpIdentityMarkUsers.vue b/Code/Fe/src/views/menuList/AbpIdentityMarkUsers.vue new file mode 100644 index 0000000..13869c6 --- /dev/null +++ b/Code/Fe/src/views/menuList/AbpIdentityMarkUsers.vue @@ -0,0 +1,637 @@ + + + + diff --git a/Code/Fe/src/views/menuList/ExportCustomUserSetting.vue b/Code/Fe/src/views/menuList/ExportCustomUserSetting.vue index 1ee030d..119e5be 100644 --- a/Code/Fe/src/views/menuList/ExportCustomUserSetting.vue +++ b/Code/Fe/src/views/menuList/ExportCustomUserSetting.vue @@ -1,267 +1,271 @@ - - \ No newline at end of file + } +}; + + \ No newline at end of file