问题一: 请求跨域 使用proxy代理
解决: 在vue-cli3项目根路径下面创建vue.config.js文件
问题二: axios发送post请求 后端得到数据为null
this.$refs.loginFormRef.validate(async valid => {
if (!valid) return
const { data: res } = await this.$http.post('/user/login.action',
this.loginForm
)
})
null
Hibernate: select user0_.id as id1_0_, user0_.name as name2_0_, user0_.password as password3_0_ from user user0_ where user0_.name=?
解决:需要使用axios自带的qs模块
完美!!!