mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 20:19:16 +08:00
chore: 使用TextNode替换String
This commit is contained in:
parent
17b66fceea
commit
100ff999fb
@ -1,5 +1,6 @@
|
||||
package io.metersphere.system.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.node.TextNode;
|
||||
import io.metersphere.sdk.constants.PermissionConstants;
|
||||
import io.metersphere.system.dto.sdk.LicenseDTO;
|
||||
import io.metersphere.system.service.LicenseService;
|
||||
@ -29,12 +30,10 @@ public class LicenseController {
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "添加有效的License")
|
||||
@RequiresPermissions(value= {PermissionConstants.SYSTEM_AUTH_READ, PermissionConstants.SYSTEM_AUTH_READ_UPDATE}, logical = Logical.OR)
|
||||
public LicenseDTO addLicense(@RequestBody String licenseCode) {
|
||||
public LicenseDTO addLicense(@RequestBody TextNode licenseCode) {
|
||||
LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class);
|
||||
// 前端传入的JSON会被加上双引号,需要去掉
|
||||
licenseCode = StringUtils.strip(licenseCode, "\"");
|
||||
if (licenseService != null) {
|
||||
return licenseService.addLicense(licenseCode, SessionUtils.getUserId());
|
||||
return licenseService.addLicense(licenseCode.asText(), SessionUtils.getUserId());
|
||||
}
|
||||
return new LicenseDTO();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user