perf
This commit is contained in:
		| @@ -52,9 +52,11 @@ app | ||||
|       ctx.throw(400, 'Invalid state'); | ||||
|       return; | ||||
|     } | ||||
|     ctx.body = { | ||||
|       token, | ||||
|     }; | ||||
|     try { | ||||
|       ctx.body = JSON.parse(token); | ||||
|     } catch (error) { | ||||
|       ctx.throw(500, 'Invalid token get'); | ||||
|     } | ||||
|   }) | ||||
|   .addTo(app); | ||||
|  | ||||
| @@ -70,7 +72,7 @@ app | ||||
|       const wx = new WxServices(); | ||||
|       const token = await wx.login(code, 'mp'); | ||||
|       const redis = useContextKey('redis'); | ||||
|       await redis.set(`wx:mp:login:${state}`, token, 'EX', 10000); // 30秒过期 | ||||
|       await redis.set(`wx:mp:login:${state}`, JSON.stringify(token), 'EX', 10000); // 30秒过期 | ||||
|       ctx.body = { | ||||
|         token, | ||||
|       }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user