今天就跟大家聊聊有關Java項目如何實現(xiàn)前后端分離,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
構建springboot項目
我的目錄結構:(結果未按標準書寫,僅作說明)
不管用什么IDE,最后我們只看pom.xml里的依賴:
為了盡可能簡單,就不連數(shù)據(jù)庫了,登陸時用固定的。
devtools:用于修改代碼后自動重啟;
jjwt:加密這么麻煩的事情可以用現(xiàn)成的,查看https://github.com/jwtk/jjwt
org.springframework.boot spring-boot-starter-parent 1.5.2.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-web io.jsonwebtoken jjwt 0.6.0 org.springframework.boot spring-boot-devtools true org.springframework.boot spring-boot-starter-test test