修正菜单缓存无效等

This commit is contained in:
liweiyi 2024-09-19 12:39:19 +08:00
parent 80c591e917
commit 2d0652812c
65 changed files with 1169 additions and 848 deletions

View File

@ -44,6 +44,7 @@ import com.chestnut.contentcore.service.ICatalogService;
import com.chestnut.contentcore.service.IPublishPipeService; import com.chestnut.contentcore.service.IPublishPipeService;
import com.chestnut.contentcore.service.IPublishService; import com.chestnut.contentcore.service.IPublishService;
import com.chestnut.contentcore.service.ISiteService; import com.chestnut.contentcore.service.ISiteService;
import com.chestnut.contentcore.user.preference.CatalogTreeExpandModePreference;
import com.chestnut.contentcore.util.CmsPrivUtils; import com.chestnut.contentcore.util.CmsPrivUtils;
import com.chestnut.contentcore.util.ConfigPropertyUtils; import com.chestnut.contentcore.util.ConfigPropertyUtils;
import com.chestnut.contentcore.util.InternalUrlUtils; import com.chestnut.contentcore.util.InternalUrlUtils;
@ -216,7 +217,11 @@ public class CatalogController extends BaseRestController {
node.setDisabled(CatalogType_Link.ID.equals(catalog.getCatalogType())); 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))
);
} }
/** /**

View File

@ -144,7 +144,7 @@ public abstract class AbstractContent<T> implements IContent<T> {
content.setSiteId(catalog.getSiteId()); content.setSiteId(catalog.getSiteId());
content.setCatalogAncestors(catalog.getAncestors()); content.setCatalogAncestors(catalog.getAncestors());
content.setTopCatalog(CatalogUtils.getTopCatalog(catalog)); 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.setContentType(this.getContentType());
content.setStatus(ContentStatus.DRAFT); content.setStatus(ContentStatus.DRAFT);

View File

@ -35,8 +35,4 @@ public class AfterContentSaveEvent extends ApplicationEvent {
this.content = content; this.content = content;
this.add = add; this.add = add;
} }
public boolean isAdd() {
return add;
}
} }

View File

@ -322,21 +322,20 @@ public class CatalogServiceImpl extends ServiceImpl<CmsCatalogMapper, CmsCatalog
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public CmsCatalog deleteCatalog(long catalogId, LoginUser operator) { public CmsCatalog deleteCatalog(long catalogId, LoginUser operator) {
CmsCatalog catalog = this.getById(catalogId); CmsCatalog catalog = this.getById(catalogId);
applicationContext.publishEvent(new BeforeCatalogDeleteEvent(this, catalog, operator));
AsyncTaskManager.setTaskMessage("正在删除栏目数据");
long childCount = lambdaQuery().eq(CmsCatalog::getParentId, catalog.getCatalogId()).count(); long childCount = lambdaQuery().eq(CmsCatalog::getParentId, catalog.getCatalogId()).count();
Assert.isTrue(childCount == 0, ContentCoreErrorCode.DEL_CHILD_FIRST::exception); Assert.isTrue(childCount == 0, ContentCoreErrorCode.DEL_CHILD_FIRST::exception);
// 删除前事件发布
applicationContext.publishEvent(new BeforeCatalogDeleteEvent(this, catalog, operator));
// 删除栏目
AsyncTaskManager.setTaskMessage("正在删除栏目数据");
if (catalog.getParentId() > 0) { if (catalog.getParentId() > 0) {
CmsCatalog parentCatalog = getById(catalog.getParentId()); CmsCatalog parentCatalog = getById(catalog.getParentId());
parentCatalog.setChildCount(parentCatalog.getChildCount() - 1); parentCatalog.setChildCount(parentCatalog.getChildCount() - 1);
updateById(parentCatalog); updateById(parentCatalog);
} }
// 删除栏目
removeById(catalogId); removeById(catalogId);
// 清除缓存
clearCache(catalog); clearCache(catalog);
applicationContext.publishEvent(new AfterCatalogDeleteEvent(this, catalog)); applicationContext.publishEvent(new AfterCatalogDeleteEvent(this, catalog));
return catalog; return catalog;
} }

View File

@ -87,7 +87,7 @@ public class ResourceServiceImpl extends ServiceImpl<CmsResourceMapper, CmsResou
String dir = resourceType.getUploadPath() String dir = resourceType.getUploadPath()
+ LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + StringUtils.SLASH; + 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)); Assert.notNull(imageBytes, () -> CommonErrorCode.REQUEST_FAILED.exception(url));
CmsResource resource = new CmsResource(); CmsResource resource = new CmsResource();

View File

@ -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);
}
}

View File

@ -29,6 +29,7 @@ import com.chestnut.seo.properties.BaiduPushAccessSecretProperty;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.net.URI; import java.net.URI;
@ -42,6 +43,7 @@ import java.util.Map;
* @author 兮玥 * @author 兮玥
* @email 190785909@qq.com * @email 190785909@qq.com
*/ */
@Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class BaiduPushService { public class BaiduPushService {
@ -72,10 +74,14 @@ public class BaiduPushService {
String apiUrl = StringUtils.messageFormat(API, domain, secret); String apiUrl = StringUtils.messageFormat(API, domain, secret);
String body = StringUtils.join(urls, "\n"); String body = StringUtils.join(urls, "\n");
try {
String response = HttpUtils.post(URI.create(apiUrl), body, Map.of("Content-Type", "text/plain")); String response = HttpUtils.post(URI.create(apiUrl), body, Map.of("Content-Type", "text/plain"));
BaiduPushResult r = JacksonUtils.from(response, BaiduPushResult.class); BaiduPushResult r = JacksonUtils.from(response, BaiduPushResult.class);
r.setPublishPipeCode(pp.getCode()); r.setPublishPipeCode(pp.getCode());
results.add(r); results.add(r);
} catch (Exception e) {
log.error("Publish content to baidu failed!", e);
}
}); });
return results; return results;
} }

View File

@ -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
}

View File

@ -93,6 +93,11 @@ public class TreeNode<T> implements Serializable {
return result; 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) { public TreeNode(T nodeId, T parentId, String nodeName, boolean isRoot) {
this.id = nodeId; this.id = nodeId;
this.parentId = parentId; this.parentId = parentId;

View File

@ -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);
}
}

View File

@ -17,6 +17,9 @@ package com.chestnut.common.utils;
import org.apache.commons.lang3.RandomUtils; 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.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URI; import java.net.URI;
@ -27,6 +30,10 @@ import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers; import java.net.http.HttpResponse.BodyHandlers;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Path; 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.time.Duration;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -44,6 +51,40 @@ public class HttpUtils {
return USER_AGENTS[index]; 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请求同步返回字符串结果 * 发起一个简单的GET请求同步返回字符串结果
* <p> * <p>
@ -69,15 +110,11 @@ public class HttpUtils {
} }
} }
public static String post(URI uri, String body, Map<String, String> headers) { public static String post(URI uri, String body, Map<String, String> headers) throws Exception {
try {
if (Objects.isNull(body)) { if (Objects.isNull(body)) {
body = StringUtils.EMPTY; body = StringUtils.EMPTY;
} }
HttpClient httpClient = HttpClient.newBuilder() HttpClient httpClient = buildHttpClient(true);
.connectTimeout(Duration.ofSeconds(30))
.followRedirects(Redirect.ALWAYS)
.build();
HttpRequest.Builder builder = HttpRequest.newBuilder(uri) HttpRequest.Builder builder = HttpRequest.newBuilder(uri)
.POST(BodyPublishers.ofString(body, StandardCharsets.UTF_8)); .POST(BodyPublishers.ofString(body, StandardCharsets.UTF_8));
headers.forEach(builder::header); headers.forEach(builder::header);
@ -86,9 +123,6 @@ public class HttpUtils {
} }
HttpRequest httpRequest = builder.build(); HttpRequest httpRequest = builder.build();
return httpClient.send(httpRequest, BodyHandlers.ofString()).body(); return httpClient.send(httpRequest, BodyHandlers.ofString()).body();
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
}
} }
/** /**
@ -102,79 +136,33 @@ public class HttpUtils {
* @param jsonBody * @param jsonBody
* @return * @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])); return post(uri, jsonBody, Map.of("User-Agent", USER_AGENTS[0]));
} }
public static byte[] syncDownload(String uri) {
HttpClient httpClient = HttpClient.newBuilder() public static byte[] syncDownload(String uri) throws Exception {
.connectTimeout(Duration.ofSeconds(30)) return syncDownload(uri, false);
.followRedirects(Redirect.ALWAYS) }
.build();
public static byte[] syncDownload(String uri, boolean ignoreSSL) throws Exception {
HttpClient httpClient = buildHttpClient(ignoreSSL);
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri)) HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
.setHeader("User-Agent", randomUserAgent()) .setHeader("User-Agent", randomUserAgent())
.GET().build(); .GET().build();
try {
return httpClient.send(httpRequest, BodyHandlers.ofByteArray()).body(); return httpClient.send(httpRequest, BodyHandlers.ofByteArray()).body();
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
}
} }
public static InputStream syncDownloadInputStream(String uri) { public static InputStream syncDownloadInputStream(String uri) throws Exception {
HttpClient httpClient = HttpClient.newBuilder() return syncDownloadInputStream(uri, true);
.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)) HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
.setHeader("User-Agent", randomUserAgent()) .setHeader("User-Agent", randomUserAgent())
.GET().build(); .GET().build();
try {
return httpClient.send(httpRequest, BodyHandlers.ofInputStream()).body(); 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;
} }
/** /**
@ -183,18 +171,39 @@ public class HttpUtils {
* @param uri * @param uri
* @param destPath * @param destPath
*/ */
public static void asyncDownload(String uri, Path destPath) { public static void asyncDownload(String uri, Path destPath) throws Exception {
HttpClient httpClient = HttpClient.newBuilder() HttpClient httpClient = buildHttpClient(true);
.connectTimeout(Duration.ofSeconds(30))
.followRedirects(Redirect.ALWAYS)
.build();
HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri)) HttpRequest httpRequest = HttpRequest.newBuilder(URI.create(uri))
.setHeader("User-Agent", randomUserAgent()) .setHeader("User-Agent", randomUserAgent())
.GET().build(); .GET().build();
httpClient.sendAsync(httpRequest, BodyHandlers.ofFile(destPath)); 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)); 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);
}
} }

View File

@ -150,7 +150,7 @@ public class FileExUtils {
* @param url 图片地址 * @param url 图片地址
* @return 图片后缀 * @return 图片后缀
*/ */
public static String getImageSuffix(String url) { public static String getImageSuffix(String url) throws Exception {
String extension = getExtension(url); String extension = getExtension(url);
if (StringUtils.isEmpty(extension)) { if (StringUtils.isEmpty(extension)) {
// 尝试从response.header.content-type获取 // 尝试从response.header.content-type获取

View File

@ -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 {}

View File

@ -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 { }

View File

@ -27,12 +27,15 @@ import lombok.RequiredArgsConstructor;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.validation.BindException; import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import java.util.stream.Collectors;
/** /**
* 全局异常处理器 * 全局异常处理器
* *
@ -112,6 +115,9 @@ public class GlobalExceptionHandler {
*/ */
@ExceptionHandler(BindException.class) @ExceptionHandler(BindException.class)
public R<?> handleBindException(BindException e) { 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);
} }
} }

View File

@ -41,10 +41,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -67,7 +64,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
*/ */
@Override @Override
public List<RouterVO> buildRouters(List<SysMenu> menus) { public List<RouterVO> buildRouters(List<SysMenu> menus) {
List<RouterVO> routers = new LinkedList<RouterVO>(); List<RouterVO> routers = new LinkedList<>();
for (SysMenu menu : menus) { for (SysMenu menu : menus) {
RouterVO router = new RouterVO(); RouterVO router = new RouterVO();
router.setHidden(YesOrNo.isNo(menu.getVisible())); router.setHidden(YesOrNo.isNo(menu.getVisible()));
@ -75,34 +72,34 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
router.setPath(getRouterPath(menu)); router.setPath(getRouterPath(menu));
router.setComponent(getComponent(menu)); router.setComponent(getComponent(menu));
router.setQuery(menu.getQuery()); 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())); menu.getPath()));
List<SysMenu> cMenus = menu.getChildren(); 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.setAlwaysShow(true);
router.setRedirect("noRedirect"); router.setRedirect("noRedirect");
router.setChildren(buildRouters(cMenus)); router.setChildren(buildRouters(cMenus));
} else if (isMenuFrame(menu)) { } else if (isMenuFrame(menu)) {
router.setMeta(null); router.setMeta(null);
List<RouterVO> childrenList = new ArrayList<RouterVO>(); List<RouterVO> childrenList = new ArrayList<>();
RouterVO children = new RouterVO(); RouterVO children = new RouterVO();
children.setPath(menu.getPath()); children.setPath(menu.getPath());
children.setComponent(menu.getComponent()); children.setComponent(menu.getComponent());
children.setName(StringUtils.capitalize(menu.getPath())); children.setName(parseRouteName(menu));
children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(),
YesOrNo.isYes(menu.getIsCache()), menu.getPath())); YesOrNo.isNo(menu.getIsCache()), menu.getPath()));
children.setQuery(menu.getQuery()); children.setQuery(menu.getQuery());
childrenList.add(children); childrenList.add(children);
router.setChildren(childrenList); router.setChildren(childrenList);
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
router.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon())); router.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon()));
router.setPath("/"); router.setPath("/");
List<RouterVO> childrenList = new ArrayList<RouterVO>(); List<RouterVO> childrenList = new ArrayList<>();
RouterVO children = new RouterVO(); RouterVO children = new RouterVO();
String routerPath = innerLinkReplaceEach(menu.getPath()); String routerPath = innerLinkReplaceEach(menu.getPath());
children.setPath(routerPath); children.setPath(routerPath);
children.setComponent(MenuComponentType.InnerLink.name()); children.setComponent(MenuComponentType.InnerLink.name());
children.setName(StringUtils.capitalize(routerPath)); children.setName(parseRouteName(menu));
children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), menu.getPath())); children.setMeta(new MetaVO(menu.getMenuName(), menu.getIcon(), menu.getPath()));
childrenList.add(children); childrenList.add(children);
router.setChildren(childrenList); router.setChildren(childrenList);
@ -239,12 +236,15 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
* @return 路由名称 * @return 路由名称
*/ */
public String getRouteName(SysMenu menu) { public String getRouteName(SysMenu menu) {
String routerName = StringUtils.capitalize(menu.getPath()); if (StringUtils.isEmpty(menu.getComponent()) || isMenuFrame(menu)) {
// 非外链并且是一级目录类型为目录 return StringUtils.EMPTY;
if (isMenuFrame(menu)) {
routerName = 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 @Override
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) { 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();) { for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) {
SysMenu t = (SysMenu) iterator.next(); SysMenu t = iterator.next();
// 根据传入的某个父节点ID,遍历该父节点的所有子节点 // 根据传入的某个父节点ID,遍历该父节点的所有子节点
if (t.getParentId() == parentId) { if (t.getParentId() == parentId) {
recursionFn(list, t); 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) { private void recursionFn(List<SysMenu> list, SysMenu t) {
// 得到子节点列表 // 得到子节点列表
@ -363,10 +360,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
* 得到子节点列表 * 得到子节点列表
*/ */
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) { private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
List<SysMenu> tlist = new ArrayList<SysMenu>(); List<SysMenu> tlist = new ArrayList<>();
Iterator<SysMenu> it = list.iterator(); for (SysMenu n : list) {
while (it.hasNext()) {
SysMenu n = (SysMenu) it.next();
if (n.getParentId().longValue() == t.getMenuId().longValue()) { if (n.getParentId().longValue() == t.getMenuId().longValue()) {
tlist.add(n); tlist.add(n);
} }
@ -378,13 +373,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
* 判断是否有子节点 * 判断是否有子节点
*/ */
private boolean hasChild(List<SysMenu> list, SysMenu t) { 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) { public String innerLinkReplaceEach(String path) {
return StringUtils.replaceEach(path, return StringUtils.replaceEach(path,

View File

@ -15,6 +15,8 @@
*/ */
package com.chestnut.system.user.preference; 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;
}
} }

View File

@ -23,6 +23,7 @@ export default {
SaveSuccess: "Save Success", SaveSuccess: "Save Success",
EditSuccess: 'Edit Success', EditSuccess: 'Edit Success',
DeleteSuccess: 'Delete Success', DeleteSuccess: 'Delete Success',
CopySuccess: 'Copy Success',
Yes: 'Yes', Yes: 'Yes',
No: 'No', No: 'No',
Enable: "Enable", Enable: "Enable",
@ -294,7 +295,10 @@ export default {
StatIndex: "Statistics Default Menu", StatIndex: "Statistics Default Menu",
IncludeChildContent: "Include Children In Content List", IncludeChildContent: "Include Children In Content List",
OpenContentEditorW: "New Window For Content Editor", 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: { UserRole: {
UserInfo: "User Information", UserInfo: "User Information",
@ -1092,6 +1096,7 @@ export default {
}, },
Placeholder: { Placeholder: {
Title: "Input content title", Title: "Input content title",
ImportCSS: "Select publish pipe style",
}, },
Title: "Title", Title: "Title",
SubTitle: "Subtitle", SubTitle: "Subtitle",
@ -1790,5 +1795,32 @@ export default {
Query: "Input name..." 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"
}
}
} }
}; };

View File

@ -23,6 +23,7 @@ export default {
SaveSuccess: "保存成功", SaveSuccess: "保存成功",
EditSuccess: '修改成功', EditSuccess: '修改成功',
DeleteSuccess: '删除成功', DeleteSuccess: '删除成功',
CopySuccess: '复制成功',
Yes: '是', Yes: '是',
No: '否', No: '否',
Enable: "启用", Enable: "启用",
@ -294,7 +295,10 @@ export default {
StatIndex: "统计分析默认菜单", StatIndex: "统计分析默认菜单",
IncludeChildContent: "内容列表是否显示子栏目内容", IncludeChildContent: "内容列表是否显示子栏目内容",
OpenContentEditorW: "内容编辑是否使用新窗口", OpenContentEditorW: "内容编辑是否使用新窗口",
ShowContentSubTitle: "默认显示内容副标题" ShowContentSubTitle: "默认显示内容副标题",
CatalogTreeExpandMode: "栏目树展开模式",
CatalogTreeExpandMode_Normal: "普通模式",
CatalogTreeExpandMode_Accordion: "手风琴模式",
}, },
UserRole: { UserRole: {
UserInfo: "用户信息", UserInfo: "用户信息",
@ -1092,6 +1096,7 @@ export default {
}, },
Placeholder: { Placeholder: {
Title: "输入内容标题", Title: "输入内容标题",
ImportCSS: "选择发布通道样式",
}, },
Title: "标题", Title: "标题",
SubTitle: "副标题", SubTitle: "副标题",
@ -1793,5 +1798,32 @@ export default {
Query: "输入名称" Query: "输入名称"
} }
} }
},
Flowable: {
Category: {
AddCategory: "添加分类",
CategoryNamePlaceholder: "输入分类名称",
SortUp: "上移",
SortDown: "下移",
ParentCategory: "父级分类",
Name: "名称",
TreeRootName: "模型分类",
},
Model: {
Key: "唯一标识",
Name: "名称",
Version: "版本",
Status: "状态",
Design: "设计",
Suspend: "挂起",
Resume: "恢复",
Category: "所属分类",
AddModelTitle: "新建模型",
DesignTitle: "流程设计",
Placeholder: {
ModelKey: "输入模型标识",
ModelName: "输入模型名称"
}
}
} }
}; };

View File

@ -23,6 +23,7 @@ export default {
SaveSuccess: "保存成功", SaveSuccess: "保存成功",
EditSuccess: '修改成功', EditSuccess: '修改成功',
DeleteSuccess: '刪除成功', DeleteSuccess: '刪除成功',
CopySuccess: '複製成功',
Yes: '是', Yes: '是',
No: '否', No: '否',
Enable: "啟用", Enable: "啟用",
@ -294,7 +295,10 @@ export default {
StatIndex: "統計分析預設菜單", StatIndex: "統計分析預設菜單",
IncludeChildContent: "內容列表是否顯示子欄目內容", IncludeChildContent: "內容列表是否顯示子欄目內容",
OpenContentEditorW: "內容編輯是否使用新窗口", OpenContentEditorW: "內容編輯是否使用新窗口",
ShowContentSubTitle: "預設顯示內容副標題" ShowContentSubTitle: "預設顯示內容副標題",
CatalogTreeExpandMode: "欄目樹展開模式",
CatalogTreeExpandMode_Normal: "普通模式",
CatalogTreeExpandMode_Accordion: "手風琴模式",
}, },
UserRole: { UserRole: {
UserInfo: "用戶資訊", UserInfo: "用戶資訊",
@ -1092,6 +1096,7 @@ export default {
}, },
Placeholder: { Placeholder: {
Title: "輸入內容標題", Title: "輸入內容標題",
ImportCSS: "選擇發佈通道樣式",
}, },
Title: "標題", Title: "標題",
SubTitle: "副標題", SubTitle: "副標題",
@ -1790,5 +1795,32 @@ export default {
Query: "輸入名稱" Query: "輸入名稱"
} }
} }
},
Flowable: {
Category: {
AddCategory: "添加分類",
CategoryNamePlaceholder: "輸入分類名稱",
SortUp: "上移",
SortDown: "下移",
ParentCategory: "父級分類",
Name: "名稱",
TreeRootName: "模型分類",
},
Model: {
Key: "唯一標識",
Name: "名稱",
Version: "版本",
Status: "狀態",
Design: "設計",
Suspend: "掛起",
Resume: "恢復",
Category: "所屬分類",
AddModelTitle: "新建模型",
DesignTitle: "設計流程",
Placeholder: {
ModelKey: "輸入模型唯一標識",
ModelName: "輸入模型名稱"
}
}
} }
}; };

View File

@ -147,7 +147,7 @@ import { listAdSpaces, addAdSpace, editAdSpace, deleteAdSpace, publishAdSpace }
import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector'; import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector';
export default { export default {
name: "CMSAdSpace", name: "CmsAdAdSpace",
components: { components: {
'cms-template-selector': CMSTemplateSelector 'cms-template-selector': CMSTemplateSelector
}, },

View File

@ -34,7 +34,7 @@ import CMSCatalogInfo from '@/views/cms/contentcore/catalogInfo';
import CMSCatalogExtend from '@/views/cms/contentcore/catalogExtend'; import CMSCatalogExtend from '@/views/cms/contentcore/catalogExtend';
export default { export default {
name: "CMSCatalog", name: "CmsContentcoreCatalog",
components: { components: {
'cms-catalog-tree': CMSCatalogTree, 'cms-catalog-tree': CMSCatalogTree,
'cms-catalog-info': CMSCatalogInfo, 'cms-catalog-info': CMSCatalogInfo,

View File

@ -35,6 +35,7 @@
:expand-on-click-node="false" :expand-on-click-node="false"
:default-expanded-keys="treeExpandedKeys" :default-expanded-keys="treeExpandedKeys"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:accordion="expandMode=='accordion'"
node-key="id" node-key="id"
ref="tree" ref="tree"
highlight-current highlight-current
@ -178,13 +179,14 @@ export default {
// //
catalogTypeOptions: [], catalogTypeOptions: [],
// //
filterCatalogName: undefined, filterCatalogName: "",
// //
catalogOptions: undefined, catalogOptions: [],
// //
siteName: undefined, siteName: "",
expandMode: "",
// ID // ID
selectedCatalogId: undefined, selectedCatalogId: "",
treeExpandedKeys: [], treeExpandedKeys: [],
defaultProps: { defaultProps: {
children: "children", children: "children",
@ -244,6 +246,7 @@ export default {
this.$cache.local.remove("LastSelectedCatalogId"); this.$cache.local.remove("LastSelectedCatalogId");
} }
this.siteName = response.data.siteName; this.siteName = response.data.siteName;
this.expandMode = response.data.expandMode;
this.loading = false; this.loading = false;
this.$nextTick(() => { this.$nextTick(() => {
this.selectedCatalogId = this.$cache.local.get("LastSelectedCatalogId"); this.selectedCatalogId = this.$cache.local.get("LastSelectedCatalogId");

View File

@ -31,7 +31,7 @@ import CMSPageWidget from '@/views/cms/contentcore/pageWidget';
import CMSContentRecycleList from '@/views/cms/contentcore/contentRecycleList'; import CMSContentRecycleList from '@/views/cms/contentcore/contentRecycleList';
export default { export default {
name: "CMSContent", name: "CmsContentcoreContent",
components: { components: {
'cms-catalog-tree': CMSCatalogTree, 'cms-catalog-tree': CMSCatalogTree,
'cms-content-list': CMSContentList, 'cms-content-list': CMSContentList,

View File

@ -147,14 +147,13 @@
<el-tooltip class="item" effect="dark" :content="$t('CMS.Content.ImportCSSTip')" placement="top"> <el-tooltip class="item" effect="dark" :content="$t('CMS.Content.ImportCSSTip')" placement="top">
<i class="el-icon-info" style="color:#909399;margin-right:16px;" /> <i class="el-icon-info" style="color:#909399;margin-right:16px;" />
</el-tooltip> </el-tooltip>
<el-radio-group v-model="ueditorImportCss" @change="handleChangeUEditorCSS()"> <el-select v-model="ueditorImportCss" :placeholder="$t('CMS.Content.Placeholder.ImportCSS')" clearable @change="handleChangeUEditorCSS()">
<el-radio-button label=""></el-radio-button> <el-option
<el-radio-button
v-for="pp in publishPipeProps" v-for="pp in publishPipeProps"
:key="pp.pipeCode" :key="pp.pipeCode"
:label="pp.pipeCode" :label="pp.pipeName"
>{{ pp.pipeName }}</el-radio-button> :value="pp.pipeCode" />
</el-radio-group> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -182,7 +182,7 @@ import { getDirectoryTreeData, getFileList, renameFile, addFile, deleteFile } fr
import { getConfigKey } from "@/api/system/config"; import { getConfigKey } from "@/api/system/config";
export default { export default {
name: "CMSFile", name: "CmsContentcoreFile",
data () { data () {
return { return {
treeSideHeight: 600, treeSideHeight: 600,

View File

@ -107,7 +107,7 @@
import { getPublishPipeList, getPublishPipeData, addPublishPipe, updatePublishPipe, delPublishPipe } from "@/api/contentcore/publishpipe"; import { getPublishPipeList, getPublishPipeData, addPublishPipe, updatePublishPipe, delPublishPipe } from "@/api/contentcore/publishpipe";
export default { export default {
name: "CMSPublishPipe", name: "CmsContentcorePublishPipe",
dicts: ['EnableOrDisable'], dicts: ['EnableOrDisable'],
data () { data () {
return { return {

View File

@ -171,7 +171,7 @@ import { getResourceTypes, getResrouceList, getResourceDetail, delResource } fro
import { getConfigKey } from "@/api/system/config"; import { getConfigKey } from "@/api/system/config";
export default { export default {
name: "CmsResource", name: "CmsContentcoreResource",
data () { data () {
return { return {
// //

View File

@ -132,7 +132,7 @@ import { delSite, addSite, listSite, publishSite } from "@/api/contentcore/site
import CMSProgress from '@/views/components/Progress'; import CMSProgress from '@/views/components/Progress';
export default { export default {
name: "Site", name: "CmsContentcoreSite",
components: { components: {
'cms-progress': CMSProgress, 'cms-progress': CMSProgress,
}, },

View File

@ -191,7 +191,7 @@ import { getConfigKey } from "@/api/system/config"
import { getTemplateList, getTemplateDetail, renameTemplate, addTemplate, delTemplate, clearIncludeCache } from "@/api/contentcore/template"; import { getTemplateList, getTemplateDetail, renameTemplate, addTemplate, delTemplate, clearIncludeCache } from "@/api/contentcore/template";
export default { export default {
name: "CmsTemplate", name: "CmsContentcoreTemplate",
data () { data () {
const validatePath = (rule, value, callback) => { const validatePath = (rule, value, callback) => {
if (!value || value.length == 0 || !value.endsWith(this.templateSuffix)) { if (!value || value.length == 0 || !value.endsWith(this.templateSuffix)) {

View File

@ -224,7 +224,7 @@ import { listCustomForms, getCustomForm, addCustomForm, editCustomForm, deleteCu
import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector'; import CMSTemplateSelector from '@/views/cms/contentcore/templateSelector';
export default { export default {
name: "CustomFormList", name: "CmsCustomformIndex",
dicts: [ 'CustomFormStatus', 'CustomFormRule' ], dicts: [ 'CustomFormStatus', 'CustomFormRule' ],
components: { components: {
'cms-template-selector': CMSTemplateSelector, 'cms-template-selector': CMSTemplateSelector,

View File

@ -123,7 +123,7 @@ import { listModelDataTables } from "@/api/meta/model";
import { addXModel, editXModel, deleteXModel, listXModel } from "@/api/contentcore/exmodel"; import { addXModel, editXModel, deleteXModel, listXModel } from "@/api/contentcore/exmodel";
export default { export default {
name: "CMSEXmodel", name: "CmsExmodelModel",
data () { data () {
return { return {
// //

View File

@ -134,7 +134,7 @@ import { codeValidator } from '@/utils/validate'
import { getLinkGroupList, addLinkGroup, editLinkGroup, deleteLinkGroup } from "@/api/link/linkGroup"; import { getLinkGroupList, addLinkGroup, editLinkGroup, deleteLinkGroup } from "@/api/link/linkGroup";
export default { export default {
name: "CmsLinkGroup", name: "CmsLinkLinkGroup",
data () { data () {
return { return {
// //

View File

@ -140,7 +140,7 @@ import { getContentTypes } from "@/api/contentcore/catalog";
import { getContentIndexList, deleteContentIndex, rebuildIndex } from "@/api/contentcore/search"; import { getContentIndexList, deleteContentIndex, rebuildIndex } from "@/api/contentcore/search";
export default { export default {
name: "CMSIndexList", name: "CmsSearchIndexList",
dicts: ['CMSContentStatus', 'CMSContentAttribute'], dicts: ['CMSContentStatus', 'CMSContentAttribute'],
components: { components: {
'cms-progress': CMSProgress 'cms-progress': CMSProgress

View File

@ -23,7 +23,7 @@ import CMSDynamicTemplate from '@/views/cms/staticize/dynamicList';
import CMSCustomDynamicTemplate from '@/views/cms/staticize/customDynamicList'; import CMSCustomDynamicTemplate from '@/views/cms/staticize/customDynamicList';
export default { export default {
name: "CMSStaticize", name: "CmsStaticizeIndex",
components: { components: {
'cms-template-tag': CMSTemplateTag, 'cms-template-tag': CMSTemplateTag,
'cms-template-function': CMSTemplateFunc, 'cms-template-function': CMSTemplateFunc,

View File

@ -25,7 +25,7 @@ import CMSSensitiveWord from '@/views/word/sensitiveWord';
import CMSErrorProneWord from '@/views/word/errorProneWord'; import CMSErrorProneWord from '@/views/word/errorProneWord';
export default { export default {
name: "CMSWordTab", name: "CmsWordWord",
components: { components: {
'cms-tag-word': CMSTagWord, 'cms-tag-word': CMSTagWord,
'cms-hot-word': CMSHotWord, 'cms-hot-word': CMSHotWord,

View File

@ -212,7 +212,7 @@ import { getCommentList, getCommentReplyList, getCommentLikeList, deleteComments
import CommentLikeDialog from '@/views/comment/commentLike'; import CommentLikeDialog from '@/views/comment/commentLike';
export default { export default {
name: "CommentList", name: "CommentCommentList",
components: { components: {
"comment-like-dialog": CommentLikeDialog "comment-like-dialog": CommentLikeDialog
}, },

View File

@ -11,7 +11,7 @@
<div slot="content"> <div slot="content">
{{ generateIconCode(item) }} {{ generateIconCode(item) }}
</div> </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" /> <svg-icon :icon-class="item" class-name="disabled" />
<span>{{ item }}</span> <span>{{ item }}</span>
</div> </div>
@ -25,8 +25,8 @@
{{ generateElementIconCode(item) }} {{ generateElementIconCode(item) }}
</div> </div>
<div class="icon-item" > <div class="icon-item" >
<i :class="'el-icon-' + item" /> <i :class="'el-icon-' + item" v-clipboard:copy="generateElementIconCode(item)" v-clipboard:success="clipboardSuccess" />
<span>{{ item }}</span> <span v-clipboard:copy="'el-icon-' + item" v-clipboard:success="clipboardSuccess">{{ item }}</span>
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
@ -40,7 +40,7 @@ import svgIcons from './svg-icons'
import elementIcons from './element-icons' import elementIcons from './element-icons'
export default { export default {
name: 'Icons', name: 'ComponentsIconsIndex',
data() { data() {
return { return {
svgIcons, svgIcons,
@ -53,6 +53,9 @@ export default {
}, },
generateElementIconCode(symbol) { generateElementIconCode(symbol) {
return `<i class="el-icon-${symbol}" />` return `<i class="el-icon-${symbol}" />`
},
clipboardSuccess() {
this.$modal.msgSuccess(this.$t('Common.CopySuccess'));
} }
} }
} }

View File

@ -221,7 +221,7 @@ import { getLevelTypes } from "@/api/member/levelConfig";
import { getExpOperations, getExpConfigList, getExpConfigDetail, addExpConfig, updateExpConfig, deleteExpConfigs } from "@/api/member/expConfig"; import { getExpOperations, getExpConfigList, getExpConfigDetail, addExpConfig, updateExpConfig, deleteExpConfigs } from "@/api/member/expConfig";
export default { export default {
name: "MemberExpOperation", name: "MemberExpConfig",
data () { data () {
return { return {
// //

View File

@ -158,7 +158,7 @@
import { getLevelTypes, getLevelConfigList, getLevelConfigDetail, addLevelConfig, updateLevelConfig, deleteLevelConfigs } from "@/api/member/levelConfig"; import { getLevelTypes, getLevelConfigList, getLevelConfigDetail, addLevelConfig, updateLevelConfig, deleteLevelConfigs } from "@/api/member/levelConfig";
export default { export default {
name: "MemberExpOperation", name: "MemberLevelConfig",
data () { data () {
return { return {
// //

View File

@ -236,7 +236,7 @@ import { isBlank, validEmail, validPhoneNumber } from '@/utils/validate';
import { getMemberList, getMemberDetail, addMember, updateMember, deleteMembers, resetMemberPassword } from "@/api/member/member"; import { getMemberList, getMemberDetail, addMember, updateMember, deleteMembers, resetMemberPassword } from "@/api/member/member";
export default { export default {
name: "MemberList", name: "MemberMemberList",
dicts: [ 'MemberStatus' ], dicts: [ 'MemberStatus' ],
data () { data () {
const validateMember = (rule, value, callback) => { const validateMember = (rule, value, callback) => {

View File

@ -99,7 +99,7 @@ import { MessageBox } from 'element-ui'
import { getTaskList, stopTask, removeTask } from "@/api/system/async"; import { getTaskList, stopTask, removeTask } from "@/api/system/async";
export default { export default {
name: "CmsAsyncTaskList", name: "MonitorAsyncIndex",
data () { data () {
return { return {
// //

View File

@ -71,7 +71,7 @@ import { getCache } from "@/api/monitor/cache";
import echarts from "echarts"; import echarts from "echarts";
export default { export default {
name: "Cache", name: "MonitorCacheIndex",
data() { data() {
return { return {
// //

View File

@ -160,7 +160,7 @@
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache"; import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache";
export default { export default {
name: "CacheList", name: "MonitorCacheList",
data() { data() {
return { return {
cacheNames: [], cacheNames: [],

View File

@ -33,7 +33,7 @@
import { getLogMenus } from "@/api/monitor/logs"; import { getLogMenus } from "@/api/monitor/logs";
export default { export default {
name: "MonitorLogs", name: "MonitorLogsIndex",
data() { data() {
return { return {
loading: true, loading: true,

View File

@ -130,7 +130,7 @@
import { list, delLogininfor, cleanLogininfor } from "@/api/monitor/logininfor"; import { list, delLogininfor, cleanLogininfor } from "@/api/monitor/logininfor";
export default { export default {
name: "Logininfor", name: "MonitorLogsLogininfor",
dicts: ['SuccessOrFail'], dicts: ['SuccessOrFail'],
data() { data() {
return { return {

View File

@ -190,7 +190,7 @@
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog"; import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
export default { export default {
name: "Operlog", name: "MonitorLogsOperation",
data() { data() {
return { return {
// //

View File

@ -67,7 +67,7 @@
import { list, forceLogout } from "@/api/monitor/online"; import { list, forceLogout } from "@/api/monitor/online";
export default { export default {
name: "Online", name: "MonitorOnlineIndex",
data() { data() {
return { return {
// //

View File

@ -229,7 +229,7 @@
import { getServer } from "@/api/monitor/server"; import { getServer } from "@/api/monitor/server";
export default { export default {
name: "Server", name: "MonitorServerIndex",
data() { data() {
return { return {
// //

View File

@ -249,7 +249,7 @@
import { getTaskTypes, listTask, getTask, delTask, addTask, updateTask, enableTask, disableTask, executeTask, getTaskLogs, delTaskLogs } from "@/api/monitor/task"; import { getTaskTypes, listTask, getTask, delTask, addTask, updateTask, enableTask, disableTask, executeTask, getTaskLogs, delTaskLogs } from "@/api/monitor/task";
export default { export default {
name: "ScheduledTask", name: "MonitorTaskIndex",
dicts: ['YesOrNo', 'EnableOrDisable', 'SuccessOrFail'], dicts: ['YesOrNo', 'EnableOrDisable', 'SuccessOrFail'],
data() { data() {
return { return {

View File

@ -164,7 +164,7 @@ import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache
import I18nEditor from '@/views/components/I18nFieldEditor'; import I18nEditor from '@/views/components/I18nFieldEditor';
export default { export default {
name: "Config", name: "SystemConfigIndex",
components: { components: {
I18nEditor, I18nEditor,
}, },

View File

@ -179,7 +179,7 @@ import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Dept", name: "SystemDeptIndex",
dicts: ['EnableOrDisable'], dicts: ['EnableOrDisable'],
components: { Treeselect }, components: { Treeselect },
data() { data() {

View File

@ -170,7 +170,7 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@
import I18nEditor from '@/views/components/I18nFieldEditor'; import I18nEditor from '@/views/components/I18nFieldEditor';
export default { export default {
name: "Dict", name: "SystemDictIndex",
components: { components: {
I18nEditor, I18nEditor,
}, },

View File

@ -24,7 +24,7 @@
import { executeGroovySrcity } from "@/api/system/groovy"; import { executeGroovySrcity } from "@/api/system/groovy";
export default { export default {
name: "SysGroovyScript", name: "SystemGroovyIndex",
data() { data() {
return { return {
loading: false, loading: false,

View File

@ -167,7 +167,7 @@
import { listI18nDict, getI18nDict, delI18nDict, addI18nDict, updateI18nDict, refreshCache } from "@/api/system/i18nDict"; import { listI18nDict, getI18nDict, delI18nDict, addI18nDict, updateI18nDict, refreshCache } from "@/api/system/i18nDict";
export default { export default {
name: "I18nDict", name: "SystemI18nIndex",
dicts: [ 'I18nDictType' ], dicts: [ 'I18nDictType' ],
data() { data() {
return { return {

View File

@ -302,7 +302,7 @@ import IconSelect from "@/components/IconSelect";
import I18nEditor from '../../components/I18nFieldEditor'; import I18nEditor from '../../components/I18nFieldEditor';
export default { export default {
name: "Menu", name: "SystemMenuIndex",
dicts: ['YesOrNo', 'EnableOrDisable'], dicts: ['YesOrNo', 'EnableOrDisable'],
components: { Treeselect, IconSelect, I18nEditor }, components: { Treeselect, IconSelect, I18nEditor },
data() { data() {

View File

@ -180,7 +180,7 @@
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"; import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
export default { export default {
name: "Notice", name: "SystemNoticeIndex",
dicts: ['NoticeStatus', 'NoticeType'], dicts: ['NoticeStatus', 'NoticeType'],
data() { data() {
return { return {

View File

@ -167,7 +167,7 @@
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post"; import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
export default { export default {
name: "Post", name: "SystemPostIndex",
dicts: ['EnableOrDisable'], dicts: ['EnableOrDisable'],
data() { data() {
return { return {

View File

@ -214,7 +214,7 @@ import { listRole, getRole, delRole, addRole, updateRole, changeRoleStatus } fro
import RolePermission from '@/views/system/permission/permsTab'; import RolePermission from '@/views/system/permission/permsTab';
export default { export default {
name: "Role", name: "SystemRoleIndex",
dicts: ['EnableOrDisable'], dicts: ['EnableOrDisable'],
components: { components: {
'role-permission': RolePermission 'role-permission': RolePermission

View File

@ -182,7 +182,7 @@
import { listSecurityConfigs, getSecurityConfig, addSecurityConfig, saveSecurityConfig, deleteSecurityConfig, changeConfigStatus } from "@/api/system/security"; import { listSecurityConfigs, getSecurityConfig, addSecurityConfig, saveSecurityConfig, deleteSecurityConfig, changeConfigStatus } from "@/api/system/security";
export default { export default {
name: "SysSecurityConfig", name: "SysSecurityIndex",
dicts: [ "EnableOrDisable", "SecurityPasswordRule", "SecurityPasswordSensitive", "SecurityPasswordRetryStrategy" ], dicts: [ "EnableOrDisable", "SecurityPasswordRule", "SecurityPasswordSensitive", "SecurityPasswordRetryStrategy" ],
data () { data () {
return { return {

View File

@ -340,7 +340,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import RolePermission from '@/views/system/permission/permsTab'; import RolePermission from '@/views/system/permission/permsTab';
export default { export default {
name: "User", name: "SystemUserIndex",
dicts: ['SysUserStatus', 'Gender', 'EnableOrDisable'], dicts: ['SysUserStatus', 'Gender', 'EnableOrDisable'],
components: { components: {
Treeselect, Treeselect,

View File

@ -18,8 +18,8 @@
<el-form-item :label="$t('System.UserPreference.ShowContentSubTitle')" prop="ShowContentSubTitle"> <el-form-item :label="$t('System.UserPreference.ShowContentSubTitle')" prop="ShowContentSubTitle">
<el-switch <el-switch
v-model="form.ShowContentSubTitle" v-model="form.ShowContentSubTitle"
active-text="" :active-text="$t('Common.Yes')"
inactive-text="" :inactive-text="$t('Common.No')"
active-value="Y" active-value="Y"
inactive-value="N"> inactive-value="N">
</el-switch> </el-switch>
@ -27,8 +27,8 @@
<el-form-item :label="$t('System.UserPreference.IncludeChildContent')" prop="IncludeChildContent"> <el-form-item :label="$t('System.UserPreference.IncludeChildContent')" prop="IncludeChildContent">
<el-switch <el-switch
v-model="form.IncludeChildContent" v-model="form.IncludeChildContent"
active-text="" :active-text="$t('Common.Yes')"
inactive-text="" :inactive-text="$t('Common.No')"
active-value="Y" active-value="Y"
inactive-value="N"> inactive-value="N">
</el-switch> </el-switch>
@ -36,12 +36,17 @@
<el-form-item :label="$t('System.UserPreference.OpenContentEditorW')" prop="OpenContentEditorW"> <el-form-item :label="$t('System.UserPreference.OpenContentEditorW')" prop="OpenContentEditorW">
<el-switch <el-switch
v-model="form.OpenContentEditorW" v-model="form.OpenContentEditorW"
active-text="" :active-text="$t('Common.Yes')"
inactive-text="" :inactive-text="$t('Common.No')"
active-value="Y" active-value="Y"
inactive-value="N"> inactive-value="N">
</el-switch> </el-switch>
</el-form-item> </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-form-item>
<el-button type="primary" size="smjall" @click="handleSave">{{ $t('Common.Save') }}</el-button> <el-button type="primary" size="smjall" @click="handleSave">{{ $t('Common.Save') }}</el-button>
</el-form-item> </el-form-item>

View File

@ -155,6 +155,7 @@ let oldActiveId
let tempActiveData let tempActiveData
export default { export default {
name: "ToolBuildIndex",
components: { components: {
draggable, draggable,
render, render,

View File

@ -201,7 +201,7 @@ hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascri
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
export default { export default {
name: "Gen", name: "ToolGenIndex",
components: { importTable }, components: { importTable },
data() { data() {
return { return {

View File

@ -218,7 +218,7 @@ import { codeValidator } from '@/utils/validate'
import { getVoteUserTypes, getVoteList, getVoteDetail, addVote, updateVote, deleteVotes } from "@/api/vote/vote"; import { getVoteUserTypes, getVoteList, getVoteDetail, addVote, updateVote, deleteVotes } from "@/api/vote/vote";
export default { export default {
name: "VoteList", name: "VoteIndex",
dicts: [ 'VoteStatus', 'VoteViewType' ], dicts: [ 'VoteStatus', 'VoteViewType' ],
components: { components: {
}, },