diff --git a/len-blog-ui/config/index.js b/len-blog-ui/config/index.js index 10c0aae..60cf267 100644 --- a/len-blog-ui/config/index.js +++ b/len-blog-ui/config/index.js @@ -10,7 +10,15 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: {}, + proxyTable: { + '/api': { + target: 'http://localhost:8081', + changeOrigin: true, + pathRewrite: { + '^/api' : '' + } + } + }, // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST diff --git a/len-blog-ui/package-lock.json b/len-blog-ui/package-lock.json index 80a26e3..9a3a231 100644 --- a/len-blog-ui/package-lock.json +++ b/len-blog-ui/package-lock.json @@ -587,6 +587,15 @@ "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", "dev": true }, + "axios": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "requires": { + "follow-redirects": "1.5.0", + "is-buffer": "1.1.6" + } + }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -4887,7 +4896,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz", "integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==", - "dev": true, "requires": { "debug": "3.1.0" }, @@ -4896,7 +4904,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, "requires": { "ms": "2.0.0" } @@ -6531,8 +6538,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-builtin-module": { "version": "1.0.0", @@ -8743,8 +8749,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multicast-dns": { "version": "6.2.3", diff --git a/len-blog-ui/package.json b/len-blog-ui/package.json index 7962d09..4b43cd5 100644 --- a/len-blog-ui/package.json +++ b/len-blog-ui/package.json @@ -14,6 +14,7 @@ "build": "node build/build.js" }, "dependencies": { + "axios": "^0.18.0", "iview": "^2.14.3", "vue": "^2.5.2", "vue-router": "^3.0.1" diff --git a/len-blog-ui/src/components/HelloWorld.vue b/len-blog-ui/src/components/HelloWorld.vue index 20f55e3..d8c2903 100644 --- a/len-blog-ui/src/components/HelloWorld.vue +++ b/len-blog-ui/src/components/HelloWorld.vue @@ -11,29 +11,9 @@ + - - - - - - - - - java - - - - 架构 - - - - 其他 - - - -
@@ -41,7 +21,9 @@
  • +

    lenos快速开发脚手架

    +

    作者:zxm • 2017-10-31 10:05:47

    lenos快速开发脚手架

    @@ -53,7 +35,9 @@
  • +

    lenos快速开发脚手架

    +

    作者:zxm • 2017-10-31 10:05:47

    lenos快速开发脚手架

    @@ -64,7 +48,9 @@
  • +

    lenos快速开发脚手架

    +

    作者:zxm • 2017-10-31 10:05:47

    lenos快速开发脚手架

    @@ -76,58 +62,11 @@
    -
    -
      -
    • - - - java - spring - vue - batis - 标签一 - 标签二 - 标签三 - 标签四 - 标签一 - 标签二 - 标签三 - 标签四 - - 标签二的内容 - 标签三的内容 - -
    • -
    • - - - - - - - - - - - - - - - - - - + - - - -
    • -
    • -
    -
  • - +
    @@ -136,9 +75,16 @@ diff --git a/len-blog-ui/src/components/header/head.vue b/len-blog-ui/src/components/header/head.vue new file mode 100644 index 0000000..8eb5f7a --- /dev/null +++ b/len-blog-ui/src/components/header/head.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/len-blog-ui/src/components/home.vue b/len-blog-ui/src/components/home.vue index 9e550d3..1b72316 100644 --- a/len-blog-ui/src/components/home.vue +++ b/len-blog-ui/src/components/home.vue @@ -1,29 +1,296 @@ + diff --git a/len-blog-ui/src/components/right/right.vue b/len-blog-ui/src/components/right/right.vue new file mode 100644 index 0000000..7f43d12 --- /dev/null +++ b/len-blog-ui/src/components/right/right.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/len-blog-ui/src/main.js b/len-blog-ui/src/main.js index 359f2c0..d7e1a82 100644 --- a/len-blog-ui/src/main.js +++ b/len-blog-ui/src/main.js @@ -5,6 +5,10 @@ import App from './App' import router from './router' import iView from 'iview'; import 'iview/dist/styles/iview.css'; +import axios from 'axios' + + +Vue.prototype.$http = axios Vue.use(iView); diff --git a/len-blog-ui/src/router/index.js b/len-blog-ui/src/router/index.js index 7de3dd9..62f8fe4 100644 --- a/len-blog-ui/src/router/index.js +++ b/len-blog-ui/src/router/index.js @@ -14,7 +14,7 @@ export default new Router({ component: HelloWorld }, { - path:'/home/', + path:'/home/:id', component:Home, children:[ { diff --git a/len-blog/pom.xml b/len-blog/pom.xml index f04871c..833eafb 100644 --- a/len-blog/pom.xml +++ b/len-blog/pom.xml @@ -10,7 +10,7 @@ 4.0.0 len-blog - + \ No newline at end of file diff --git a/len-blog/src/main/java/com/len/controller/ArticleController.java b/len-blog/src/main/java/com/len/controller/ArticleController.java index 90381b8..f8ecd85 100644 --- a/len-blog/src/main/java/com/len/controller/ArticleController.java +++ b/len-blog/src/main/java/com/len/controller/ArticleController.java @@ -1,12 +1,11 @@ package com.len.controller; -import com.len.model.BlogArticle; -import com.len.service.ArticleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; /** * 文章管理(后台) @@ -15,12 +14,10 @@ import org.springframework.web.bind.annotation.ResponseBody; * @email 1146556298@qq.com * @date 2018-05-05 */ -@Controller -@RequestMapping("/article") +@RestController +@RequestMapping("/blog") public class ArticleController { - @Autowired - private ArticleService service; @GetMapping("/articleList") public String articleListPage() { @@ -30,9 +27,13 @@ public class ArticleController { /** * 文章列表 */ - @ResponseBody - @GetMapping("/showArticleList") - public String showArticles(BlogArticle article, String page, String limit) { - return service.show(article, Integer.valueOf(page), Integer.valueOf(limit)); + @GetMapping("/header") + public List showArticles() { + List list = new ArrayList<>(4); + list.add("java"); + list.add("架构"); + list.add("Linux"); + list.add("其他"); + return list; } } diff --git a/len-blog/src/main/java/com/len/mapper/BlogArticleMapper.java b/len-blog/src/main/java/com/len/mapper/BlogArticleMapper.java deleted file mode 100644 index 8c9504d..0000000 --- a/len-blog/src/main/java/com/len/mapper/BlogArticleMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.len.mapper; - -import com.len.base.BaseMapper; -import com.len.model.BlogArticle; - -public interface BlogArticleMapper extends BaseMapper { - int deleteByPrimaryKey(String id); - - int insert(BlogArticle record); - - int insertSelective(BlogArticle record); - - BlogArticle selectByPrimaryKey(String id); - - int updateByPrimaryKeySelective(BlogArticle record); - - int updateByPrimaryKey(BlogArticle record); -} \ No newline at end of file diff --git a/len-blog/src/main/java/com/len/service/ArticleService.java b/len-blog/src/main/java/com/len/service/ArticleService.java deleted file mode 100644 index 8e89ffa..0000000 --- a/len-blog/src/main/java/com/len/service/ArticleService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.len.service; - -import com.len.base.BaseService; -import com.len.model.BlogArticle; - -/** - * 博客文章业务 - * - * @author JamesZBL - * @email 1146556298@qq.com - * @date 2018-05-05 - */ -public interface ArticleService extends BaseService { -} diff --git a/len-blog/src/main/java/com/len/service/impl/ArticleServiceImpl.java b/len-blog/src/main/java/com/len/service/impl/ArticleServiceImpl.java deleted file mode 100644 index 1f61873..0000000 --- a/len-blog/src/main/java/com/len/service/impl/ArticleServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.len.service.impl; - -import com.len.base.BaseMapper; -import com.len.base.impl.BaseServiceImpl; -import com.len.mapper.BlogArticleMapper; -import com.len.model.BlogArticle; -import com.len.service.ArticleService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 博客文章业务实现 - * - * @author JamesZBL - * @email 1146556298@qq.com - * @date 2018-05-05 - */ -@Service -public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - - @Autowired - private BlogArticleMapper mapper; - - @Override - public BaseMapper getMappser() { - return mapper; - } -} diff --git a/len-blog/src/main/resources/generatorConfig.xml b/len-blog/src/main/resources/generatorConfig.xml deleted file mode 100644 index ad0c46c..0000000 --- a/len-blog/src/main/resources/generatorConfig.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    \ No newline at end of file diff --git a/len-blog/src/main/resources/mapper/BlogArticleMapper.xml b/len-blog/src/main/resources/mapper/BlogArticleMapper.xml deleted file mode 100644 index 401986a..0000000 --- a/len-blog/src/main/resources/mapper/BlogArticleMapper.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - id, title, description, content_md, content_html, read_quantity, gmt_created, gmt_modified - - - - - delete from blog_art - where id = #{id,jdbcType=VARCHAR} - - - - SELECT REPLACE(UUID(),'-','') AS ID FROM DUAL - - insert into blog_art (title, description, content_md, - content_html, read_quantity, gmt_created, - gmt_modified) - values (#{title,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{contentMd,jdbcType=LONGVARCHAR}, - #{contentHtml,jdbcType=LONGVARCHAR}, #{readQuantity,jdbcType=INTEGER}, #{gmtCreated,jdbcType=TIMESTAMP}, - #{gmtModified,jdbcType=TIMESTAMP}) - - - - SELECT REPLACE(UUID(),'-','') AS ID FROM DUAL - - insert into blog_art - - - title, - - - description, - - - content_md, - - - content_html, - - - read_quantity, - - - gmt_created, - - - gmt_modified, - - - - - #{title,jdbcType=VARCHAR}, - - - #{description,jdbcType=VARCHAR}, - - - #{contentMd,jdbcType=LONGVARCHAR}, - - - #{contentHtml,jdbcType=LONGVARCHAR}, - - - #{readQuantity,jdbcType=INTEGER}, - - - #{gmtCreated,jdbcType=TIMESTAMP}, - - - #{gmtModified,jdbcType=TIMESTAMP}, - - - - - update blog_art - - - title = #{title,jdbcType=VARCHAR}, - - - description = #{description,jdbcType=VARCHAR}, - - - content_md = #{contentMd,jdbcType=LONGVARCHAR}, - - - content_html = #{contentHtml,jdbcType=LONGVARCHAR}, - - - read_quantity = #{readQuantity,jdbcType=INTEGER}, - - - gmt_created = #{gmtCreated,jdbcType=TIMESTAMP}, - - - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=VARCHAR} - - - update blog_art - set title = #{title,jdbcType=VARCHAR}, - description = #{description,jdbcType=VARCHAR}, - content_md = #{contentMd,jdbcType=LONGVARCHAR}, - content_html = #{contentHtml,jdbcType=LONGVARCHAR}, - read_quantity = #{readQuantity,jdbcType=INTEGER}, - gmt_created = #{gmtCreated,jdbcType=TIMESTAMP}, - gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/len-web/src/main/java/com/len/config/ShiroConfig.java b/len-web/src/main/java/com/len/config/ShiroConfig.java index 7eb57bd..b253c87 100644 --- a/len-web/src/main/java/com/len/config/ShiroConfig.java +++ b/len-web/src/main/java/com/len/config/ShiroConfig.java @@ -96,6 +96,7 @@ public class ShiroConfig { filterMap.put("/login","verCode,anon"); //filterMap.put("/login","anon"); filterMap.put("/getCode","anon"); + filterMap.put("/blog/**","anon"); filterMap.put("/logout","logout"); filterMap.put("/plugin/**","anon"); filterMap.put("/user/**","per"); diff --git a/pom.xml b/pom.xml index b5e7bd0..ba76823 100644 --- a/pom.xml +++ b/pom.xml @@ -94,11 +94,11 @@ spring-boot-starter-logging - +