问题01描述deprecated core-js@2.6.12: core-js@<3.23.3:
1
2
3
4
5
C:\Users\ASUS\IdeaWorkSpace\vue\vue>npm i element-ui -S
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for
usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js
versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web com
patibility issues. Please, upgrade your dependencies to the actual version of core-js.

解决方法:

1
npm install -g core-js@3.23.3
问题02描述HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.:
1
2
3
4
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.

解决:

1
git config --global http.sslVerify true
问题03描述:message:文档中根元素前面的标记必须格式正确.[row,col]:[1,2]
  • 最近在学习 spring-boot的过程中,新建spring-boot项目老是出现以下提示,如图:

  • 导致新建的工程只能打开部分文件,如图:

  • 解决方法如下:
    一、
    Idea中点击“File”->“Invalidate Caches / Restart…”,之后会弹出一个对话框,再点击Invalidate and Restart,之后等待工程打开应该就可以了;

  • 二、
    如果第一种方法不行,那就去建工程的文件下,找到项目的**.idea** 文件夹,
    直接删除,再重新启动项目就可以打开程序了。
    ——————————————

问题04:解决Vuex刷新后无数据且页面空白

自己网上找到的解决办法浅显地解决,没有知道原理:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  export default {
name: 'App',
components: {

},
//解决刷新时vuex的数据重置消失
created() {
// 先检查sessionStorage中是否有数据,若存在数据则加载到vuex
if (sessionStorage.getItem("store")) {
this.$store.replaceState(
Object.assign(
{},
this.$store.state,
JSON.parse(sessionStorage.getItem("store"))
)
);
sessionStorage.removeItem("store");
}

//在页面刷新时将vuex里的信息保存到sessionStorage里
window.addEventListener("beforeunload", () => {
sessionStorage.setItem("store", JSON.stringify(this.$store.state));
});
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<script>

export default {
name: 'App',
components: {

},
//解决刷新时vuex的数据重置消失
created() {
// 先检查sessionStorage中是否有数据,若存在数据则加载到vuex
if (sessionStorage.getItem("store")) {
this.$store.replaceState(
Object.assign(
{},
this.$store.state,
JSON.parse(sessionStorage.getItem("store")),
JSON.parse(sessionStorage.getItem("menu"))
)
);
this.$store.commit("setMenu",JSON.parse(sessionStorage.getItem("menu")));
sessionStorage.removeItem("store");
sessionStorage.removeItem("menu");
}

//在页面刷新时将vuex里的信息保存到sessionStorage里
window.addEventListener("beforeunload", () => {
sessionStorage.setItem("store", JSON.stringify(this.$store.state));
sessionStorage.setItem("menu", JSON.stringify(this.$store.state.routee));
this.$store.commit("setMenu",JSON.parse(sessionStorage.getItem("menu")));
});
},
}
</script>
问题05:
1
Java中List初始时赋值为null,则不能添加add
1
重定向:Controller之间互相实现页面跳转(或者请求)利用redirect
1
数据库表id重置: truncate table 表名
1
一份form表单提交到多个地址: 用formaction
问题06:
1
db中表的主健采用了自增的方式,但是在bean中并没有定义id属性,导致报错org.apache.ibatis.executor.ExecutorException: No setter found for the keyProperty 'id'

解决办法:

1
在配置中删除keyProperty="id"的配置

原因:

1
2
3
4
5
6
7
8
9
10
11
主健采用了自增的方式只需要配置:useGeneratedKeys="true"

keyProperty="id"的意思是 将主键的中的数据 放到传入对象的成员变量id里面,因为在对像的成员变量中没有定义属性id,也没有定时id属性的get,set方法,所以会报错:org.apache.ibatis.executor.ExecutorException: No setter found for the keyProperty 'id'

如果db的表中没有指定主键:可以用属性keyColumn

useGeneratedKeys=true,keyProperty="userId",keyColumn="user_id"

这个注解的意思就是,使用数据库自动增长的主键,并从table中user_id字段里面把数据放到传入对象的成员变量userId里面。

如果我们已经在数据库表中指定了主键,那么keyColumn属性可以缺省。
问题07:
1
Vuex中刷新页面丢失,动态路由不生效。

b站教的解决办法:

1
2
3
4
1.npm i vuex-persistedstate
2.import createPersistedState from 'vuex-persistedstate'
3. plugins:[createPersistedState()]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import vue from 'vue'
import Vuex from 'vuex'
import router,{resetRouter} from '../router'
import createPersistedState from 'vuex-persistedstate'
vue.use(Vuex);

function addNewRoute(menuList) {
console.log("打印menuList");
console.log(menuList);
let routes = router.options.routes;
// console.log("路由");
// console.log(routes);
routes.forEach(routeItem=>{
if (routeItem.path=="/Index"){
menuList.forEach(menu=>{
let childRoute = {
path:'/'+menu.menuclick,
name:menu.menuname,
meta:{
title:menu.menuname,
},
component:()=>import('../components/'+menu.menucomponent),
};
routeItem.children.push(childRoute);
});
}
});
resetRouter();
router.addRoutes(routes)
}

export default new Vuex.Store({
state:{
menu: []
},
mutations:{
setMenu(state,menuList) {
state.menu =menuList;
addNewRoute(menuList);
},
setRoute(state,menuList) {
state.menu =menuList;
addNewRoute(menuList);
}
},
getters:{
getMenu(state){
return state.menu
}
},
plugins:[createPersistedState()]
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
<div id="app">
<router-view></router-view>
</div>
</template>

<script>

export default {
name: 'App',
data(){
return{
user:JSON.parse(sessionStorage.getItem('CurUser')),
}
},watch:{
'$store.state.menu':{
handler(val,old){
if (!old && this.user && this.user.no){
this.$store.commit("setRoute",val)
}
},
immediate: true
}
}
}
</script>

<style>
html,body,#app {
/*font-family: Avenir, Helvetica, Arial, sans-serif;*/
/*-webkit-font-smoothing: antialiased;*/
/*-moz-osx-font-smoothing: grayscale;*/
/*text-align: center;*/
/*color: #2c3e50;*/
/*margin-top: 60px;*/
height: 100%;
margin: 0;
padding: 0;
}
</style>
1
2
3
4
5
mybatis:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

mapper-locations: classpath:mapper/*.xml
问题08:mysql自增id重置 从0开始增长
1
2
3
自增ID 重新从0 开始增长

ALTER TABLE 表名 AUTO_INCREMENT=1;
问题09:

项目报错

1
2
3
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. Th

error:[Kotlin](https://so.csdn.net/so/search?q=Kotlin&spm=1001.2101.3001.7020):module was compiled with an incompatible version of kotlin the binary version of its metadata is

解决:

方案一、compile项目

01

方案二、
1
ReBuild Project

02

问题10:mysql中定义datetime类型的值,在前端如何显示以及重新传入并写进数据库

解决:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
在对应的实体类中对应字段,添加注解    
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")

示例
@Data
@ApiModel(value = "Exam对象", description = "")
public class Exam implements Serializable {

private static final long serialVersionUID = 1L;

@TableId(value = "id", type = IdType.AUTO)
private Integer id;

private String examName;

private String examAddress;


@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime examStartTime;


@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime examEndTime;
}


问题11:
1
this.$refs.form.validate()不起作用
1
在表单校验的规则中,一定要有 callback()