1.2.1 • Published 4 years ago
egg-serverless-inner-auth v1.2.1
使用
- 1、在plugin启用插件
innerAuth: {
enable: true,
package: 'egg-serverless-inner-auth',
},
- 2、参数配置
config.serverlessInnerAuth = {
//需要验证的前缀
prefix: "inner",
//密钥
secret: "",
//内网域名
host: "http://localhost",
//有效时长(s)
expire: 10,
//返回状态码
status: 200,
//返回信息
message: '内部错误',
//返回信息内的code
code: 1001
};
- 3、启用中间件
// 中间件
config.middleware = ['innerAuthority'];
- 4、调用请求方法
//域名及前缀都在配置里,如请求 http://127.0.0.1/inner/order
const data = await this.app.innerRequest('/order', {})
1.2.0
4 years ago
1.2.1
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago