摘要: <p style="width:400px;"> <img src="images/bkjj.jpg" align="right" width="120" hspace="5" vspace="5"> HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局HTML文字环绕图片布局H 阅读全文
posted @ 2021-04-02 14:38 莣ㄋ噯 阅读(255) 评论(0) 推荐(0)
摘要: const mysql = require("mysql");const co = require("co-mysql");let conn = mysql.createPool({ host: "localhost", user: "root", password: "root", databas 阅读全文
posted @ 2021-04-02 11:01 莣ㄋ噯 阅读(79) 评论(0) 推荐(0)
摘要: /* 设置签名的 Cookie 密钥。 */app.keys = ["123", "456", "789", "111"];app.use(async ctx => { ctx.cookies.set("name", "age", { /* 设置cookies有效期 */ maxAge: 9 * 2 阅读全文
posted @ 2021-04-02 09:57 莣ㄋ噯 阅读(219) 评论(0) 推荐(0)
摘要: 第一种方法通过设置头部处理跨域 app.use(async (ctx, next) => { ctx.set("Access-Control-Allow-Origin", "http://192.168.31.45:63341"); /* 处理跨域携带cookie时出现的问题 */ ctx.set( 阅读全文
posted @ 2021-04-02 09:43 莣ㄋ噯 阅读(551) 评论(0) 推荐(0)
摘要: const serve = require("koa-static");const Router = require("koa-router"); app.use(serve("../static", { /* 文件的超时时间 */ maxage: 7 * 24 * 60 * 60 * 1000, 阅读全文
posted @ 2021-04-02 09:09 莣ㄋ噯 阅读(228) 评论(0) 推荐(0)