bug记录


git经常出现fatal error的问题:参考这个https://blog.csdn.net/Greenhand_BN/article/details/135881590

后端

  1. controller层某个api方法里service类为null:该方法被设置成了private,应改为public

  2. IPage功能不生效

    原因:没有配置文件

    @Configuration
    @EnableTransactionManagement
    @MapperScan( { "com.example.dorm.entity" })
    public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
    MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
    mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return mybatisPlusInterceptor;
    }
    }
  1. Result<?>:?不要写成其他的!!

前端

  1. 导入了奇怪的依赖包,导致出现如下报错:
vue-router.js?v=1cf80410:44 [Vue Router warn]: uncaught error during route navigation:...
warn @ vue-router.js?v=1cf80410:44
vue-router.js?v=1cf80410:2581 SyntaxError: Identifier '__vite__injectQuery' has already been declared (at ${mod.id}:40653:1)...
  1. el-upload onchange里的函数被调用两次

    原因:未关闭auto-upload,前面要有”:”!

<el-upload class="upload-demo" drag accept=".xls, .xlsx, .xml"
:on-change="handleFileUpload"
:auto-upload="false">
<i class="el-icon-upload"></i>
<div class="el-upload__text">重新导入宿管信息,将文件拖到此处,或<em>点击上传</em></div>
</el-upload>

在使用 el-upload上传文件时,on-change会触发二次事件,一次是ready状态,一次是success状态

  1. GET类型的api传参要用params而不是data

    原因:GET 请求参数应该通过 URL 查询字符串传递,而不是放在请求体(data)中。应该使用 params 来传递 URL 查询参数,而不是使用 data

    export const getDormManagers = ({pageNum, pageSize, search}) => {
    return http({
    url: '/manager/get-managers',
    method: 'GET',
    headers: {
    'Content-Type': 'application/json'
    },
    params: {
    pageNum,
    pageSize,
    search
    }
    })
    };
  1. 网页显示 [object Promise]

    原因:同步异步问题,如下方式不对,这是异步调用

    getStudentById(id).then(res => {
    ...
    })
    //改成:
    const res = await getStudentById(id);

数据库

mysql的触发器游标使用问题


Author: CuberSugar
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source CuberSugar !
  TOC