|
|
@@ -50,7 +50,7 @@ public class TencentAdsAuthController {
|
|
|
)
|
|
|
@GetMapping("/authorize-url")
|
|
|
public Map<String, Object> getAuthorizationUrl(
|
|
|
- @Parameter(description = "状态参数,用于防止CSRF攻击", example = "比如手机号码")
|
|
|
+ @Parameter(description = "验证请求有效性参数,值为用户自取,用于阻止跨站请求伪造攻击", example = "比如手机号码")
|
|
|
@RequestParam(required = false, defaultValue = "state") String state) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
try {
|
|
|
@@ -88,7 +88,7 @@ public class TencentAdsAuthController {
|
|
|
public Map<String, Object> callback(
|
|
|
@Parameter(description = "授权码,由腾讯广告平台回调时携带", required = true, example = "auth_code_example_123456")
|
|
|
@RequestParam("authorization_code") String authorizationCode,
|
|
|
- @Parameter(description = "状态参数,用于校验请求合法性", example = "手机号码")
|
|
|
+ @Parameter(description = "状态参数,用于校验请求合法性", example = "13099999999")
|
|
|
@RequestParam(required = false) String state) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
try {
|
|
|
@@ -225,10 +225,11 @@ public class TencentAdsAuthController {
|
|
|
)
|
|
|
@GetMapping("/user-token-url")
|
|
|
public Map<String, Object> getUserTokenUrl(
|
|
|
- @Parameter(description = "自定义参数,用于验证请求有效性", example = "比如手机号码")
|
|
|
- @RequestParam(required = false, defaultValue = "") String state) {
|
|
|
+ @Parameter(description = "手机号码,用于确定唯一性", example = "13099999999")
|
|
|
+ @RequestParam(required = true, defaultValue = "") String phone) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
try {
|
|
|
+ String state = phone;
|
|
|
String userTokenUrl = authService.getUserTokenUrl(state);
|
|
|
result.put("success", true);
|
|
|
result.put("data", userTokenUrl);
|