Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
wyz 960584629d 写完了注册&登录 il y a 3 ans
.mvn/wrapper transfer to ubuntu to use docker 删除 il y a 3 ans
src 写完了注册&登录 删除 il y a 3 ans
.gitignore transfer to ubuntu to use docker il y a 3 ans
Dockerfile 把前端代码放进去了 il y a 3 ans
README.en.md Initial commit il y a 3 ans
README.md 写完了注册&登录 il y a 3 ans
image-20210108231726208.png 写完了注册&登录 il y a 3 ans
image-20210108231944550.png 写完了注册&登录 il y a 3 ans
image-20210108232120541.png 写完了注册&登录 il y a 3 ans
image-20210108232255322.png 写完了注册&登录 il y a 3 ans
image-20210108232403810.png 写完了注册&登录 il y a 3 ans
image-20210108232529868.png 写完了注册&登录 il y a 3 ans
image-20210108232612889.png 写完了注册&登录 il y a 3 ans
image-20210109000921900.png 写完了注册&登录 il y a 3 ans
image-20210109001010687.png 写完了注册&登录 il y a 3 ans
image-20210109102502329.png 写完了注册&登录 il y a 3 ans
image-20210109103550442.png 写完了注册&登录 il y a 3 ans
mvnw transfer to ubuntu to use docker il y a 3 ans
mvnw.cmd transfer to ubuntu to use docker il y a 3 ans
pom.xml done il y a 3 ans
table.sql transfer to ubuntu to use docker il y a 3 ans

README.md

快递代取系统

介绍

前后端分离 后端使用springboot 提供json的api给前端

软件架构

软件架构说明

安装教程

  1. xxxx
  2. xxxx
  3. xxxx

使用说明

  1. xxxx
  2. xxxx
  3. xxxx

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

开发日志

自定义Message码

错误码

-1 登录:用户名不存在

-2 登录:密码错误

-3 注册:用户名已存在

-4 检查session:用户还未登录

正确码

1 登录成功

2 注册成功

3 用户已经登录

后端接收ajax数据

2021/01/08

今天遇到了一个很坑爹的问题

jquery的ajax传给后端的数据springboot居然接收不到

servlet接收ajax

因为springboot本质上是基于servlet的,所以看一下servlet接收ajax是什么样子的

用ajax的前端代码如下:

image-20210108231726208

正常用表单提交的方法如下:

image-20210108232120541

后端代码如下:

image-20210108231944550

用ajax发数据,结果如下:(好像第二行最前面少了一个问号?不知道表单提交的有没有)

image-20210108232255322

正常表单提交,结果如下:

image-20210108232403810

第二行为null是因为流只能读取一次

修改以下后端代码,看看用表单提交的话InputStream是什么样的

image-20210108232529868

输出!

image-20210108232612889

fuck!我一开始还以为是最前面少了个问号的关系,结果正常用表单提交最前面也是没有问号的

这个问题我没找到解决方法(似乎只能自己解析InputStream了?)

ajax那边不管data的数据有没有加上JSON.stringify()都不行

山穷水尽疑无路 ,柳暗花明又一村

我又回头搜了一下springboot和ajax,有了重大发现

springboot接收ajax

image-20210109000921900

==注意画红框的这个类,这个类是需要可序列化的!!!==

image-20210109001010687

==前端传json时,需要加上JSON.Stringify==

image-20210109103550442

ajax获取后端返回的数据

又碰到一个坑。。。

按理说ajax这么写就行了,我还特意加了async:false来取消异步

image-20210109102502329

结果前端执行的是error函数。。。

后来发现:

前端设置了希望后端发来的类型(dataType:"application/json")

但是后端没有设置返回类型

把dataType删了就行