kk-koa-framework
Advanced tools
Comparing version 2.0.4 to 2.0.6
@@ -6,3 +6,3 @@ { | ||
"name": "kk-koa-framework", | ||
"version": "2.0.4", | ||
"version": "2.0.6", | ||
"description": "kk koa mvc webframework", | ||
@@ -22,2 +22,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"axios": "^0.18.0", | ||
"consolidate": "^0.15.0", | ||
@@ -31,4 +32,5 @@ "get-paths": "0.0.2", | ||
"lodash": "^4.17.5", | ||
"pug": "^2.0.0-rc.4" | ||
"pug": "^2.0.0-rc.4", | ||
"uid2": "^0.0.3" | ||
} | ||
} |
@@ -71,1 +71,3 @@ class Passport{ | ||
module.exports.AutoLoginStrategy = require('./autoLogin') | ||
module.exports.WeixinStrategy = require('./weixinLogin') |
@@ -5,3 +5,3 @@ const Koa = require('../index') | ||
const {RegisterStrategy} = passport | ||
const {RegisterStrategy, WeixinStrategy} = passport | ||
@@ -12,3 +12,3 @@ const app = new Koa() | ||
passport.use(new RegisterStrategy(null,({username,password},done)=>{ | ||
passport.use(new RegisterStrategy(()=>{},({username,password},done)=>{ | ||
console.log('enter register') | ||
@@ -18,2 +18,11 @@ done(null) | ||
passport.use(new WeixinStrategy({ | ||
clientID: 'wxb466441ce83229ba' | ||
, clientSecret: '64fa70131050c949cc114687cd448171' | ||
, callbackURL: 'http://m.leasio.com/weixinLogin' | ||
}, (params) => { | ||
console.log("param:", params) | ||
return params | ||
})) | ||
app.setup() | ||
@@ -20,0 +29,0 @@ |
@@ -15,2 +15,6 @@ const {passport} = require('../../../index') | ||
module.exports.weixinLogin = [passport.authenticate('weixinLogin'),async (ctx,next)=>{ | ||
ctx.body = ctx.session.profile | ||
}] | ||
module.exports.meta = { | ||
@@ -23,3 +27,6 @@ index:{ | ||
url:'/login' | ||
}, | ||
weixinLogin:{ | ||
url:'/weixinLogin' | ||
} | ||
} |
42675
37
1064
11
+ Addedaxios@^0.18.0
+ Addeduid2@^0.0.3
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)
+ Addeduid2@0.0.3(transitive)
- Removeddebug@3.2.7(transitive)
- Removedms@2.1.3(transitive)