mirror of
https://gitee.com/liweiyi/ChestnutCMS.git
synced 2025-12-06 16:38:24 +08:00
修正菜单缓存无效等
This commit is contained in:
parent
80c591e917
commit
2d0652812c
@ -44,6 +44,7 @@ import com.chestnut.contentcore.service.ICatalogService;
|
||||
import com.chestnut.contentcore.service.IPublishPipeService;
|
||||
import com.chestnut.contentcore.service.IPublishService;
|
||||
import com.chestnut.contentcore.service.ISiteService;
|
||||
import com.chestnut.contentcore.user.preference.CatalogTreeExpandModePreference;
|
||||
import com.chestnut.contentcore.util.CmsPrivUtils;
|
||||
import com.chestnut.contentcore.util.ConfigPropertyUtils;
|
||||
import com.chestnut.contentcore.util.InternalUrlUtils;
|
||||
@ -216,7 +217,11 @@ public class CatalogController extends BaseRestController {
|
||||
node.setDisabled(CatalogType_Link.ID.equals(catalog.getCatalogType()));
|
||||
}
|
||||
});
|
||||
return R.ok(Map.of("rows", treeData, "siteName", site.getName()));
|
||||
return R.ok(Map.of(
|
||||
"rows", treeData,
|
||||
"siteName", site.getName(),
|
||||
"expandMode", CatalogTreeExpandModePreference.getValue(loginUser))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -144,7 +144,7 @@ public abstract class AbstractContent<T> implements IContent<T> {
|
||||
content.setSiteId(catalog.getSiteId());
|
||||
content.setCatalogAncestors(catalog.getAncestors());
|
||||
content.setTopCatalog(CatalogUtils.getTopCatalog(catalog));
|
||||
content.setDeptId(Objects.nonNull(this.getOperator()) ? this.getOperator().getDeptId() : 0);
|
||||
content.setDeptId(Objects.requireNonNullElse(this.getOperator().getDeptId(), 0L));
|
||||
content.setContentType(this.getContentType());
|
||||
|
||||
content.setStatus(ContentStatus.DRAFT);
|
||||
|
||||
@ -35,8 +35,4 @@ public class AfterContentSaveEvent extends ApplicationEvent {
|
||||
this.content = content;
|
||||
this.add = add;
|
||||
}
|
||||
|
||||
public boolean isAdd() {
|
||||
return add;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -87,7 +87,7 @@ public class ResourceServiceImpl extends ServiceImpl<CmsResourceMapper, CmsResou
|
||||
String dir = resourceType.getUploadPath()
|
||||
+ LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + StringUtils.SLASH;
|
||||
// 下载图片
|
||||
byte[] imageBytes = HttpUtils.syncDownload(url);
|
||||
byte[] imageBytes = HttpUtils.syncDownload(url, true);
|
||||
Assert.notNull(imageBytes, () -> CommonErrorCode.REQUEST_FAILED.exception(url));
|
||||
|
||||
CmsResource resource = new CmsResource();
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2022-2024 兮玥(190785909@qq.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chestnut.contentcore.user.preference;
|
||||
|
||||
import com.chestnut.common.security.domain.LoginUser;
|
||||
import com.chestnut.common.utils.StringUtils;
|
||||
import com.chestnut.system.domain.SysUser;
|
||||
import com.chestnut.system.user.preference.IUserPreference;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 栏目树展开方式
|
||||
*
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class CatalogTreeExpandModePreference implements IUserPreference {
|
||||
|
||||
public static final String ID = "CatalogTreeExpandMode";
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "栏目树展开模式";
|
||||
}
|
||||
|
||||
public static String getValue(LoginUser loginUser) {
|
||||
SysUser user = (SysUser) loginUser.getUser();
|
||||
return MapUtils.getString(user.getPreferences(), ID, StringUtils.EMPTY);
|
||||
}
|
||||
}
|
||||
@ -29,6 +29,7 @@ import com.chestnut.seo.properties.BaiduPushAccessSecretProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.net.URI;
|
||||
@ -42,6 +43,7 @@ import java.util.Map;
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BaiduPushService {
|
||||
@ -72,10 +74,14 @@ public class BaiduPushService {
|
||||
|
||||
String apiUrl = StringUtils.messageFormat(API, domain, secret);
|
||||
String body = StringUtils.join(urls, "\n");
|
||||
String response = HttpUtils.post(URI.create(apiUrl), body, Map.of("Content-Type", "text/plain"));
|
||||
BaiduPushResult r = JacksonUtils.from(response, BaiduPushResult.class);
|
||||
r.setPublishPipeCode(pp.getCode());
|
||||
results.add(r);
|
||||
try {
|
||||
String response = HttpUtils.post(URI.create(apiUrl), body, Map.of("Content-Type", "text/plain"));
|
||||
BaiduPushResult r = JacksonUtils.from(response, BaiduPushResult.class);
|
||||
r.setPublishPipeCode(pp.getCode());
|
||||
results.add(r);
|
||||
} catch (Exception e) {
|
||||
log.error("Publish content to baidu failed!", e);
|
||||
}
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2022-2024 兮玥(190785909@qq.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chestnut.common.domain;
|
||||
|
||||
/**
|
||||
* 树展开模式
|
||||
*
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
public enum TreeExpandMode {
|
||||
|
||||
/**
|
||||
* 普通模式
|
||||
*/
|
||||
Normal,
|
||||
|
||||
/**
|
||||
* 手风琴模式
|
||||
*/
|
||||
Accordion
|
||||
}
|
||||
@ -93,6 +93,11 @@ public class TreeNode<T> implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> TreeVO<T> build(List<TreeNode<T>> list, String rootName) {
|
||||
List<TreeNode<T>> treeNodes = build(list);
|
||||
return TreeVO.newInstance(rootName, treeNodes);
|
||||
}
|
||||
|
||||
public TreeNode(T nodeId, T parentId, String nodeName, boolean isRoot) {
|
||||
this.id = nodeId;
|
||||
this.parentId = parentId;
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2022-2024 兮玥(190785909@qq.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chestnut.common.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TreeVO
|
||||
*
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class TreeVO<T> {
|
||||
|
||||
public static final TreeVO<?> EMPTY = TreeVO.newInstance("", List.of());
|
||||
|
||||
private String rootName;
|
||||
|
||||
private List<TreeNode<T>> treeNodes;
|
||||
|
||||
private TreeExpandMode expandMode = TreeExpandMode.Normal;
|
||||
|
||||
public TreeVO(String rootName, List<TreeNode<T>> treeNodes) {
|
||||
this.rootName = rootName;
|
||||
this.treeNodes = treeNodes;
|
||||
}
|
||||
|
||||
public TreeVO(String rootName, List<TreeNode<T>> treeNodes, TreeExpandMode expandMode) {
|
||||
this.rootName = rootName;
|
||||
this.treeNodes = treeNodes;
|
||||
this.expandMode = expandMode;
|
||||
}
|
||||
|
||||
public static <T> TreeVO<T> newInstance(String rootName, List<TreeNode<T>> treeNodes) {
|
||||
return new TreeVO<T>(rootName, treeNodes);
|
||||
}
|
||||
|
||||
public static <T> TreeVO<T> newInstance(String rootName, List<TreeNode<T>> treeNodes, TreeExpandMode expandMode) {
|
||||
return new TreeVO<T>(rootName, treeNodes, expandMode);
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,9 @@ package com.chestnut.common.utils;
|
||||
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
@ -27,6 +30,10 @@ import java.net.http.HttpRequest.BodyPublishers;
|
||||
import java.net.http.HttpResponse.BodyHandlers;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@ -44,6 +51,40 @@ public class HttpUtils {
|
||||
return USER_AGENTS[index];
|
||||
}
|
||||
|
||||
private static SSLContext trustAllSSLContext() throws NoSuchAlgorithmException, KeyManagementException {
|
||||
TrustManager[] trustAllCerts = new TrustManager[] {
|
||||
new X509TrustManager() {
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
sslContext.init(null, trustAllCerts, new SecureRandom());
|
||||
return sslContext;
|
||||
}
|
||||
|
||||
private static HttpClient buildHttpClient() throws NoSuchAlgorithmException, KeyManagementException {
|
||||
return buildHttpClient(false);
|
||||
}
|
||||
|
||||
private static HttpClient buildHttpClient(boolean ignoreSSL) throws NoSuchAlgorithmException, KeyManagementException {
|
||||
return buildHttpClient(ignoreSSL, Duration.ofSeconds(30));
|
||||
}
|
||||
|
||||
private static HttpClient buildHttpClient(boolean ignoreSSL, Duration connectTimeout) throws NoSuchAlgorithmException, KeyManagementException {
|
||||
HttpClient.Builder builder = HttpClient.newBuilder()
|
||||
.connectTimeout(Objects.requireNonNullElse(connectTimeout, Duration.ofSeconds(30)))
|
||||
.followRedirects(Redirect.ALWAYS);
|
||||
if (ignoreSSL) {
|
||||
builder.sslContext(trustAllSSLContext());
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起一个简单的GET请求,同步返回字符串结果
|
||||
* <p>
|
||||
@ -69,26 +110,19 @@ public class HttpUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static String post(URI uri, String body, Map<String, String> headers) {
|
||||
try {
|
||||
if (Objects.isNull(body)) {
|
||||
body = StringUtils.EMPTY;
|
||||
}
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.followRedirects(Redirect.ALWAYS)
|
||||
.build();
|
||||
HttpRequest.Builder builder = HttpRequest.newBuilder(uri)
|
||||
.POST(BodyPublishers.ofString(body, StandardCharsets.UTF_8));
|
||||
headers.forEach(builder::header);
|
||||
if (!headers.containsKey("Content-Type")) {
|
||||
builder.header("Content-Type", "application/json");
|
||||
}
|
||||
HttpRequest httpRequest = builder.build();
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofString()).body();
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
public static String post(URI uri, String body, Map<String, String> headers) throws Exception {
|
||||
if (Objects.isNull(body)) {
|
||||
body = StringUtils.EMPTY;
|
||||
}
|
||||
HttpClient httpClient = buildHttpClient(true);
|
||||
HttpRequest.Builder builder = HttpRequest.newBuilder(uri)
|
||||
.POST(BodyPublishers.ofString(body, StandardCharsets.UTF_8));
|
||||
headers.forEach(builder::header);
|
||||
if (!headers.containsKey("Content-Type")) {
|
||||
builder.header("Content-Type", "application/json");
|
||||
}
|
||||
HttpRequest httpRequest = builder.build();
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofString()).body();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,79 +136,33 @@ public class HttpUtils {
|
||||
* @param jsonBody
|
||||
* @return
|
||||
*/
|
||||
public static String postJSON(URI uri, String jsonBody){
|
||||
public static String postJSON(URI uri, String jsonBody) throws Exception {
|
||||
return post(uri, jsonBody, Map.of("User-Agent", USER_AGENTS[0]));
|
||||
}
|
||||
|
||||
public static byte[] syncDownload(String uri) {
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.followRedirects(Redirect.ALWAYS)
|
||||
.build();
|
||||
|
||||
public static byte[] syncDownload(String uri) throws Exception {
|
||||
return syncDownload(uri, false);
|
||||
}
|
||||
|
||||
public static byte[] syncDownload(String uri, boolean ignoreSSL) throws Exception {
|
||||
HttpClient httpClient = buildHttpClient(ignoreSSL);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
|
||||
.setHeader("User-Agent", randomUserAgent())
|
||||
.GET().build();
|
||||
try {
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofByteArray()).body();
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofByteArray()).body();
|
||||
}
|
||||
|
||||
public static InputStream syncDownloadInputStream(String uri) throws Exception {
|
||||
return syncDownloadInputStream(uri, true);
|
||||
}
|
||||
|
||||
public static InputStream syncDownloadInputStream(String uri) {
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.followRedirects(Redirect.ALWAYS)
|
||||
.build();
|
||||
public static InputStream syncDownloadInputStream(String uri, boolean ignoreSSL) throws Exception {
|
||||
HttpClient httpClient = buildHttpClient(ignoreSSL);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
|
||||
.setHeader("User-Agent", randomUserAgent())
|
||||
.GET().build();
|
||||
try {
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofInputStream()).body();
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
syncDownload("http://www.liandu24.com/wp-content/uploads/2023/07/2023070513161507784652.png");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过丢弃响应体的get请求获取响应头信息,抛弃get响应body
|
||||
*
|
||||
* @param uri
|
||||
* @param headerName
|
||||
* @return
|
||||
*/
|
||||
public static String getDiscardingContentType(String uri) {
|
||||
return getDiscardingHeader(uri, "content-type");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过丢弃响应体的get请求获取响应头信息,抛弃get响应body
|
||||
*
|
||||
* @param uri
|
||||
* @param headerName
|
||||
* @return
|
||||
*/
|
||||
public static String getDiscardingHeader(String uri, String headerName) {
|
||||
try {
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.followRedirects(Redirect.ALWAYS)
|
||||
.build();
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
|
||||
.setHeader("User-Agent", randomUserAgent())
|
||||
.GET().build();
|
||||
Optional<String> headerValue = httpClient.send(httpRequest, BodyHandlers.discarding()).headers().firstValue(headerName);
|
||||
if (headerValue.isPresent()) {
|
||||
return headerValue.get();
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return null;
|
||||
return httpClient.send(httpRequest, BodyHandlers.ofInputStream()).body();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -183,18 +171,39 @@ public class HttpUtils {
|
||||
* @param uri
|
||||
* @param destPath
|
||||
*/
|
||||
public static void asyncDownload(String uri, Path destPath) {
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(30))
|
||||
.followRedirects(Redirect.ALWAYS)
|
||||
.build();
|
||||
public static void asyncDownload(String uri, Path destPath) throws Exception {
|
||||
HttpClient httpClient = buildHttpClient(true);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
|
||||
.setHeader("User-Agent", randomUserAgent())
|
||||
.GET().build();
|
||||
httpClient.sendAsync(httpRequest, BodyHandlers.ofFile(destPath));
|
||||
}
|
||||
|
||||
public static void asyncDownload(String uri, String destPath) {
|
||||
public static void asyncDownload(String uri, String destPath) throws Exception {
|
||||
asyncDownload(uri, Path.of(destPath));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过丢弃响应体的get请求获取响应头信息,抛弃get响应body
|
||||
*
|
||||
* @param uri
|
||||
*/
|
||||
public static String getDiscardingContentType(String uri) throws Exception {
|
||||
return getDiscardingHeader(uri, "content-type");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过丢弃响应体的get请求获取响应头信息,抛弃get响应body
|
||||
*
|
||||
* @param uri
|
||||
* @param headerName
|
||||
*/
|
||||
public static String getDiscardingHeader(String uri, String headerName) throws Exception {
|
||||
HttpClient httpClient = buildHttpClient(true);
|
||||
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
|
||||
.setHeader("User-Agent", randomUserAgent())
|
||||
.GET().build();
|
||||
Optional<String> headerValue = httpClient.send(httpRequest, BodyHandlers.discarding()).headers().firstValue(headerName);
|
||||
return headerValue.orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ public class FileExUtils {
|
||||
* @param url 图片地址
|
||||
* @return 图片后缀
|
||||
*/
|
||||
public static String getImageSuffix(String url) {
|
||||
public static String getImageSuffix(String url) throws Exception {
|
||||
String extension = getExtension(url);
|
||||
if (StringUtils.isEmpty(extension)) {
|
||||
// 尝试从response.header.content-type获取
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2022-2024 兮玥(190785909@qq.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chestnut.common.validation;
|
||||
|
||||
/**
|
||||
* 校验分组:新建
|
||||
*
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
public interface AddGroup {}
|
||||
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2022-2024 兮玥(190785909@qq.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.chestnut.common.validation;
|
||||
|
||||
/**
|
||||
* 校验分组:编辑
|
||||
*
|
||||
* @author 兮玥
|
||||
* @email 190785909@qq.com
|
||||
*/
|
||||
public interface EditGroup { }
|
||||
@ -27,12 +27,15 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 全局异常处理器
|
||||
*
|
||||
@ -112,6 +115,9 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(BindException.class)
|
||||
public R<?> handleBindException(BindException e) {
|
||||
return R.fail(e.getMessage());
|
||||
String errMsg = e.getBindingResult().getAllErrors().stream()
|
||||
.map(DefaultMessageSourceResolvable::getDefaultMessage)
|
||||
.collect(Collectors.joining("\n"));
|
||||
return R.fail(errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,10 +41,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -67,7 +64,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
*/
|
||||
@Override
|
||||
public List<RouterVO> buildRouters(List<SysMenu> menus) {
|
||||
List<RouterVO> routers = new LinkedList<RouterVO>();
|
||||
List<RouterVO> routers = new LinkedList<>();
|
||||
for (SysMenu menu : menus) {
|
||||
RouterVO router = new RouterVO();
|
||||
router.setHidden(YesOrNo.isNo(menu.getVisible()));
|
||||
@ -75,34 +72,34 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
router.setPath(getRouterPath(menu));
|
||||
router.setComponent(getComponent(menu));
|
||||
router.setQuery(menu.getQuery());
|
||||
router.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), YesOrNo.isYes(menu.getIsCache()),
|
||||
router.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), YesOrNo.isNo(menu.getIsCache()),
|
||||
menu.getPath()));
|
||||
List<SysMenu> cMenus = menu.getChildren();
|
||||
if (!cMenus.isEmpty() && cMenus.size() > 0 && MenuType.isDirectory(menu.getMenuType())) {
|
||||
if (!cMenus.isEmpty() && MenuType.isDirectory(menu.getMenuType())) {
|
||||
router.setAlwaysShow(true);
|
||||
router.setRedirect("noRedirect");
|
||||
router.setChildren(buildRouters(cMenus));
|
||||
} else if (isMenuFrame(menu)) {
|
||||
router.setMeta(null);
|
||||
List<RouterVO> childrenList = new ArrayList<RouterVO>();
|
||||
List<RouterVO> childrenList = new ArrayList<>();
|
||||
RouterVO children = new RouterVO();
|
||||
children.setPath(menu.getPath());
|
||||
children.setComponent(menu.getComponent());
|
||||
children.setName(StringUtils.capitalize(menu.getPath()));
|
||||
children.setName(parseRouteName(menu));
|
||||
children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(),
|
||||
YesOrNo.isYes(menu.getIsCache()), menu.getPath()));
|
||||
YesOrNo.isNo(menu.getIsCache()), menu.getPath()));
|
||||
children.setQuery(menu.getQuery());
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
|
||||
router.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon()));
|
||||
router.setPath("/");
|
||||
List<RouterVO> childrenList = new ArrayList<RouterVO>();
|
||||
List<RouterVO> childrenList = new ArrayList<>();
|
||||
RouterVO children = new RouterVO();
|
||||
String routerPath = innerLinkReplaceEach(menu.getPath());
|
||||
children.setPath(routerPath);
|
||||
children.setComponent(MenuComponentType.InnerLink.name());
|
||||
children.setName(StringUtils.capitalize(routerPath));
|
||||
children.setName(parseRouteName(menu));
|
||||
children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), menu.getPath()));
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
@ -239,12 +236,15 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
* @return 路由名称
|
||||
*/
|
||||
public String getRouteName(SysMenu menu) {
|
||||
String routerName = StringUtils.capitalize(menu.getPath());
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (isMenuFrame(menu)) {
|
||||
routerName = StringUtils.EMPTY;
|
||||
if (StringUtils.isEmpty(menu.getComponent()) || isMenuFrame(menu)) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return routerName;
|
||||
return parseRouteName(menu);
|
||||
}
|
||||
|
||||
private String parseRouteName(SysMenu menu) {
|
||||
return Arrays.stream(menu.getComponent().split("/"))
|
||||
.map(StringUtils::capitalize).collect(Collectors.joining(""));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -330,9 +330,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
List<SysMenu> returnList = new ArrayList<>();
|
||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) {
|
||||
SysMenu t = (SysMenu) iterator.next();
|
||||
SysMenu t = iterator.next();
|
||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == parentId) {
|
||||
recursionFn(list, t);
|
||||
@ -344,9 +344,6 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*
|
||||
* @param list
|
||||
* @param t
|
||||
*/
|
||||
private void recursionFn(List<SysMenu> list, SysMenu t) {
|
||||
// 得到子节点列表
|
||||
@ -363,14 +360,12 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
||||
Iterator<SysMenu> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
SysMenu n = (SysMenu) it.next();
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
List<SysMenu> tlist = new ArrayList<>();
|
||||
for (SysMenu n : list) {
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
@ -378,13 +373,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
||||
return getChildList(list, t).size() > 0;
|
||||
return !getChildList(list, t).isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 内链域名特殊字符替换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String innerLinkReplaceEach(String path) {
|
||||
return StringUtils.replaceEach(path,
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.chestnut.system.user.preference;
|
||||
|
||||
import com.chestnut.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 用户偏好 配置项
|
||||
*
|
||||
@ -25,29 +27,26 @@ public interface IUserPreference {
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId();
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* 显示名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName();
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* 校验数据
|
||||
*
|
||||
* @param config
|
||||
*/
|
||||
public boolean validate(Object config);
|
||||
default boolean validate(Object config) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getDefaultValue();
|
||||
default Object getDefaultValue() {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ export default {
|
||||
SaveSuccess: "Save Success",
|
||||
EditSuccess: 'Edit Success',
|
||||
DeleteSuccess: 'Delete Success',
|
||||
CopySuccess: 'Copy Success',
|
||||
Yes: 'Yes',
|
||||
No: 'No',
|
||||
Enable: "Enable",
|
||||
@ -294,7 +295,10 @@ export default {
|
||||
StatIndex: "Statistics Default Menu",
|
||||
IncludeChildContent: "Include Children In Content List",
|
||||
OpenContentEditorW: "New Window For Content Editor",
|
||||
ShowContentSubTitle: "Show Content Subtitle"
|
||||
ShowContentSubTitle: "Show Content Subtitle",
|
||||
CatalogTreeExpandMode: "Catalog Tree Expand Mode",
|
||||
CatalogTreeExpandMode_Normal: "Common",
|
||||
CatalogTreeExpandMode_Accordion: "Accordion",
|
||||
},
|
||||
UserRole: {
|
||||
UserInfo: "User Information",
|
||||
@ -1092,6 +1096,7 @@ export default {
|
||||
},
|
||||
Placeholder: {
|
||||
Title: "Input content title",
|
||||
ImportCSS: "Select publish pipe style",
|
||||
},
|
||||
Title: "Title",
|
||||
SubTitle: "Subtitle",
|
||||
@ -1790,5 +1795,32 @@ export default {
|
||||
Query: "Input name..."
|
||||
}
|
||||
}
|
||||
},
|
||||
Flowable: {
|
||||
Category: {
|
||||
AddCategory: "Add Category",
|
||||
CategoryNamePlaceholder: "Input category name...",
|
||||
SortUp: "Move Up",
|
||||
SortDown: "Move Down",
|
||||
ParentCategory: "Parent",
|
||||
Name: "Name",
|
||||
TreeRootName: "Model Category",
|
||||
},
|
||||
Model: {
|
||||
Key: "Key",
|
||||
Name: "Name",
|
||||
Version: "Version",
|
||||
Status: "Status",
|
||||
Design: "Design",
|
||||
Suspend: "Suspend",
|
||||
Resume: "Resume",
|
||||
Category: "Category",
|
||||
AddModelTitle: "Add Model",
|
||||
DesignTitle: "Design Process",
|
||||
Placeholder: {
|
||||
ModelKey: "Input model key",
|
||||
ModelName: "Input model name"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -23,6 +23,7 @@ export default {
|
||||
SaveSuccess: "保存成功",
|
||||
EditSuccess: '修改成功',
|
||||
DeleteSuccess: '删除成功',
|
||||
CopySuccess: '复制成功',
|
||||
Yes: '是',
|
||||
No: '否',
|
||||
Enable: "启用",
|
||||
@ -294,7 +295,10 @@ export default {
|
||||
StatIndex: "统计分析默认菜单",
|
||||
IncludeChildContent: "内容列表是否显示子栏目内容",
|
||||
OpenContentEditorW: "内容编辑是否使用新窗口",
|
||||
ShowContentSubTitle: "默认显示内容副标题"
|
||||
ShowContentSubTitle: "默认显示内容副标题",
|
||||
CatalogTreeExpandMode: "栏目树展开模式",
|
||||
CatalogTreeExpandMode_Normal: "普通模式",
|
||||
CatalogTreeExpandMode_Accordion: "手风琴模式",
|
||||
},
|
||||
UserRole: {
|
||||
UserInfo: "用户信息",
|
||||
@ -1092,6 +1096,7 @@ export default {
|
||||
},
|
||||
Placeholder: {
|
||||
Title: "输入内容标题",
|
||||
ImportCSS: "选择发布通道样式",
|
||||
},
|
||||
Title: "标题",
|
||||
SubTitle: "副标题",
|
||||
@ -1793,5 +1798,32 @@ export default {
|
||||
Query: "输入名称"
|
||||
}
|
||||
}
|
||||
},
|
||||
Flowable: {
|
||||
Category: {
|
||||
AddCategory: "添加分类",
|
||||
CategoryNamePlaceholder: "输入分类名称",
|
||||
SortUp: "上移",
|
||||
SortDown: "下移",
|
||||
ParentCategory: "父级分类",
|
||||
Name: "名称",
|
||||
TreeRootName: "模型分类",
|
||||
},
|
||||
Model: {
|
||||
Key: "唯一标识",
|
||||
Name: "名称",
|
||||
Version: "版本",
|
||||
Status: "状态",
|
||||
Design: "设计",
|
||||
Suspend: "挂起",
|
||||
Resume: "恢复",
|
||||
Category: "所属分类",
|
||||
AddModelTitle: "新建模型",
|
||||
DesignTitle: "流程设计",
|
||||
Placeholder: {
|
||||
ModelKey: "输入模型标识",
|
||||
ModelName: "输入模型名称"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -23,6 +23,7 @@ export default {
|
||||
SaveSuccess: "保存成功",
|
||||
EditSuccess: '修改成功',
|
||||
DeleteSuccess: '刪除成功',
|
||||
CopySuccess: '複製成功',
|
||||
Yes: '是',
|
||||
No: '否',
|
||||
Enable: "啟用",
|
||||
@ -294,7 +295,10 @@ export default {
|
||||
StatIndex: "統計分析預設菜單",
|
||||
IncludeChildContent: "內容列表是否顯示子欄目內容",
|
||||
OpenContentEditorW: "內容編輯是否使用新窗口",
|
||||
ShowContentSubTitle: "預設顯示內容副標題"
|
||||
ShowContentSubTitle: "預設顯示內容副標題",
|
||||
CatalogTreeExpandMode: "欄目樹展開模式",
|
||||
CatalogTreeExpandMode_Normal: "普通模式",
|
||||
CatalogTreeExpandMode_Accordion: "手風琴模式",
|
||||
},
|
||||
UserRole: {
|
||||
UserInfo: "用戶資訊",
|
||||
@ -1092,6 +1096,7 @@ export default {
|
||||
},
|
||||
Placeholder: {
|
||||
Title: "輸入內容標題",
|
||||
ImportCSS: "選擇發佈通道樣式",
|
||||
},
|
||||
Title: "標題",
|
||||
SubTitle: "副標題",
|
||||
@ -1790,5 +1795,32 @@ export default {
|
||||
Query: "輸入名稱"
|
||||
}
|
||||
}
|
||||
},
|
||||
Flowable: {
|
||||
Category: {
|
||||
AddCategory: "添加分類",
|
||||
CategoryNamePlaceholder: "輸入分類名稱",
|
||||
SortUp: "上移",
|
||||
SortDown: "下移",
|
||||
ParentCategory: "父級分類",
|
||||
Name: "名稱",
|
||||
TreeRootName: "模型分類",
|
||||
},
|
||||
Model: {
|
||||
Key: "唯一標識",
|
||||
Name: "名稱",
|
||||
Version: "版本",
|
||||
Status: "狀態",
|
||||
Design: "設計",
|
||||
Suspend: "掛起",
|
||||
Resume: "恢復",
|
||||
Category: "所屬分類",
|
||||
AddModelTitle: "新建模型",
|
||||
DesignTitle: "設計流程",
|
||||
Placeholder: {
|
||||
ModelKey: "輸入模型唯一標識",
|
||||
ModelName: "輸入模型名稱"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -147,7 +147,7 @@ import { listAdSpaces, addAdSpace, editAdSpace, deleteAdSpace, publishAdSpace }
|
||||
import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector';
|
||||
|
||||
export default {
|
||||
name: "CMSAdSpace",
|
||||
name: "CmsAdAdSpace",
|
||||
components: {
|
||||
'cms-template-selector': CMSTemplateSelector
|
||||
},
|
||||
|
||||
@ -34,7 +34,7 @@ import CMSCatalogInfo from '@/views/cms/contentcore/catalogInfo';
|
||||
import CMSCatalogExtend from '@/views/cms/contentcore/catalogExtend';
|
||||
|
||||
export default {
|
||||
name: "CMSCatalog",
|
||||
name: "CmsContentcoreCatalog",
|
||||
components: {
|
||||
'cms-catalog-tree': CMSCatalogTree,
|
||||
'cms-catalog-info': CMSCatalogInfo,
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
:expand-on-click-node="false"
|
||||
:default-expanded-keys="treeExpandedKeys"
|
||||
:filter-node-method="filterNode"
|
||||
:accordion="expandMode=='accordion'"
|
||||
node-key="id"
|
||||
ref="tree"
|
||||
highlight-current
|
||||
@ -178,13 +179,14 @@ export default {
|
||||
// 栏目类型
|
||||
catalogTypeOptions: [],
|
||||
// 栏目树过滤:栏目名称
|
||||
filterCatalogName: undefined,
|
||||
filterCatalogName: "",
|
||||
// 栏目树数据
|
||||
catalogOptions: undefined,
|
||||
catalogOptions: [],
|
||||
// 站点名称
|
||||
siteName: undefined,
|
||||
siteName: "",
|
||||
expandMode: "",
|
||||
// 当前选中栏目ID
|
||||
selectedCatalogId: undefined,
|
||||
selectedCatalogId: "",
|
||||
treeExpandedKeys: [],
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
@ -244,6 +246,7 @@ export default {
|
||||
this.$cache.local.remove("LastSelectedCatalogId");
|
||||
}
|
||||
this.siteName = response.data.siteName;
|
||||
this.expandMode = response.data.expandMode;
|
||||
this.loading = false;
|
||||
this.$nextTick(() => {
|
||||
this.selectedCatalogId = this.$cache.local.get("LastSelectedCatalogId");
|
||||
|
||||
@ -31,7 +31,7 @@ import CMSPageWidget from '@/views/cms/contentcore/pageWidget';
|
||||
import CMSContentRecycleList from '@/views/cms/contentcore/contentRecycleList';
|
||||
|
||||
export default {
|
||||
name: "CMSContent",
|
||||
name: "CmsContentcoreContent",
|
||||
components: {
|
||||
'cms-catalog-tree': CMSCatalogTree,
|
||||
'cms-content-list': CMSContentList,
|
||||
|
||||
@ -147,14 +147,13 @@
|
||||
<el-tooltip class="item" effect="dark" :content="$t('CMS.Content.ImportCSSTip')" placement="top">
|
||||
<i class="el-icon-info" style="color:#909399;margin-right:16px;" />
|
||||
</el-tooltip>
|
||||
<el-radio-group v-model="ueditorImportCss" @change="handleChangeUEditorCSS()">
|
||||
<el-radio-button label="">无</el-radio-button>
|
||||
<el-radio-button
|
||||
v-for="pp in publishPipeProps"
|
||||
:key="pp.pipeCode"
|
||||
:label="pp.pipeCode"
|
||||
>{{ pp.pipeName }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-select v-model="ueditorImportCss" :placeholder="$t('CMS.Content.Placeholder.ImportCSS')" clearable @change="handleChangeUEditorCSS()">
|
||||
<el-option
|
||||
v-for="pp in publishPipeProps"
|
||||
:key="pp.pipeCode"
|
||||
:label="pp.pipeName"
|
||||
:value="pp.pipeCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -182,7 +182,7 @@ import { getDirectoryTreeData, getFileList, renameFile, addFile, deleteFile } fr
|
||||
import { getConfigKey } from "@/api/system/config";
|
||||
|
||||
export default {
|
||||
name: "CMSFile",
|
||||
name: "CmsContentcoreFile",
|
||||
data () {
|
||||
return {
|
||||
treeSideHeight: 600,
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
import { getPublishPipeList, getPublishPipeData, addPublishPipe, updatePublishPipe, delPublishPipe } from "@/api/contentcore/publishpipe";
|
||||
|
||||
export default {
|
||||
name: "CMSPublishPipe",
|
||||
name: "CmsContentcorePublishPipe",
|
||||
dicts: ['EnableOrDisable'],
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -171,7 +171,7 @@ import { getResourceTypes, getResrouceList, getResourceDetail, delResource } fro
|
||||
import { getConfigKey } from "@/api/system/config";
|
||||
|
||||
export default {
|
||||
name: "CmsResource",
|
||||
name: "CmsContentcoreResource",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -132,7 +132,7 @@ import { delSite, addSite, listSite, publishSite } from "@/api/contentcore/site
|
||||
import CMSProgress from '@/views/components/Progress';
|
||||
|
||||
export default {
|
||||
name: "Site",
|
||||
name: "CmsContentcoreSite",
|
||||
components: {
|
||||
'cms-progress': CMSProgress,
|
||||
},
|
||||
|
||||
@ -191,7 +191,7 @@ import { getConfigKey } from "@/api/system/config"
|
||||
import { getTemplateList, getTemplateDetail, renameTemplate, addTemplate, delTemplate, clearIncludeCache } from "@/api/contentcore/template";
|
||||
|
||||
export default {
|
||||
name: "CmsTemplate",
|
||||
name: "CmsContentcoreTemplate",
|
||||
data () {
|
||||
const validatePath = (rule, value, callback) => {
|
||||
if (!value || value.length == 0 || !value.endsWith(this.templateSuffix)) {
|
||||
|
||||
@ -224,7 +224,7 @@ import { listCustomForms, getCustomForm, addCustomForm, editCustomForm, deleteCu
|
||||
import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector';
|
||||
|
||||
export default {
|
||||
name: "CustomFormList",
|
||||
name: "CmsCustomformIndex",
|
||||
dicts: [ 'CustomFormStatus', 'CustomFormRule' ],
|
||||
components: {
|
||||
'cms-template-selector': CMSTemplateSelector,
|
||||
|
||||
@ -123,7 +123,7 @@ import { listModelDataTables } from "@/api/meta/model";
|
||||
import { addXModel, editXModel, deleteXModel, listXModel } from "@/api/contentcore/exmodel";
|
||||
|
||||
export default {
|
||||
name: "CMSEXmodel",
|
||||
name: "CmsExmodelModel",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -134,7 +134,7 @@ import { codeValidator } from '@/utils/validate'
|
||||
import { getLinkGroupList, addLinkGroup, editLinkGroup, deleteLinkGroup } from "@/api/link/linkGroup";
|
||||
|
||||
export default {
|
||||
name: "CmsLinkGroup",
|
||||
name: "CmsLinkLinkGroup",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -140,7 +140,7 @@ import { getContentTypes } from "@/api/contentcore/catalog";
|
||||
import { getContentIndexList, deleteContentIndex, rebuildIndex } from "@/api/contentcore/search";
|
||||
|
||||
export default {
|
||||
name: "CMSIndexList",
|
||||
name: "CmsSearchIndexList",
|
||||
dicts: ['CMSContentStatus', 'CMSContentAttribute'],
|
||||
components: {
|
||||
'cms-progress': CMSProgress
|
||||
|
||||
@ -23,7 +23,7 @@ import CMSDynamicTemplate from '@/views/cms/staticize/dynamicList';
|
||||
import CMSCustomDynamicTemplate from '@/views/cms/staticize/customDynamicList';
|
||||
|
||||
export default {
|
||||
name: "CMSStaticize",
|
||||
name: "CmsStaticizeIndex",
|
||||
components: {
|
||||
'cms-template-tag': CMSTemplateTag,
|
||||
'cms-template-function': CMSTemplateFunc,
|
||||
|
||||
@ -25,7 +25,7 @@ import CMSSensitiveWord from '@/views/word/sensitiveWord';
|
||||
import CMSErrorProneWord from '@/views/word/errorProneWord';
|
||||
|
||||
export default {
|
||||
name: "CMSWordTab",
|
||||
name: "CmsWordWord",
|
||||
components: {
|
||||
'cms-tag-word': CMSTagWord,
|
||||
'cms-hot-word': CMSHotWord,
|
||||
|
||||
@ -212,7 +212,7 @@ import { getCommentList, getCommentReplyList, getCommentLikeList, deleteComments
|
||||
import CommentLikeDialog from '@/views/comment/commentLike';
|
||||
|
||||
export default {
|
||||
name: "CommentList",
|
||||
name: "CommentCommentList",
|
||||
components: {
|
||||
"comment-like-dialog": CommentLikeDialog
|
||||
},
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<div slot="content">
|
||||
{{ generateIconCode(item) }}
|
||||
</div>
|
||||
<div class="icon-item">
|
||||
<div class="icon-item" v-clipboard:copy="generateIconCode(item)" v-clipboard:success="clipboardSuccess">
|
||||
<svg-icon :icon-class="item" class-name="disabled" />
|
||||
<span>{{ item }}</span>
|
||||
</div>
|
||||
@ -24,9 +24,9 @@
|
||||
<div slot="content">
|
||||
{{ generateElementIconCode(item) }}
|
||||
</div>
|
||||
<div class="icon-item">
|
||||
<i :class="'el-icon-' + item" />
|
||||
<span>{{ item }}</span>
|
||||
<div class="icon-item" >
|
||||
<i :class="'el-icon-' + item" v-clipboard:copy="generateElementIconCode(item)" v-clipboard:success="clipboardSuccess" />
|
||||
<span v-clipboard:copy="'el-icon-' + item" v-clipboard:success="clipboardSuccess">{{ item }}</span>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@ import svgIcons from './svg-icons'
|
||||
import elementIcons from './element-icons'
|
||||
|
||||
export default {
|
||||
name: 'Icons',
|
||||
name: 'ComponentsIconsIndex',
|
||||
data() {
|
||||
return {
|
||||
svgIcons,
|
||||
@ -53,6 +53,9 @@ export default {
|
||||
},
|
||||
generateElementIconCode(symbol) {
|
||||
return `<i class="el-icon-${symbol}" />`
|
||||
},
|
||||
clipboardSuccess() {
|
||||
this.$modal.msgSuccess(this.$t('Common.CopySuccess'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ import { getLevelTypes } from "@/api/member/levelConfig";
|
||||
import { getExpOperations, getExpConfigList, getExpConfigDetail, addExpConfig, updateExpConfig, deleteExpConfigs } from "@/api/member/expConfig";
|
||||
|
||||
export default {
|
||||
name: "MemberExpOperation",
|
||||
name: "MemberExpConfig",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
import { getLevelTypes, getLevelConfigList, getLevelConfigDetail, addLevelConfig, updateLevelConfig, deleteLevelConfigs } from "@/api/member/levelConfig";
|
||||
|
||||
export default {
|
||||
name: "MemberExpOperation",
|
||||
name: "MemberLevelConfig",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -236,7 +236,7 @@ import { isBlank, validEmail, validPhoneNumber } from '@/utils/validate';
|
||||
import { getMemberList, getMemberDetail, addMember, updateMember, deleteMembers, resetMemberPassword } from "@/api/member/member";
|
||||
|
||||
export default {
|
||||
name: "MemberList",
|
||||
name: "MemberMemberList",
|
||||
dicts: [ 'MemberStatus' ],
|
||||
data () {
|
||||
const validateMember = (rule, value, callback) => {
|
||||
|
||||
@ -99,7 +99,7 @@ import { MessageBox } from 'element-ui'
|
||||
import { getTaskList, stopTask, removeTask } from "@/api/system/async";
|
||||
|
||||
export default {
|
||||
name: "CmsAsyncTaskList",
|
||||
name: "MonitorAsyncIndex",
|
||||
data () {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -71,7 +71,7 @@ import { getCache } from "@/api/monitor/cache";
|
||||
import echarts from "echarts";
|
||||
|
||||
export default {
|
||||
name: "Cache",
|
||||
name: "MonitorCacheIndex",
|
||||
data() {
|
||||
return {
|
||||
// 统计命令信息
|
||||
|
||||
2
chestnut-ui/src/views/monitor/cache/list.vue
vendored
2
chestnut-ui/src/views/monitor/cache/list.vue
vendored
@ -160,7 +160,7 @@
|
||||
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache";
|
||||
|
||||
export default {
|
||||
name: "CacheList",
|
||||
name: "MonitorCacheList",
|
||||
data() {
|
||||
return {
|
||||
cacheNames: [],
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
import { getLogMenus } from "@/api/monitor/logs";
|
||||
|
||||
export default {
|
||||
name: "MonitorLogs",
|
||||
name: "MonitorLogsIndex",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
|
||||
@ -130,7 +130,7 @@
|
||||
import { list, delLogininfor, cleanLogininfor } from "@/api/monitor/logininfor";
|
||||
|
||||
export default {
|
||||
name: "Logininfor",
|
||||
name: "MonitorLogsLogininfor",
|
||||
dicts: ['SuccessOrFail'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -190,7 +190,7 @@
|
||||
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
|
||||
|
||||
export default {
|
||||
name: "Operlog",
|
||||
name: "MonitorLogsOperation",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
import { list, forceLogout } from "@/api/monitor/online";
|
||||
|
||||
export default {
|
||||
name: "Online",
|
||||
name: "MonitorOnlineIndex",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@ -229,7 +229,7 @@
|
||||
import { getServer } from "@/api/monitor/server";
|
||||
|
||||
export default {
|
||||
name: "Server",
|
||||
name: "MonitorServerIndex",
|
||||
data() {
|
||||
return {
|
||||
// 服务器信息
|
||||
|
||||
@ -249,7 +249,7 @@
|
||||
import { getTaskTypes, listTask, getTask, delTask, addTask, updateTask, enableTask, disableTask, executeTask, getTaskLogs, delTaskLogs } from "@/api/monitor/task";
|
||||
|
||||
export default {
|
||||
name: "ScheduledTask",
|
||||
name: "MonitorTaskIndex",
|
||||
dicts: ['YesOrNo', 'EnableOrDisable', 'SuccessOrFail'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -164,7 +164,7 @@ import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache
|
||||
import I18nEditor from '@/views/components/I18nFieldEditor';
|
||||
|
||||
export default {
|
||||
name: "Config",
|
||||
name: "SystemConfigIndex",
|
||||
components: {
|
||||
I18nEditor,
|
||||
},
|
||||
|
||||
@ -179,7 +179,7 @@ import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "Dept",
|
||||
name: "SystemDeptIndex",
|
||||
dicts: ['EnableOrDisable'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
|
||||
@ -170,7 +170,7 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@
|
||||
import I18nEditor from '@/views/components/I18nFieldEditor';
|
||||
|
||||
export default {
|
||||
name: "Dict",
|
||||
name: "SystemDictIndex",
|
||||
components: {
|
||||
I18nEditor,
|
||||
},
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
import { executeGroovySrcity } from "@/api/system/groovy";
|
||||
|
||||
export default {
|
||||
name: "SysGroovyScript",
|
||||
name: "SystemGroovyIndex",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
|
||||
@ -167,7 +167,7 @@
|
||||
import { listI18nDict, getI18nDict, delI18nDict, addI18nDict, updateI18nDict, refreshCache } from "@/api/system/i18nDict";
|
||||
|
||||
export default {
|
||||
name: "I18nDict",
|
||||
name: "SystemI18nIndex",
|
||||
dicts: [ 'I18nDictType' ],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -302,7 +302,7 @@ import IconSelect from "@/components/IconSelect";
|
||||
import I18nEditor from '../../components/I18nFieldEditor';
|
||||
|
||||
export default {
|
||||
name: "Menu",
|
||||
name: "SystemMenuIndex",
|
||||
dicts: ['YesOrNo', 'EnableOrDisable'],
|
||||
components: { Treeselect, IconSelect, I18nEditor },
|
||||
data() {
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
||||
|
||||
export default {
|
||||
name: "Notice",
|
||||
name: "SystemNoticeIndex",
|
||||
dicts: ['NoticeStatus', 'NoticeType'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -167,7 +167,7 @@
|
||||
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
|
||||
|
||||
export default {
|
||||
name: "Post",
|
||||
name: "SystemPostIndex",
|
||||
dicts: ['EnableOrDisable'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -214,7 +214,7 @@ import { listRole, getRole, delRole, addRole, updateRole, changeRoleStatus } fro
|
||||
import RolePermission from '@/views/system/permission/permsTab';
|
||||
|
||||
export default {
|
||||
name: "Role",
|
||||
name: "SystemRoleIndex",
|
||||
dicts: ['EnableOrDisable'],
|
||||
components: {
|
||||
'role-permission': RolePermission
|
||||
|
||||
@ -182,7 +182,7 @@
|
||||
import { listSecurityConfigs, getSecurityConfig, addSecurityConfig, saveSecurityConfig, deleteSecurityConfig, changeConfigStatus } from "@/api/system/security";
|
||||
|
||||
export default {
|
||||
name: "SysSecurityConfig",
|
||||
name: "SysSecurityIndex",
|
||||
dicts: [ "EnableOrDisable", "SecurityPasswordRule", "SecurityPasswordSensitive", "SecurityPasswordRetryStrategy" ],
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -340,7 +340,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import RolePermission from '@/views/system/permission/permsTab';
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
name: "SystemUserIndex",
|
||||
dicts: ['SysUserStatus', 'Gender', 'EnableOrDisable'],
|
||||
components: {
|
||||
Treeselect,
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
<el-form-item :label="$t('System.UserPreference.ShowContentSubTitle')" prop="ShowContentSubTitle">
|
||||
<el-switch
|
||||
v-model="form.ShowContentSubTitle"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
:active-text="$t('Common.Yes')"
|
||||
:inactive-text="$t('Common.No')"
|
||||
active-value="Y"
|
||||
inactive-value="N">
|
||||
</el-switch>
|
||||
@ -27,8 +27,8 @@
|
||||
<el-form-item :label="$t('System.UserPreference.IncludeChildContent')" prop="IncludeChildContent">
|
||||
<el-switch
|
||||
v-model="form.IncludeChildContent"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
:active-text="$t('Common.Yes')"
|
||||
:inactive-text="$t('Common.No')"
|
||||
active-value="Y"
|
||||
inactive-value="N">
|
||||
</el-switch>
|
||||
@ -36,12 +36,17 @@
|
||||
<el-form-item :label="$t('System.UserPreference.OpenContentEditorW')" prop="OpenContentEditorW">
|
||||
<el-switch
|
||||
v-model="form.OpenContentEditorW"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
:active-text="$t('Common.Yes')"
|
||||
:inactive-text="$t('Common.No')"
|
||||
active-value="Y"
|
||||
inactive-value="N">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('System.UserPreference.CatalogTreeExpandMode')" prop="CatalogTreeExpandMode">
|
||||
<el-select v-model="form.CatalogTreeExpandMode" clearable>
|
||||
<el-option :label="$t('System.UserPreference.CatalogTreeExpandMode_Accordion')" value="accordion"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="smjall" @click="handleSave">{{ $t('Common.Save') }}</el-button>
|
||||
</el-form-item>
|
||||
|
||||
@ -155,6 +155,7 @@ let oldActiveId
|
||||
let tempActiveData
|
||||
|
||||
export default {
|
||||
name: "ToolBuildIndex",
|
||||
components: {
|
||||
draggable,
|
||||
render,
|
||||
|
||||
@ -201,7 +201,7 @@ hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascri
|
||||
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
|
||||
|
||||
export default {
|
||||
name: "Gen",
|
||||
name: "ToolGenIndex",
|
||||
components: { importTable },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -218,7 +218,7 @@ import { codeValidator } from '@/utils/validate'
|
||||
import { getVoteUserTypes, getVoteList, getVoteDetail, addVote, updateVote, deleteVotes } from "@/api/vote/vote";
|
||||
|
||||
export default {
|
||||
name: "VoteList",
|
||||
name: "VoteIndex",
|
||||
dicts: [ 'VoteStatus', 'VoteViewType' ],
|
||||
components: {
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user