This commit is contained in:
fanxb 2019-08-12 17:53:21 +08:00
parent 85a614517b
commit 94bfb80179
4 changed files with 22 additions and 12 deletions

View File

@ -88,7 +88,15 @@ class UserController{
那么如何才能实现上面想要的效果呢? 那么如何才能实现上面想要的效果呢?
很简单,通过`AopContext.currentProxy()`来获取当前类的代理对象,这样调用`save`方法时就有自动事务了。 很简单,通过`AopContext.currentProxy()`来获取当前类的代理对象,这样调用`save`方法时就有自动事务了。使用该方法需要在启动类中加入如下注解:`@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)`,然后 pom 依赖中加入如下依赖:
```xml
<!--aop依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
```
或者使用手动事务 或者使用手动事务

View File

@ -1,8 +1,8 @@
--- ---
id: "20190625" id: "20190625"
date: 2019/06/25 10:58:00 date: 2019/06/25 10:58:00
title: "react实战:云书签-1(总览)" title: "从零开始react实战:云书签(总览)"
tags: ["react", "antd", "table"] tags: ["react", "antd"]
categories: categories:
- "前端" - "前端"
- "react" - "react"
@ -21,4 +21,4 @@ categories:
- [1.react 环境搭建](https://www.tapme.top/blog/detail/20190626) - [1.react 环境搭建](https://www.tapme.top/blog/detail/20190626)
-[2.] -[2.登录注册重置密码前后端实现](https://www.tapme.top/blog/detail/20190628)

View File

@ -1,22 +1,22 @@
--- ---
id: "20190626" id: "20190626"
date: 2019/06/26 10:58:00 date: 2019/06/26 10:58:00
title: "2.react实战:云书签-react环境搭建" title: "从零开始react实战:云书签1- react环境搭建"
tags: ["react", "antd", "less", "create-react-web"] tags: ["react", "antd", "less", "create-react-web"]
categories: categories:
- "前端" - "前端"
- "react" - "react"
--- ---
集篇:[react 实战之多人聊天室](https://www.tapme.top/blog/detail/20190625) 览篇:[react 实战之云书签](https://www.tapme.top/blog/detail/20190625)
本篇是实战系列的第一篇,主要是搭建 react 开发环境,在`create-react-app`的基础上加上如下功能: 本篇是实战系列的第一篇,主要是搭建 react 开发环境,在`create-react-app`的基础上加上如下功能:
- 按需引入 antd 组件库,支持主题定制 - antd 组件库按需引入 ,支持主题定制
- 支持 less 语法,并使用 css-module 形式 css - 支持 less 语法,并使用 css-module
- 支持路由 - 配置路由
- 支持 http 请求 - 支持 http 请求
- 支持 redux - 配置 redux
**注意**:需要 node 版本大于 8.0. **注意**:需要 node 版本大于 8.0.
@ -147,7 +147,7 @@ export default Hello;
- reducer: 存放 reducer 操作 - reducer: 存放 reducer 操作
- util: 工具类 - util: 工具类
删除`serviceWorker.js`文件,并在`index.js`中删除和它相的代码。这个是和离线使用相关的。 删除`serviceWorker.js`文件,并在`index.js`中删除和它相的代码。这个是和离线使用相关的。
然后安装`react-router`依赖: 然后安装`react-router`依赖:

View File

@ -1,7 +1,7 @@
--- ---
id: "20190628" id: "20190628"
date: 2019/06/28 10:58:00 date: 2019/06/28 10:58:00
title: "2.react实战:云书签-登录、注册、重置密码功能前后端实现" title: "从零开始react实战:云书签2-登录、注册、重置密码功能前后端实现"
tags: ["react", "antd", "less", "create-react-web"] tags: ["react", "antd", "less", "create-react-web"]
categories: categories:
- "前端" - "前端"
@ -88,6 +88,8 @@ import RegisterOrReset from "./pages/public/RegisterOrReset";
作为一个刚开始学习 react 的菜鸟,欢迎各位大牛批评指正。 作为一个刚开始学习 react 的菜鸟,欢迎各位大牛批评指正。
后台代码使用springboot实现有需要的可以自行查看源码。
源码:[github](https://github.com/FleyX/ChatRoom),切换到 tag:`第二篇:第二篇:注册登录重置密码完成`,便可以看到截止到本篇的源码。 源码:[github](https://github.com/FleyX/ChatRoom),切换到 tag:`第二篇:第二篇:注册登录重置密码完成`,便可以看到截止到本篇的源码。
**本文原创发布于:**[www.tapme.top/blog/detail/20190628](https://www.tapme.top/blog/detail/20190628) **本文原创发布于:**[www.tapme.top/blog/detail/20190628](https://www.tapme.top/blog/detail/20190628)