xiongzhu vor 2 Jahren
Ursprung
Commit
b34146e635
1 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. 6 6
      src/weixin/weixin.controller.ts

+ 6 - 6
src/weixin/weixin.controller.ts

@@ -1,4 +1,4 @@
-import { Controller, Get, Query } from '@nestjs/common'
+import { Body, Controller, Get, Post, Query } from '@nestjs/common'
 import { WeixinService } from './weixin.service'
 import { Public } from 'src/auth/public.decorator'
 import { ApiQuery, ApiTags } from '@nestjs/swagger'
@@ -14,10 +14,10 @@ export class WeixinController {
     }
 
     @Public()
-    @Get('/redirectUrl')
+    @Post('/redirectUrl')
     @ApiQuery({ name: 'url' })
-    public getRedirectUrl(@Query() { url, state }) {
-        return this.weixinService.getRedirectUrl(url, state)
+    public getRedirectUrl(@Body() { url, state }) {
+        return { url: this.weixinService.getRedirectUrl(url, state) }
     }
 
     @Public()
@@ -33,8 +33,8 @@ export class WeixinController {
     }
 
     @Public()
-    @Get('/jsapiSign')
-    public async jsapiSign(@Query() { url }) {
+    @Post('/jsapiSign')
+    public async jsapiSign(@Body() { url }) {
         return await this.weixinService.jsapiSign(url)
     }
 }