百度360必应搜狗淘宝本站头条
当前位置:网站首页 > IT知识 > 正文

MyBatisPlus又在搞事了!一个依赖轻松搞定权限问题!堪称神器

liuian 2025-04-07 15:53 83 浏览

前言:

今天介绍一个 MyBatis - Plus 官方发布的神器:mybatis-mate 为 mp 企业级模块,支持分库分表,数据审计、数据敏感词过滤(AC算法),字段加密,字典回写(数据绑定),数据权限,表结构自动生成 SQL 维护等,旨在更敏捷优雅处理数据。

1. 主要功能

字典绑定

字段加密

数据脱敏

表结构动态维护

数据审计记录

数据范围(数据权限)

数据库分库分表、动态数据源、读写分离、数- - 据库健康检查自动切换。

2.使用

2.1 依赖导入

Spring Boot 引入自动依赖注解包



  com.baomidou
  mybatis-mate-starter
  1.0.8

注解(实体分包使用)


  com.baomidou
  mybatis-mate-annotation
  1.0.8


2.2 字段数据绑定(字典回写)

例如 user_sex 类型 sex 字典结果映射到 sexText 属性


@FieldDict(type = "user_sex", target = "sexText")
private Integer sex;
private String sexText;

实现 IDataDict 接口提供字典数据源,注入到 Spring 容器即可。


@Component
public class DataDict implements IDataDict {

    /**
     * 从数据库或缓存中获取
     */
    private Map SEX_MAP = new ConcurrentHashMap() {{
        put("0", "女");
        put("1", "男");
    }};

    @Override
    public String getNameByCode(FieldDict fieldDict, String code) {
        System.err.println("字段类型:" + fieldDict.type() + ",编码:" + code);
        return SEX_MAP.get(code);
    }
}

2.3 字段加密

属性 @FieldEncrypt 注解即可加密存储,会自动解密查询结果,支持全局配置加密密钥算法,及注解密钥算法,可以实现 IEncryptor 注入自定义算法。

@FieldEncrypt(algorithm = Algorithm.PBEWithMD5AndDES)
private String password;

2.4 字段脱敏

属性 @FieldSensitive 注解即可自动按照预设策略对源数据进行脱敏处理,默认 SensitiveType 内置 9 种常用脱敏策略。

例如:中文名、银行卡账号、手机号码等 脱敏策略。也可以自定义策略如下:


@FieldSensitive(type = "testStrategy")
private String username;

@FieldSensitive(type = SensitiveType.mobile)
private String mobile;

自定义脱敏策略 testStrategy 添加到默认策略中注入 Spring 容器即可。


@Configuration
public class SensitiveStrategyConfig {

    /**
     * 注入脱敏策略
     */
    @Bean
    public ISensitiveStrategy sensitiveStrategy() {
        // 自定义 testStrategy 类型脱敏处理
        return new SensitiveStrategy().addStrategy("testStrategy", t -> t + "***test***");
    }
}

例如:文章敏感词过滤


/**
 * 演示文章敏感词过滤
 */
@RestController
public class ArticleController {
    @Autowired
    private SensitiveWordsMapper sensitiveWordsMapper;

    // 测试访问下面地址观察请求地址、界面返回数据及控制台( 普通参数 )
    // 无敏感词 http://localhost:8080/info?content=tom&see=1&age=18
    // 英文敏感词 http://localhost:8080/info?content=my%20content%20is%20tomcat&see=1&age=18
    // 汉字敏感词 http://localhost:8080/info?content=%E7%8E%8B%E5%AE%89%E7%9F%B3%E5%94%90%E5%AE%8B%E5%85%AB%E5%A4%A7%E5%AE%B6&see=1
    // 多个敏感词 http://localhost:8080/info?content=%E7%8E%8B%E5%AE%89%E7%9F%B3%E6%9C%89%E4%B8%80%E5%8F%AA%E7%8C%ABtomcat%E6%B1%A4%E5%A7%86%E5%87%AF%E7%89%B9&see=1&size=6
    // 插入一个字变成非敏感词 http://localhost:8080/info?content=%E7%8E%8B%E7%8C%AB%E5%AE%89%E7%9F%B3%E6%9C%89%E4%B8%80%E5%8F%AA%E7%8C%ABtomcat%E6%B1%A4%E5%A7%86%E5%87%AF%E7%89%B9&see=1&size=6
    @GetMapping("/info")
    public String info(Article article) throws Exception {
        return ParamsConfig.toJson(article);
    }


    // 添加一个敏感词然后再去观察是否生效 http://localhost:8080/add
    // 观察【猫】这个词被过滤了 http://localhost:8080/info?content=%E7%8E%8B%E5%AE%89%E7%9F%B3%E6%9C%89%E4%B8%80%E5%8F%AA%E7%8C%ABtomcat%E6%B1%A4%E5%A7%86%E5%87%AF%E7%89%B9&see=1&size=6
    // 嵌套敏感词处理 http://localhost:8080/info?content=%E7%8E%8B%E7%8C%AB%E5%AE%89%E7%9F%B3%E6%9C%89%E4%B8%80%E5%8F%AA%E7%8C%ABtomcat%E6%B1%A4%E5%A7%86%E5%87%AF%E7%89%B9&see=1&size=6
    // 多层嵌套敏感词 http://localhost:8080/info?content=%E7%8E%8B%E7%8E%8B%E7%8C%AB%E5%AE%89%E7%9F%B3%E5%AE%89%E7%9F%B3%E6%9C%89%E4%B8%80%E5%8F%AA%E7%8C%ABtomcat%E6%B1%A4%E5%A7%86%E5%87%AF%E7%89%B9&see=1&size=6
    @GetMapping("/add")
    public String add() throws Exception {
        Long id = 3L;
        if (null == sensitiveWordsMapper.selectById(id)) {
            System.err.println("插入一个敏感词:" + sensitiveWordsMapper.insert(new SensitiveWords(id, "猫")));
            // 插入一个敏感词,刷新算法引擎敏感词
            SensitiveWordsProcessor.reloadSensitiveWords();
        }
        return "ok";
    }

    // 测试访问下面地址观察控制台( 请求json参数 )
    // idea 执行 resources 目录 TestJson.http 文件测试
    @PostMapping("/json")
    public String json(@RequestBody Article article) throws Exception {
        return ParamsConfig.toJson(article);
    }
}

2.5 DDL 数据结构自动维护

解决升级表结构初始化,版本发布更新 SQL 维护问题,目前支持 MySql、PostgreSQL。

@Component
public class PostgresDdl implements IDdl {

    /**
     * 执行 SQL 脚本方式
     */
    @Override
    public List getSqlFiles() {
        return Arrays.asList(
                // 内置包方式
                "db/tag-schema.sql",
                // 文件绝对路径方式
                "D:\\db\\tag-data.sql"
        );
    }
}

不仅仅可以固定执行,也可以动态执行!!



ddlScript.run(new StringReader("DELETE FROM user;\n" +
                "INSERT INTO user (id, username, password, sex, email) VALUES\n" +
                "(20, 'Duo', '123456', 0, 'Duo@baomidou.com');"));

它还支持多种数据源执行!!!


@Component
public class MysqlDdl implements IDdl {

    @Override
    public void sharding(Consumer consumer) {
        // 多数据源指定,主库初始化从库自动同步
        String group = "mysql";
        ShardingGroupProperty sgp = ShardingKey.getDbGroupProperty(group);
        if (null != sgp) {
            // 主库
            sgp.getMasterKeys().forEach(key -> {
                ShardingKey.change(group + key);
                consumer.accept(this);
            });
            // 从库
            sgp.getSlaveKeys().forEach(key -> {
                ShardingKey.change(group + key);
                consumer.accept(this);
            });
        }
    }

    /**
     * 执行 SQL 脚本方式
     */
    @Override
    public List getSqlFiles() {
        return Arrays.asList("db/user-mysql.sql");
    }
}

2.6 动态多数据源主从自由切换

@Sharding 注解使数据源不限制随意使用切换,你可以在 mapper 层添加注解,按需求指哪打哪!!



@Mapper
@Sharding("mysql")
public interface UserMapper extends BaseMapper {

    @Sharding("postgres")
    Long selectByUsername(String username);
}

你也可以自定义策略统一调兵遣将

@Component
public class MyShardingStrategy extends RandomShardingStrategy {

    /**
     * 决定切换数据源 key {@link ShardingDatasource}
     *
     * @param group 动态数据库组
     * @param invocation {@link Invocation}
     * @param sqlCommandType {@link SqlCommandType}
     */
    @Override
    public void determineDatasourceKey(String group, Invocation invocation, SqlCommandType sqlCommandType) {
        // 数据源组 group 自定义选择即可, keys 为数据源组内主从多节点,可随机选择或者自己控制
        this.changeDatabaseKey(group, sqlCommandType, keys -> chooseKey(keys, invocation));
    }
}

可以开启主从策略,当然也是可以开启健康检查!具体配置:

mybatis-mate:
  sharding:
    health: true # 健康检测
    primary: mysql # 默认选择数据源
    datasource:
      mysql: # 数据库组
        - key: node1
          ...
        - key: node2
          cluster: slave # 从库读写分离时候负责 sql 查询操作,主库 master 默认可以不写
          ...
      postgres:
        - key: node1 # 数据节点
          ...

2.7 分布式事务日志打印

部分配置如下:



/**
* 

* 性能分析拦截器,用于输出每条 SQL 语句及其执行时间 *

*/ @Slf4j @Component @Intercepts({@Signature(type = StatementHandler.class, method = "query", args = {Statement.class, ResultHandler.class}), @Signature(type = StatementHandler.class, method = "update", args = {Statement.class}), @Signature(type = StatementHandler.class, method = "batch", args = {Statement.class})}) public class PerformanceInterceptor implements Interceptor { /** * SQL 执行最大时长,超过自动停止运行,有助于发现问题。 */ private long maxTime = 0; /** * SQL 是否格式化 */ private boolean format = false; /** * 是否写入日志文件
* true 写入日志文件,不阻断程序执行!
* 超过设定的最大执行时长异常提示! */ private boolean writeInLog = false; @Override public Object intercept(Invocation invocation) throws Throwable { Statement statement; Object firstArg = invocation.getArgs()[0]; if (Proxy.isProxyClass(firstArg.getClass())) { statement = (Statement) SystemMetaObject.forObject(firstArg).getValue("h.statement"); } else { statement = (Statement) firstArg; } MetaObject stmtMetaObj = SystemMetaObject.forObject(statement); try { statement = (Statement) stmtMetaObj.getValue("stmt.statement"); } catch (Exception e) { // do nothing } if (stmtMetaObj.hasGetter("delegate")) {//Hikari try { statement = (Statement) stmtMetaObj.getValue("delegate"); } catch (Exception e) { } } String originalSql = null; if (originalSql == null) { originalSql = statement.toString(); } originalSql = originalSql.replaceAll("[\\s]+", " "); int index = indexOfSqlStart(originalSql); if (index > 0) { originalSql = originalSql.substring(index); } // 计算执行 SQL 耗时 long start = SystemClock.now(); Object result = invocation.proceed(); long timing = SystemClock.now() - start; // 格式化 SQL 打印执行结果 Object target = PluginUtils.realTarget(invocation.getTarget()); MetaObject metaObject = SystemMetaObject.forObject(target); MappedStatement ms = (MappedStatement) metaObject.getValue("delegate.mappedStatement"); StringBuilder formatSql = new StringBuilder(); formatSql.append(" Time:").append(timing); formatSql.append(" ms - ID:").append(ms.getId()); formatSql.append("\n Execute SQL:").append(sqlFormat(originalSql, format)).append("\n"); if (this.isWriteInLog()) { if (this.getMaxTime() >= 1 && timing > this.getMaxTime()) { log.error(formatSql.toString()); } else { log.debug(formatSql.toString()); } } else { System.err.println(formatSql); if (this.getMaxTime() >= 1 && timing > this.getMaxTime()) { throw new RuntimeException(" The SQL execution time is too large, please optimize ! "); } } return result; } @Override public Object plugin(Object target) { if (target instanceof StatementHandler) { return Plugin.wrap(target, this); } return target; } @Override public void setProperties(Properties prop) { String maxTime = prop.getProperty("maxTime"); String format = prop.getProperty("format"); if (StringUtils.isNotEmpty(maxTime)) { this.maxTime = Long.parseLong(maxTime); } if (StringUtils.isNotEmpty(format)) { this.format = Boolean.valueOf(format); } } public long getMaxTime() { return maxTime; } public PerformanceInterceptor setMaxTime(long maxTime) { this.maxTime = maxTime; return this; } public boolean isFormat() { return format; } public PerformanceInterceptor setFormat(boolean format) { this.format = format; return this; } public boolean isWriteInLog() { return writeInLog; } public PerformanceInterceptor setWriteInLog(boolean writeInLog) { this.writeInLog = writeInLog; return this; } public Method getMethodRegular(Class clazz, String methodName) { if (Object.class.equals(clazz)) { return null; } for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(methodName)) { return method; } } return getMethodRegular(clazz.getSuperclass(), methodName); } /** * 获取sql语句开头部分 * * @param sql * @return */ private int indexOfSqlStart(String sql) { String upperCaseSql = sql.toUpperCase(); Set set = new HashSet<>(); set.add(upperCaseSql.indexOf("SELECT ")); set.add(upperCaseSql.indexOf("UPDATE ")); set.add(upperCaseSql.indexOf("INSERT ")); set.add(upperCaseSql.indexOf("DELETE ")); set.remove(-1); if (CollectionUtils.isEmpty(set)) { return -1; } List list = new ArrayList<>(set); Collections.sort(list, Integer::compareTo); return list.get(0); } private final static SqlFormatter sqlFormatter = new SqlFormatter(); /** * 格式sql * * @param boundSql * @param format * @return */ public static String sqlFormat(String boundSql, boolean format) { if (format) { try { return sqlFormatter.format(boundSql); } catch (Exception ignored) { } } return boundSql; } }

使用:



@RestController
@AllArgsConstructor
public class TestController {
    private BuyService buyService;

    // 数据库 test 表 t_order 在事务一致情况无法插入数据,能够插入说明多数据源事务无效
    // 测试访问 http://localhost:8080/test
    // 制造事务回滚 http://localhost:8080/test?error=true 也可通过修改表结构制造错误
    // 注释 ShardingConfig 注入 dataSourceProvider 可测试事务无效情况
    @GetMapping("/test")
    public String test(Boolean error) {
        return buyService.buy(null != error && error);
    }
}

2.8 数据权限

mapper 层添加注解:



// 测试 test 类型数据权限范围,混合分页模式
@DataScope(type = "test", value = {
        // 关联表 user 别名 u 指定部门字段权限
        @DataColumn(alias = "u", name = "department_id"),
        // 关联表 user 别名 u 指定手机号字段(自己判断处理)
        @DataColumn(alias = "u", name = "mobile")
})
@Select("select u.* from user u")
List selectTestList(IPage page, Long id, @Param("name") String username);

模拟业务处理逻辑:


@Bean
public IDataScopeProvider dataScopeProvider() {
    return new AbstractDataScopeProvider() {
        @Override
        protected void setWhere(PlainSelect plainSelect, Object[] args, DataScopeProperty dataScopeProperty) {
            // args 中包含 mapper 方法的请求参数,需要使用可以自行获取
            /*
                // 测试数据权限,最终执行 SQL 语句
                SELECT u.* FROM user u WHERE (u.department_id IN ('1', '2', '3', '5'))
                AND u.mobile LIKE '%1533%'
             */
            if ("test".equals(dataScopeProperty.getType())) {
                // 业务 test 类型
                List dataColumns = dataScopeProperty.getColumns();
                for (DataColumnProperty dataColumn : dataColumns) {
                    if ("department_id".equals(dataColumn.getName())) {
                        // 追加部门字段 IN 条件,也可以是 SQL 语句
                        Set deptIds = new HashSet<>();
                        deptIds.add("1");
                        deptIds.add("2");
                        deptIds.add("3");
                        deptIds.add("5");
                        ItemsList itemsList = new ExpressionList(deptIds.stream().map(StringValue::new).collect(Collectors.toList()));
                        InExpression inExpression = new InExpression(new Column(dataColumn.getAliasDotName()), itemsList);
                        if (null == plainSelect.getWhere()) {
                            // 不存在 where 条件
                            plainSelect.setWhere(new Parenthesis(inExpression));
                        } else {
                            // 存在 where 条件 and 处理
                            plainSelect.setWhere(new AndExpression(plainSelect.getWhere(), inExpression));
                        }
                    } else if ("mobile".equals(dataColumn.getName())) {
                        // 支持一个自定义条件
                        LikeExpression likeExpression = new LikeExpression();
                        likeExpression.setLeftExpression(new Column(dataColumn.getAliasDotName()));
                        likeExpression.setRightExpression(new StringValue("%1533%"));
                        plainSelect.setWhere(new AndExpression(plainSelect.getWhere(), likeExpression));
                    }
                }
            }
        }
    };
}

最终执行 SQL 输出:



SELECT u.* FROM user u
  WHERE (u.department_id IN ('1', '2', '3', '5'))
  AND u.mobile LIKE '%1533%' LIMIT 1, 10

目前仅有付费版本,了解更多 mybatis-mate 使用示例详见:

https://gitee.com/baomidou/mybatis-mate-example

MyBatis-Plus快速入门

MyBatis-Plus(简称 MP)是一个 MyBatis的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发、提高效率而生。

就像 魂斗罗 中的 1P、2P,基友搭配,效率翻倍。



特性:
无侵入:只做增强不做改变,引入它不会对现有工程产生影响,如丝般顺滑
损耗小:启动即会自动注入基本 CURD,性能基本无损耗,直接面向对象操作
强大的 CRUD 操作:内置通用 Mapper、通用 Service,仅仅通过少量配置即可实现单表大部分 CRUD 操作,更有强大的条件构造器,满足各类使用需求


支持 Lambda 形式调用:通过 Lambda 表达式,方便地编写各类查询条件,无需再担心字段写错支持主件自动生成:支持多达 4 主键策略(内含分布式唯一 ID 生成器 - Sequence),可自由配置,完美解决主键问题


支持 ActiveRecord 模式:支持 ActiveRecord 形式调用,实体类只需继承 Model 即可进行强大的 CRUD 操作支持自定义全局通用操作:支持全局通用方法注入( Write once, use anywhere )


内置代码生成器:采用代码或者 Maven 插件可快速生成 Mapper 、 Model 、 Service 、 Controller 层代码,支持模板引擎,更有超多自定义配置等您来使用
内置分页插件:基于 MyBatis 物理分页,开发者无需关心具体操作,配置好插件之后,写分页等同于普通 List查询


分页插件支持多种数据库:支持 MySQL、MariaDB、Oracle、DB2、H2、HSQL、SQLite、Postgre、
SQLServer 等多种数据库
内置性能分析插件:可输出 Sql 语句以及其执行时间,建议开发测试时启用该功能,能快速揪出慢查询
内置全局拦截插件:提供全表 delete 、 update 操作智能分析阻断,也可自定义拦截规则,预防误操作

1、mybatis-plus 快速使用

1.1 、引入mybatis-plus相关maven依赖


2 
3 com.baomidou
4 mybatis‐plus
5 3.3.1
6 

引入mybatis-plus在spring boot中的场景启动器

1 
2 
3 com.baomidou
4 mybatis‐plus‐boot‐starter
5 3.3.1
6 

ps:切记不可再在pom.xml文件中引入mybatis与mybatis-spring的maven依赖,这一点,mybatis-plus的官方文档中已经
说明的很清楚了

1.2、创建数据表

(1)SQL语句

1 ‐‐ 创建表
2 CREATE TABLE tbl_employee(
3 id INT(11) PRIMARY KEY AUTO_INCREMENT,
4 last_name VARCHAR(50),
5 email VARCHAR(50),
6 gender CHAR(1),
7 age INT
8 );
9 INSERT INTO tbl_employee(last_name,email,gender,age) VALUES('Tom','tom@atguigu.com',1,22);
10 INSERT INTO tbl_employee(last_name,email,gender,age) VALUES('Jerry','jerry@atguigu.com',0,25);
11 INSERT INTO tbl_employee(last_name,email,gender,age) VALUES('Black','black@atguigu.com',1,30);
12 INSERT INTO tbl_employee(last_name,email,gender,age) VALUES('White','white@atguigu.com',0,35);

(2) 数据表结构



1.3、 创建java bean

根据数据表新建相关实体类

1 package com.example.demo.pojo;
2
3 public class Employee {
4 private Integer id;
5 private String lastName;
6 private String email;
7 private Integer gender;
8 private Integer age;
9 public Employee() {
10 super();
11 // TODO Auto‐generated constructor stub
12 }
13 public Employee(Integer id, String lastName, String email, Integer gender, Integer age) {
14 super();
15 this.id = id;
16 this.lastName = lastName;
17 this.email = email;
18 this.gender = gender;
19 this.age = age;
20 }
21 public Integer getId() {
22 return id;
23 }
24 public void setId(Integer id) {
25 this.id = id;
26 }
27 public String getLastName() {
28 return lastName;
29 }
30 public void setLastName(String lastName) {
31 this.lastName = lastName;
32 }
33 public String getEmail() {
34 return email;
35 }
36 public void setEmail(String email) {
37 this.email = email;
38 }
39 public Integer getGender() {
40 return gender;
41 }
42 public void setGender(Integer gender) {
43 this.gender = gender;
44 }
45 public Integer getAge() {
46 return age;
47 }
48 public void setAge(Integer age) {
49 this.age = age;
50 }
51 @Override
52 public String toString() {
53 return "Employee [id=" + id + ", lastName=" + lastName + ", email=" + email + ", gender=" + gender +
", age="
54 + age + "]";
55 }
56
57
58 }

1.4、 配置application.proprties

数据源使用druid

1 spring.datasource.username=root
2 spring.datasource.password=20182022
3 spring.datasource.url=jdbc:mysql://127.0.0.1:3306/my?useUnicode=true&characterEncoding=UTF‐8&useSSL=fa
lse&serverTimezone=GMT%2B8
4 spring.datasource.driver‐class‐name=com.mysql.cj.jdbc.Driver
5
6 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource

2、基于mybatis-plus的入门helloworld---CRUD实验
ps:在进行crud实验之前,简单对mybatis与mybatis-plus做一个简单的对比

2.1、mybatis与mybatis-plus实现方式对比

(1)提出问题: 假设我们已存在一张 tbl_employee 表,且已有对应的实体类 Employee,实现 tbl_employee 表的 CRUD
操作我们需要做什么呢?
(2)实现方式: 基于 Mybatis 需要编写 EmployeeMapper 接口,并手动编写 CRUD 方法 提供 EmployeeMapper.xml 映
射文件,并手动编写每个方法对应的 SQL 语句. 基于 Mybatis-plus 只需要创建 EmployeeMapper 接口, 并继承
BaseMapper 接口.这就是使用 mybatis-plus 需要完成的所有操作,甚至不需要创建 SQL 映射文件。

相关推荐

ps软件在线使用(ps在线工具)

?选择工具是最基本的PS工具之一,具有对图层进行移动和对齐的功能,工具栏上是个亿带十字的箭头图标(区别于路径选择工具,后者是一个标准的箭头图标)。?在使用PS工具的时候,我们要注意鼠标状态的变...

win7平板电脑(win7平板电脑好用吗)

方法一:平板模式只需在操作中心快速切换:1、点击右下角的操作中心图标,在弹出的窗口中点击“平板模式”实现开启或关闭;2、如此一来就能轻松实现平板模式和桌面模式的快速切换了。方法二:系统设置修改1...

windowsxp是哪一年发布的(windowsxp是什么时候发布的)

WindowsXP是微软公司研发的计算机操作系统,于2001年10月25日正式发布。其名字中“XP”的意思来自英文中的“体验”(Experience)。[1][2]WindowsXP使用了Luna...

win8没有无线网络连接(win8无线设备没有wifi)

当Win8.1的网络连接不可用时,您可以尝试以下几种方法来解决问题:1.检查物理连接:确保网络电缆正确连接到计算机和路由器/调制解调器。如果使用的是无线网络,请确保无线适配器已启用,并且与正确的网络...

手机系统重装教程(手机系统如何重装系统)
手机系统重装教程(手机系统如何重装系统)

手机怎么重装系统?1首先我们是需要做好个人数据的备份的,只要做好联系人,文件夹,重要的软件和照片的备份,使用专业的备份软件就可以,我们找到设置然后找到云服务点击进去然后就会有一个云备份,再点进去有个立即备份。2第二个条件就是手机一定要有充足...

2026-01-09 04:55 liuian

笔记本触摸板没反应怎么办(笔记本电脑触摸板没反应怎么回事)
笔记本触摸板没反应怎么办(笔记本电脑触摸板没反应怎么回事)

您可以尝试按下触摸板上方的Fn键加上触摸板功能键来恢复触摸板反应。如果这个方法不行的话,您可以尝试更换电脑驱动或进行一些基础维护来解决问题。触摸板没有反应可能是因为触摸板驱动或者硬件出现问题,还有可能是触摸板出现灰尘卡住,需要进行清理维护。...

2026-01-09 04:05 liuian

gpt和mbr的区别哪个好(gpt和mbr性能有差距吗)

GPT格式相较于MBR格式有更多的优点。首先,GPT扩展了分区表的大小,支持更多的分区。其次,GPT支持更大的硬盘容量,能够管理超过2TB的硬盘。另外,GPT对于数据备份和恢复也更加方便,而且更加稳定...

cmd清理垃圾命令代码(cmd清除垃圾命令)

1、首先“windows”键+“R”,当然不一定是大写,这里是为了突出2、其次,输入“cmd”,按下回车键或者点击上面的“确定”按钮3、进入控制台窗口之后,输入“cleanmgr”,按下回车键“ent...

双系统没有引导界面(双系统 没有引导)

安装有winPE系统的U盘无法进安装系统界面的原因通常有如下几点:1)BIOS中开启了secureboot若BIOS中开启了secureboot项目,winPE系统是无法引导进入的,此时需先进入BIO...

电脑运行速度慢怎么办(电脑运行速度慢咋办)

清理电脑桌面电脑桌面上的东西越少越好,东西多了占系统资源。虽然在桌面上方便些,但是要付出占用系统资源和牺牲速度的代价。解决办法:①将桌面上快捷方式都删了,因为这些在“开始”菜单和“程序”栏里都有。②将...

foxmail和qq邮箱的关系(foxmail邮箱和outlook)

是的,QQ邮箱和Foxmail邮箱是一个团队开发的就是原来的Foxmail客户端开发团队不过被腾讯收购了所以,我们看的的QQ邮箱和Foxmail邮箱是一样的。只是Foxmail功能少的点,而切也不够出...

电脑如何创建虚拟光驱(如何建立虚拟光驱)

虚拟光驱是一种软件,可以模拟实体光盘,使得用户可以在没有实体光盘的情况下使用光盘的功能,如安装应用程序、游戏等。下面是安装虚拟光驱的一般步骤:1.选择一个虚拟光驱软件,比如VirtualClone...

360怎么修复u盘(用360怎么修复u盘)

如果是有盘符而没有显示出来的:右击我的电脑/管理/存储/磁盘管理,然后右击“可移动磁盘”图标”单击快捷菜单中的“更改驱动器和路径”选项,并在随后的界面中单击“添加”按钮,接下来选中“指派驱动器号”,同...

cad2025永久激活密钥(cad2016激活密钥)

CAD2021的序列号和密钥激活步骤如下:1.首先,确保您已经购买了CAD2021的许可证。您可以在Autodesk官网上购买或联系您的Autodesk代理购买。2.下载并安装CAD2021软件。...

window7下载lr2019(window7下载一键重装如何恢复网络)

手机上要下载软件的话就到手机上应用商店里面去下载是最安全的