![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
web后端
power174
这个作者很懒,什么都没留下…
展开
-
request.getSession().getAttribute获取值为null
控制器A中request.getSession().setAttribute,在B控制器中getAttribute获取到的是null这个是因为在前后端分离架构中,使用vue、angular 等发送ajax存在跨域请求没有携带请求凭证(cookie、HTTP认证及客户端SSL证明)造成request.getSession()获取的是不同的sessionId。解决方法在前端axios里加上axios.defaults.withCredentials = true;...原创 2020-05-22 11:16:51 · 10216 阅读 · 9 评论 -
mybatis-generator插件生成mybatis代码
一、引入插件(插件版本必须是1.3.7,此版本解决可覆盖原有代码问题)在pom.xml中引入 <!-- mybatis generator 自动生成代码插件 --> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin&l原创 2020-05-13 16:03:33 · 120 阅读 · 0 评论 -
搭建spring-boot项目,并使用mybatis实现查询
一、搭建spring-boot项目1、打开itellij,点击new–>Project–>Spring Initralizr(如果没有Spring Initralizr,请到setting–>plugin下搜索spring-boot安装插件)填写好项目名字,选择devTool,spring-Web依赖,生成spring项目等待安装完依赖包,启动sping-boot项目2、集成mybatis,实现简单查询数据库功能功能项目结构项目结构加入mybatis和mysql依原创 2020-05-12 18:52:08 · 226 阅读 · 0 评论 -
koa源码分析(三)
一、我们从最基本的例子入手 ,一步步跟踪koa运行的轨迹const koa = require('koa')const app = new koa()app.use(async (ctx, next) => { console.log(33) ctx.body = { status: true }})app.listen(3000,() => { console.log("server is running at 3000 port")})二、当app.l原创 2020-05-11 19:43:44 · 182 阅读 · 0 评论 -
koa基础-源码分析(二)
现在正式进入koa源码,找到koa文件下/lib/application.js文件一、依赖项const isGeneratorFunction = require('is-generator-function'); //判断是否为generator方法const debug = require('debug')('koa:application'); // debug命名空间const o...原创 2020-04-27 22:40:19 · 131 阅读 · 0 评论 -
Koa基础开篇(一)
项目Value电脑$1600手机$12导管$1Column 1Column 2centereright-aligned 文本居右原创 2020-04-27 00:22:53 · 177 阅读 · 0 评论