Merge branch 'master' of https://github.com/metersphere/metersphere
This commit is contained in:
commit
561ece01e8
|
@ -7,6 +7,7 @@ import io.metersphere.base.domain.TestResource;
|
||||||
import io.metersphere.commons.utils.CompressUtils;
|
import io.metersphere.commons.utils.CompressUtils;
|
||||||
import io.metersphere.commons.utils.MybatisInterceptorConfig;
|
import io.metersphere.commons.utils.MybatisInterceptorConfig;
|
||||||
import io.metersphere.interceptor.MybatisInterceptor;
|
import io.metersphere.interceptor.MybatisInterceptor;
|
||||||
|
import io.metersphere.interceptor.UserDesensitizationInterceptor;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
@ -47,4 +48,9 @@ public class MybatisConfig {
|
||||||
interceptor.setInterceptorConfigList(configList);
|
interceptor.setInterceptorConfigList(configList);
|
||||||
return interceptor;
|
return interceptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public UserDesensitizationInterceptor userDesensitizationInterceptor() {
|
||||||
|
return new UserDesensitizationInterceptor();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package io.metersphere.interceptor;
|
||||||
|
|
||||||
|
import io.metersphere.base.domain.User;
|
||||||
|
import org.apache.ibatis.cache.CacheKey;
|
||||||
|
import org.apache.ibatis.executor.Executor;
|
||||||
|
import org.apache.ibatis.mapping.BoundSql;
|
||||||
|
import org.apache.ibatis.mapping.MappedStatement;
|
||||||
|
import org.apache.ibatis.plugin.*;
|
||||||
|
import org.apache.ibatis.session.ResultHandler;
|
||||||
|
import org.apache.ibatis.session.RowBounds;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户 password 字段脱敏
|
||||||
|
*/
|
||||||
|
@Intercepts({
|
||||||
|
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}),
|
||||||
|
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}),
|
||||||
|
})
|
||||||
|
public class UserDesensitizationInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object intercept(Invocation invocation) throws Throwable {
|
||||||
|
Object returnValue = invocation.proceed();
|
||||||
|
Object result = returnValue;
|
||||||
|
if (returnValue instanceof ArrayList<?>) {
|
||||||
|
List<Object> list = new ArrayList<>();
|
||||||
|
boolean isDecrypted = false;
|
||||||
|
for (Object val : (ArrayList<?>) returnValue) {
|
||||||
|
if (val instanceof User) {
|
||||||
|
isDecrypted = true;
|
||||||
|
((User) val).setPassword(null);
|
||||||
|
list.add(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isDecrypted) {
|
||||||
|
result = list;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (result instanceof User) {
|
||||||
|
((User) result).setPassword(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object plugin(Object target) {
|
||||||
|
return Plugin.wrap(target, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setProperties(Properties properties) {
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1 @@
|
||||||
Subproject commit cf6b06526324326a563d933e07118fac014a63b4
|
Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8
|
|
@ -5,24 +5,24 @@ export default {
|
||||||
name: "api",
|
name: "api",
|
||||||
redirect: "/api/home",
|
redirect: "/api/home",
|
||||||
components: {
|
components: {
|
||||||
content: () => import(/* webpackChunkName: "api" */ '@/business/components/api/ApiTest')
|
content: () => import('@/business/components/api/ApiTest')
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'home',
|
path: 'home',
|
||||||
name: 'fucHome',
|
name: 'fucHome',
|
||||||
component: () => import(/* webpackChunkName: "api" */ '@/business/components/api/home/ApiTestHome'),
|
component: () => import('@/business/components/api/home/ApiTestHome'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "test/:type",
|
path: "test/:type",
|
||||||
name: "ApiTestConfig",
|
name: "ApiTestConfig",
|
||||||
component: () => import(/* webpackChunkName: "api" */ '@/business/components/api/test/ApiTestConfig'),
|
component: () => import('@/business/components/api/test/ApiTestConfig'),
|
||||||
props: (route) => ({id: route.query.id})
|
props: (route) => ({id: route.query.id})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "test/list/:projectId",
|
path: "test/list/:projectId",
|
||||||
name: "ApiTestList",
|
name: "ApiTestList",
|
||||||
component: () => import(/* webpackChunkName: "api" */ '@/business/components/api/test/ApiTestList'),
|
component: () => import('@/business/components/api/test/ApiTestList'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "project/:type",
|
path: "project/:type",
|
||||||
|
@ -32,12 +32,12 @@ export default {
|
||||||
{
|
{
|
||||||
path: "report/list/:testId",
|
path: "report/list/:testId",
|
||||||
name: "ApiReportList",
|
name: "ApiReportList",
|
||||||
component: () => import(/* webpackChunkName: "api" */ '@/business/components/api/report/ApiReportList'),
|
component: () => import('@/business/components/api/report/ApiReportList'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "report/view/:reportId",
|
path: "report/view/:reportId",
|
||||||
name: "ApiReportView",
|
name: "ApiReportView",
|
||||||
component: () => import(/* webpackChunkName: "api" */ '@/business/components/api/report/ApiReportView'),
|
component: () => import('@/business/components/api/report/ApiReportView'),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import MsProject from "@/business/components/project/MsProject";
|
import MsProject from "@/business/components/project/MsProject";
|
||||||
|
|
||||||
const PerformanceTest = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/PerformanceTest')
|
const PerformanceTest = () => import('@/business/components/performance/PerformanceTest')
|
||||||
const PerformanceTestHome = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/home/PerformanceTestHome')
|
const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome')
|
||||||
const EditPerformanceTestPlan = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/test/EditPerformanceTestPlan')
|
const EditPerformanceTestPlan = () => import('@/business/components/performance/test/EditPerformanceTestPlan')
|
||||||
const PerformanceTestPlan = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/test/PerformanceTestPlan')
|
const PerformanceTestPlan = () => import('@/business/components/performance/test/PerformanceTestPlan')
|
||||||
const PerformanceTestReport = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/report/PerformanceTestReport')
|
const PerformanceTestReport = () => import('@/business/components/performance/report/PerformanceTestReport')
|
||||||
const PerformanceChart = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/report/components/PerformanceChart')
|
const PerformanceChart = () => import('@/business/components/performance/report/components/PerformanceChart')
|
||||||
const PerformanceReportView = () => import(/* webpackChunkName: "performance" */ '@/business/components/performance/report/PerformanceReportView')
|
const PerformanceReportView = () => import('@/business/components/performance/report/PerformanceReportView')
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/performance",
|
path: "/performance",
|
||||||
|
|
|
@ -4,69 +4,69 @@ export default {
|
||||||
path: "/setting",
|
path: "/setting",
|
||||||
name: "Setting",
|
name: "Setting",
|
||||||
components: {
|
components: {
|
||||||
content: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/Setting')
|
content: () => import('@/business/components/settings/Setting')
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'user',
|
path: 'user',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/system/User'),
|
component: () => import('@/business/components/settings/system/User'),
|
||||||
meta: {system: true, title: 'commons.user'}
|
meta: {system: true, title: 'commons.user'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'organization',
|
path: 'organization',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/system/Organization'),
|
component: () => import('@/business/components/settings/system/Organization'),
|
||||||
meta: {system: true, title: 'commons.organization'}
|
meta: {system: true, title: 'commons.organization'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'systemworkspace',
|
path: 'systemworkspace',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/system/SystemWorkspace'),
|
component: () => import('@/business/components/settings/system/SystemWorkspace'),
|
||||||
meta: {system: true, title: 'commons.workspace'}
|
meta: {system: true, title: 'commons.workspace'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'testresourcepool',
|
path: 'testresourcepool',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/system/TestResourcePool'),
|
component: () => import('@/business/components/settings/system/TestResourcePool'),
|
||||||
meta: {system: true, title: 'commons.test_resource_pool'}
|
meta: {system: true, title: 'commons.test_resource_pool'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'systemparametersetting',
|
path: 'systemparametersetting',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/system/SystemParameterSetting'),
|
component: () => import('@/business/components/settings/system/SystemParameterSetting'),
|
||||||
meta: {system: true, title: 'commons.system_parameter_setting'}
|
meta: {system: true, title: 'commons.system_parameter_setting'}
|
||||||
},
|
},
|
||||||
...requireContext.keys().map(key => requireContext(key).system),...requireContext.keys().map(key => requireContext(key).license),
|
...requireContext.keys().map(key => requireContext(key).system),...requireContext.keys().map(key => requireContext(key).license),
|
||||||
{
|
{
|
||||||
path: 'organizationmember',
|
path: 'organizationmember',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/organization/OrganizationMember'),
|
component: () => import('@/business/components/settings/organization/OrganizationMember'),
|
||||||
meta: {organization: true, title: 'commons.member'}
|
meta: {organization: true, title: 'commons.member'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'organizationworkspace',
|
path: 'organizationworkspace',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/organization/OrganizationWorkspace'),
|
component: () => import('@/business/components/settings/organization/OrganizationWorkspace'),
|
||||||
meta: {organization: true, title: 'commons.workspace'}
|
meta: {organization: true, title: 'commons.workspace'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'serviceintegration',
|
path: 'serviceintegration',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/organization/ServiceIntegration'),
|
component: () => import('@/business/components/settings/organization/ServiceIntegration'),
|
||||||
meta: {organization: true, title: 'organization.service_integration'}
|
meta: {organization: true, title: 'organization.service_integration'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'member',
|
path: 'member',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/workspace/WorkspaceMember'),
|
component: () => import('@/business/components/settings/workspace/WorkspaceMember'),
|
||||||
meta: {workspace: true, title: 'commons.member'}
|
meta: {workspace: true, title: 'commons.member'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'testcase/report/template',
|
path: 'testcase/report/template',
|
||||||
name: 'testCaseReportTemplate',
|
name: 'testCaseReportTemplate',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/workspace/TestCaseReportTemplate'),
|
component: () => import('@/business/components/settings/workspace/TestCaseReportTemplate'),
|
||||||
meta: {workspace: true, title: 'test_track.plan_view.report_template'}
|
meta: {workspace: true, title: 'test_track.plan_view.report_template'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'personsetting',
|
path: 'personsetting',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/personal/PersonSetting'),
|
component: () => import('@/business/components/settings/personal/PersonSetting'),
|
||||||
meta: {person: true, title: 'commons.personal_setting'}
|
meta: {person: true, title: 'commons.personal_setting'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'apikeys',
|
path: 'apikeys',
|
||||||
component: () => import(/* webpackChunkName: "setting" */ '@/business/components/settings/personal/ApiKeys'),
|
component: () => import('@/business/components/settings/personal/ApiKeys'),
|
||||||
meta: {
|
meta: {
|
||||||
person: true,
|
person: true,
|
||||||
title: 'commons.api_keys',
|
title: 'commons.api_keys',
|
||||||
|
|
|
@ -437,14 +437,10 @@
|
||||||
},
|
},
|
||||||
handleSelectAll(selection) {
|
handleSelectAll(selection) {
|
||||||
if (selection.length > 0) {
|
if (selection.length > 0) {
|
||||||
if (selection.length === 1) {
|
this.tableData.forEach(item => {
|
||||||
this.selectRows.add(selection[0]);
|
this.$set(item, "showMore", true);
|
||||||
} else {
|
this.selectRows.add(item);
|
||||||
this.tableData.forEach(item => {
|
});
|
||||||
this.$set(item, "showMore", true);
|
|
||||||
this.selectRows.add(item);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.tableData.forEach(row => {
|
this.tableData.forEach(row => {
|
||||||
|
@ -460,17 +456,6 @@
|
||||||
this.$set(row, "showMore", true);
|
this.$set(row, "showMore", true);
|
||||||
this.selectRows.add(row);
|
this.selectRows.add(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
let arr = Array.from(this.selectRows);
|
|
||||||
|
|
||||||
// 选中1个以上的用例时显示更多操作
|
|
||||||
if (this.selectRows.size === 1) {
|
|
||||||
this.$set(arr[0], "showMore", false);
|
|
||||||
} else if (this.selectRows.size === 2) {
|
|
||||||
arr.forEach(row => {
|
|
||||||
this.$set(row, "showMore", true);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleBatch(type) {
|
handleBatch(type) {
|
||||||
if (this.selectRows.size < 1) {
|
if (this.selectRows.size < 1) {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import MsProject from "@/business/components/project/MsProject";
|
import MsProject from "@/business/components/project/MsProject";
|
||||||
|
|
||||||
const TestTrack = () => import(/* webpackChunkName: "track" */ '@/business/components/track/TestTrack')
|
const TestTrack = () => import('@/business/components/track/TestTrack')
|
||||||
const TrackHome = () => import(/* webpackChunkName: "track" */ '@/business/components/track/home/TrackHome')
|
const TrackHome = () => import('@/business/components/track/home/TrackHome')
|
||||||
const TestCase = () => import(/* webpackChunkName: "track" */ '@/business/components/track/case/TestCase')
|
const TestCase = () => import('@/business/components/track/case/TestCase')
|
||||||
const TestPlan = () => import(/* webpackChunkName: "track" */ '@/business/components/track/plan/TestPlan')
|
const TestPlan = () => import('@/business/components/track/plan/TestPlan')
|
||||||
const TestCaseReview = () => import(/* webpackChunkName: "track" */ '@/business/components/track/review/TestCaseReview')
|
const TestCaseReview = () => import('@/business/components/track/review/TestCaseReview')
|
||||||
const TestCaseReviewView = () => import(/* webpackChunkName: "track" */ '@/business/components/track/review/view/TestCaseReviewView')
|
const TestCaseReviewView = () => import('@/business/components/track/review/view/TestCaseReviewView')
|
||||||
const TestPlanView = () => import(/* webpackChunkName: "track" */ '@/business/components/track/plan/view/TestPlanView')
|
const TestPlanView = () => import('@/business/components/track/plan/view/TestPlanView')
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/track",
|
path: "/track",
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
function resolve(dir) {
|
||||||
|
return path.join(__dirname, dir)
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
productionSourceMap: true,
|
productionSourceMap: true,
|
||||||
configureWebpack: {
|
|
||||||
devtool: 'source-map'
|
|
||||||
},
|
|
||||||
devServer: {
|
devServer: {
|
||||||
port: 8080,
|
port: 8080,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
@ -23,5 +26,16 @@ module.exports = {
|
||||||
template: "src/login/login.html",
|
template: "src/login/login.html",
|
||||||
filename: "login.html"
|
filename: "login.html"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
configureWebpack: {
|
||||||
|
devtool: 'source-map',
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': resolve('src')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
chainWebpack(config) {
|
||||||
|
config.plugins.delete('prefetch')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue