vue+springboot踩坑记录

vue3相关文档汇总

https://vue3js.cn/

mybatis官方教程

https://mybatis.org/mybatis-3/zh/sqlmap-xml.html

springboot应用本地ip能访问,局域网下ip不能访问

检查windows防火墙,注意防火墙是分网络,分应用设置的,仅对当前网络设置为专用网络还不够,还需要放通java应用
file
file

动态菜单某几个提示路由不存在

添加路由时,name相同会覆盖前面的

菜单无法只打开一个

el-sub-menu :index=""
index需要不同!

路径中的#号

由于默认是hash模式,产生的#号
const router = createRouter({
history: createWebHashHistory(),
routes
})

mysql数据库中describe字段不能使用,是个关键字

多个tree共用数据,ref需要设置不同的

注意以下ref的写法

<el-collapse v-model="activeName" accordion @change="change">
    <el-collapse-item :title="r.nameZh" :name="r.id" v-for="(r,index) in roles" :key="index">
        <el-tree
        show-checkbox
        node-key="id"
        :ref="`tree`+index"
        :key="index"
        :default-checked-keys="selectedMenus"
        :data="allMenus" :props="defaultProps">
        </el-tree>
    </el-collapse-item>
</el-collapse>
let tree = this.$refs['tree'+index];//注意这里的写法
let selectedKeys = tree.getCheckedKeys(true);//true表示只要根节点,后端搜索时会自动带上父级目录

springboot maven打包jar到指定路径

在pom.xml中添加build,注意观测outputDirectory配置


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.example.server.projectApplication</mainClass><!--自己项目的启动类-->
        <outputDirectory>${session.executionRootDirectory}/target/jar</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

vue3配置全局属性

需要配置完属性,再挂载

const app=createApp(App).use(router).use(store).use(ElementPlus)
// 全局方法
app.config.globalProperties.$postRequest=postRequest;
app.config.globalProperties.$putRequest=putRequest;
app.config.globalProperties.$getRequest=getRequest;
app.config.globalProperties.$deleteRequest=deleteRequest;
// 挂载
app.mount('#app')

Extraneous non-props attributes

导致该问题的主要原因是传递了没有解析的属性,可以检查一下你用的第三方的组件,或者自己编写的组件,是否 存在没有解析的属性,例如:class等属性

mybatis xml文件 or DELIMITER expected, got ‘id’

settings-Editor-language injection 找到ibatis 删除xml tag中的sql
Idea常见问题整理
https://www.jianshu.com/p/e20eb9645ce9?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

fastdfs

fastdfs安装配置
FastDFS同Apache的整合配置 ,未成功
libcommon下载
fasdfs下载