Merge #95 into master from cc_20260412_jwt_ge
fix * cc_20260412_jwt_ge: (7 commits squashed) - fix:营帐通JWT生成 - fix:营帐通JWT改为post - fix:修改secret - fix:配置 - fix:pc端营帐通jwt接口 - Merge branch 'master' into cc_20260412_jwt_ge - fix Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com> Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/95
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import cn.hutool.jwt.JWTUtil;
|
||||
import com.cool.store.request.YztTokenGenRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 三方验签
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2026/4/12
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/mini/third/token")
|
||||
@Api(tags = "三方验签")
|
||||
public class ThirdTokenController {
|
||||
|
||||
private static final long EXPIRE_SECONDS = 3600;
|
||||
|
||||
@Value("${third.party.appKey}")
|
||||
private String appKey;
|
||||
@Value("${third.party.secret}")
|
||||
private String secret;
|
||||
|
||||
@PostMapping("/generate")
|
||||
@ApiOperation("营帐通JWT")
|
||||
public ResponseResult<String> generateToken(@RequestBody @Validated YztTokenGenRequest request) {
|
||||
Map<String, Object> payload = new HashMap<>();
|
||||
payload.put("platform", "crm");
|
||||
payload.put("storeSn", request.getStoreNum());
|
||||
payload.put("appKey", appKey);
|
||||
payload.put("exp", System.currentTimeMillis() / 1000 + EXPIRE_SECONDS);
|
||||
return ResponseResult.success(JWTUtil.createToken(payload, secret.getBytes()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user