| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :page.sync="page" |
| | | :before-open="beforeOpen" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listLogOperate } from "@/api/logs"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | selectionList: [], |
| | | query: {}, |
| | | //æ¯å¦æ¯ä¸å管çåæ¥å¿ |
| | | isAdmin: '', |
| | | // LoginOrLogout:ç»å½æ¥å¿,grant:æææ¥å¿,operate:æä½æ¥å¿ |
| | | logType: '', |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | delBtn: false, |
| | | menuWidth: 120, |
| | | dialogType: 'drawer', |
| | | column: [ |
| | | { |
| | | label: "ç¨æ·å", |
| | | prop: "userName", |
| | | search: true, |
| | | width:'100' |
| | | }, |
| | | { |
| | | label: "å§å", |
| | | prop: "realName", |
| | | search: true, |
| | | width:'100' |
| | | }, |
| | | { |
| | | label: "ç¨æ·ip", |
| | | prop: "ip", |
| | | width:'100' |
| | | }, |
| | | { |
| | | label: "模å", |
| | | prop: "model", |
| | | width:'140' |
| | | }, |
| | | { |
| | | label: "æ¶é´", |
| | | prop: "time", |
| | | width:'160' |
| | | }, |
| | | { |
| | | label: "æä½ç»æ", |
| | | prop: "operateResult", |
| | | width:'100' |
| | | }, |
| | | { |
| | | label: "æè¿°", |
| | | prop: "description", |
| | | width:'300' |
| | | }, |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | viewBtn: this.vaildData(this.permission.log_usual.log_usual_view, false) |
| | | }; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getRouteParam() |
| | | }, |
| | | methods: { |
| | | //è·åæ°æ® |
| | | getRouteParam() { |
| | | const logType = this.$route.query.log_type; // è·ålog_typeåæ°çå¼ |
| | | const result = logType.substring(0, logType.indexOf(':')); // æªåä»0å°@ä¹é´çåå符串 |
| | | const isAdmin = logType.substring(logType.indexOf(':')+1, logType.indexOf('@')); // ä»@ä¹åæªåå°æ«å°¾çåå符串 |
| | | this.logType = result; |
| | | this.isAdmin = isAdmin; |
| | | //console.log(this.logType) |
| | | //console.log(this.isAdmin) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | underscoreName(key) { |
| | | return key.replace(/([A-Z])/g, "_$1").toLowerCase(); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getUsualLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[is_admin]"] = this.isAdmin; |
| | | conditionMaps["conditionMap[log_type]"] = this.logType.trim(); |
| | | if (params) { |
| | | Object.keys(params).forEach((key) => { |
| | | conditionMaps["conditionMap[" + this.underscoreName(key) + "_like]"] = params[key].trim(); |
| | | }); |
| | | } |
| | | this.loading = true; |
| | | listLogOperate( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | conditionMaps |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | |
| | | import com.vci.ubcs.common.cache.CacheNames; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.log.annotation.LoginOrLogoutLog; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | // è·åç§æ·ID |
| | | String headerTenant = request.getHeader(TokenUtil.TENANT_HEADER_KEY); |
| | | String paramTenant = request.getParameter(TokenUtil.TENANT_PARAM_KEY); |
| | | String refreshToken = request.getParameter(TokenConstant.REFRESH_TOKEN); |
| | | String password = request.getParameter(TokenUtil.PASSWORD_KEY); |
| | | String grantType = request.getParameter(TokenUtil.GRANT_TYPE_KEY); |
| | | // å¤æç§æ·è¯·æ±å¤´ |
| | |
| | | |
| | | //è¶
级管çåé
ç½®æä»¶é
置账å·å¯ç ï¼å®ç°ç»å½, é»è®¤ç§æ·idåè¶
管为é
ç½®åºæ¥ç |
| | | if(tenantId.equals(this.tenantId) && userName.equals(username)){ |
| | | if (!this.userName.equals(username) || !BladePasswordEncoderFactories.createDelegatingPasswordEncoder().encode(password).equalsIgnoreCase(AuthConstant.ENCRYPT+this.password)) { |
| | | if (Func.isBlank(refreshToken)/*å·æ°tokenä¸ç¨æ ¡éªå¯ç */ |
| | | && (!this.userName.equals(username) || !BladePasswordEncoderFactories.createDelegatingPasswordEncoder().encode(password).equalsIgnoreCase(AuthConstant.ENCRYPT+this.password)) |
| | | ) { |
| | | setFailCount(tenantId, username, count,strategy.getLockingTime()); |
| | | throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"è¿æã"+(failCount-count)+"ãæ¬¡å°è¯æºä¼!"); |
| | | } |