v1.2.0 bug修复
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dreysolano/prerender-spa-plugin": "^1.0.3",
|
||||
"@stomp/stompjs": "^7.1.1",
|
||||
"@tinymce/tinymce-vue": "^6.2.0",
|
||||
"amfe-flexible": "^2.2.1",
|
||||
@@ -35,15 +34,12 @@
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"compression-webpack-plugin": "^6.1.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"less": "^4.2.0",
|
||||
"less-loader": "^12.2.0",
|
||||
"sass": "^1.79.1",
|
||||
"sass-loader": "^12.6.0",
|
||||
"sitemap-webpack-plugin": "^1.1.1",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"webpack-merge": "^6.0.1"
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ export const AccessMiningPool_en = {
|
||||
estimatedTimeDgbs:"≈ 10 minutes",
|
||||
estimatedTimeDgbq:"≈ 10 minutes",
|
||||
estimatedTimeDgbo:"≈ 10 minutes",
|
||||
estimatedTimeMona:"≈ 25 hours",
|
||||
estimatedTimeMona:"≈ 2.5 hours",
|
||||
estimatedTimeAlph:" 500 minutes",
|
||||
estimatedTimeEnx:"",
|
||||
describeNexa:"For example, if a 1,000,000 NEXA reward was earned on 1-1, that reward will be paid out approximately 7 days later (1-8), depending on actual block heights",
|
||||
|
||||
@@ -151,6 +151,21 @@ export const backendSystem_zh = {
|
||||
pleaseSelectCurrency2:"添加挖矿教程,请选择币种",
|
||||
pleaseInputTitle:"请输入标题",
|
||||
|
||||
searchResult:"搜索结果",
|
||||
returnSearch:"返回搜索",
|
||||
keyword:"关键词",
|
||||
find:"找到",
|
||||
relatedResults:"条相关结果",
|
||||
documentIcon:"文档图标",
|
||||
preview:"预览",
|
||||
noResult:"未找到相关结果",
|
||||
keyword2:"关键词",
|
||||
noMatch:"没有找到匹配的文档",
|
||||
resetSearch:"重新搜索",
|
||||
类型:"类型",
|
||||
创建时间:"创建时间",
|
||||
创建者:"创建者",
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +322,20 @@ export const backendSystem_en = {
|
||||
pleaseSelectCurrency2:"Please select a currency when adding mining tutorials",
|
||||
pleaseInputContent2:"Please input content",
|
||||
pleaseInputTitle:"Please input title",
|
||||
|
||||
searchResult:"Search Result",
|
||||
returnSearch:"Return Search",
|
||||
keyword:"Keyword",
|
||||
find:"Find",
|
||||
relatedResults:"Items",
|
||||
documentIcon:"Document Icon",
|
||||
preview:"Preview",
|
||||
noResult:"No Related Results",
|
||||
keyword2:"Keyword",
|
||||
noMatch:"No Matching Document",
|
||||
resetSearch:"Reset Search",
|
||||
类型:"Type",
|
||||
创建时间:"Create Time",
|
||||
创建者:"Create User",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,19 @@ Vue.prototype.$isMobile = isNarrowScreen
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 全局处理未捕获的 Promise 拒绝(仅限网络类错误),
|
||||
* 防止错误遮罩层把页面完全遮挡。不影响其他错误的默认行为。
|
||||
*/
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
const reason = event && event.reason;
|
||||
const message = typeof reason === 'string' ? reason : (reason && reason.message);
|
||||
if (message && (message === 'Network Error' || message.includes('timeout'))) {
|
||||
event.preventDefault();
|
||||
console.warn('[unhandledrejection] blocked network error:', message);
|
||||
}
|
||||
});
|
||||
|
||||
// 在路由守卫中设置
|
||||
router.beforeEach((to, from, next) => {
|
||||
// 从路由中获取语言参数
|
||||
|
||||
@@ -30,6 +30,12 @@ export function getAllValidPaths() {
|
||||
'/BKWorkDetails',
|
||||
'/dataDisplay',
|
||||
'/alerts',
|
||||
'/helpCenter',
|
||||
'/commonProblem',
|
||||
'/announcementDetails',
|
||||
'/searchResult',
|
||||
'/announcements',
|
||||
'/announcementDetails',
|
||||
|
||||
// 个人中心子页面
|
||||
'/personalCenter',
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { documentsList,findDataInfo} from '../../api/documentManagement'
|
||||
|
||||
/**
|
||||
* 本地存储选中的问题ID的键名
|
||||
* @type {string}
|
||||
*/
|
||||
const SELECTED_PROBLEM_ID_KEY = 'announcementDetails:selectedId'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -34,11 +40,11 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.DetailsParams.id = this.$route.query.id;
|
||||
console.log(this.$route.query.id,"this.DetailsParams.id");
|
||||
if (this.DetailsParams.id) {
|
||||
this.fetchProblemDetails(this.DetailsParams)
|
||||
}
|
||||
// this.DetailsParams.id = this.$route.query.id;
|
||||
// console.log(this.$route.query.id,"this.DetailsParams.id");
|
||||
// if (this.DetailsParams.id) {
|
||||
// this.fetchProblemDetails(this.DetailsParams)
|
||||
// }
|
||||
this.fetchProblemsList(this.listParams)
|
||||
},
|
||||
methods: {
|
||||
@@ -47,8 +53,33 @@ export default {
|
||||
const res = await documentsList(params)
|
||||
if(res && res.code === 200){
|
||||
this.problems = res.rows;
|
||||
// this.DetailsParams.id = this.problems[0].id;
|
||||
// this.fetchProblemDetails(this.DetailsParams)
|
||||
// 优先级:URL 参数 > 本地存储 > 列表首项
|
||||
const routeId = this.$route && this.$route.query && this.$route.query.id ? String(this.$route.query.id) : ''
|
||||
const savedId = this.getSavedSelectedId()
|
||||
|
||||
let resolvedId = routeId || savedId || ''
|
||||
|
||||
if (!resolvedId && this.problems && this.problems.length > 0) {
|
||||
resolvedId = String(this.problems[0].id)
|
||||
}
|
||||
|
||||
// 如果存在但不在当前列表中,则回退到首项
|
||||
if (resolvedId) {
|
||||
const existsInList = (this.problems || []).some(item => String(item.id) === String(resolvedId))
|
||||
if (!existsInList && this.problems && this.problems.length > 0) {
|
||||
resolvedId = String(this.problems[0].id)
|
||||
}
|
||||
}
|
||||
|
||||
this.DetailsParams.id = resolvedId
|
||||
|
||||
// 同步到URL与本地存储
|
||||
this.persistSelectedId(this.DetailsParams.id)
|
||||
this.updateRouteQueryId(this.DetailsParams.id)
|
||||
|
||||
if (this.DetailsParams.id) {
|
||||
this.fetchProblemDetails(this.DetailsParams)
|
||||
}
|
||||
}
|
||||
this.setLoading('problemLoading', false);
|
||||
},
|
||||
@@ -71,9 +102,65 @@ export default {
|
||||
* @param {number} id 问题ID
|
||||
*/
|
||||
handleClick(id) {
|
||||
|
||||
this.DetailsParams.id = id;
|
||||
// 更新当前选中ID
|
||||
this.DetailsParams.id = id
|
||||
// 持久化并同步URL
|
||||
this.persistSelectedId(this.DetailsParams.id)
|
||||
this.updateRouteQueryId(this.DetailsParams.id)
|
||||
// 获取详情
|
||||
this.fetchProblemDetails(this.DetailsParams)
|
||||
},
|
||||
|
||||
/**
|
||||
* 将选中的问题ID持久化到本地存储
|
||||
* @param {string|number} id 问题ID
|
||||
* @returns {void}
|
||||
*/
|
||||
persistSelectedId(id) {
|
||||
try {
|
||||
window.localStorage.setItem(SELECTED_PROBLEM_ID_KEY, String(id))
|
||||
} catch (error) {
|
||||
// 上报或静默处理本地存储异常
|
||||
console.error('persistSelectedId error', error)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 读取本地存储中保存的选中问题ID
|
||||
* @returns {string}
|
||||
*/
|
||||
getSavedSelectedId() {
|
||||
try {
|
||||
return window.localStorage.getItem(SELECTED_PROBLEM_ID_KEY) || ''
|
||||
} catch (error) {
|
||||
console.error('getSavedSelectedId error', error)
|
||||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 使用 replace 同步更新当前路由的查询参数中的 id
|
||||
* 避免产生新的历史记录条目
|
||||
* @param {string|number} id 问题ID
|
||||
* @returns {void}
|
||||
*/
|
||||
updateRouteQueryId(id) {
|
||||
try {
|
||||
if (!this.$route) return
|
||||
const targetId = String(id)
|
||||
const currentId = this.$route && this.$route.query && this.$route.query.id ? String(this.$route.query.id) : ''
|
||||
if (currentId === targetId) return
|
||||
|
||||
const nextQuery = { ...(this.$route.query || {}), id: targetId }
|
||||
if (this.$router && typeof this.$router.replace === 'function') {
|
||||
const maybePromise = this.$router.replace({ query: nextQuery })
|
||||
if (maybePromise && typeof maybePromise.catch === 'function') {
|
||||
maybePromise.catch(() => {})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('updateRouteQueryId error', error)
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -164,6 +164,12 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
// 验证每个路径是否以/开头
|
||||
const invalidPaths = pathArray.filter(path => !path.startsWith('/'));
|
||||
if (invalidPaths.length > 0) {
|
||||
this.$message.error(`路径必须以 / 开头: ${invalidPaths.join(', ')}`);
|
||||
return
|
||||
}
|
||||
|
||||
if (this.addParams.buttonContent) {
|
||||
// 兼容中英文逗号分割
|
||||
@@ -187,14 +193,6 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
// 验证每个路径是否有效
|
||||
const invalidPaths = pathArray.filter(path => !isValidPath(path));
|
||||
if (invalidPaths.length > 0) {
|
||||
const suggestions = getPathSuggestions(invalidPaths[0]);
|
||||
this.$message.error(`${this.$t("backendSystem.invalidPath")}: ${invalidPaths.join(', ')}。${this.$t("backendSystem.invalidPathSuggestions")}: ${suggestions.slice(0, 3).join(', ')}`);
|
||||
return
|
||||
}
|
||||
|
||||
// 验证通过,保持字符串格式传给后端(不转换为数组)
|
||||
// this.addParams.buttonPath 保持原始字符串格式
|
||||
}
|
||||
@@ -254,14 +252,12 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
// 验证每个路径是否有效
|
||||
const invalidPaths = pathArray.filter(path => !isValidPath(path));
|
||||
// 验证每个路径是否以/开头
|
||||
const invalidPaths = pathArray.filter(path => !path.startsWith('/'));
|
||||
if (invalidPaths.length > 0) {
|
||||
const suggestions = getPathSuggestions(invalidPaths[0]);
|
||||
this.$message.error(`${this.$t("backendSystem.invalidPath")}: ${invalidPaths.join(', ')}。${this.$t("backendSystem.invalidPathSuggestions")}: ${suggestions.slice(0, 3).join(', ')}`);
|
||||
this.$message.error(`路径必须以 / 开头: ${invalidPaths.join(', ')}`);
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t("backendSystem.pleaseInputButtonContentAndPath"))
|
||||
@@ -363,23 +359,19 @@ export default {
|
||||
* @returns {Array} 路径建议列表
|
||||
*/
|
||||
getValidPathSuggestions() {
|
||||
return getPathSuggestions('').slice(0, 8); // 返回前8个常用路径
|
||||
// 移除路径建议,返回空数组
|
||||
return [];
|
||||
},
|
||||
|
||||
/**
|
||||
* 显示路径使用帮助
|
||||
*/
|
||||
showPathHelp() {
|
||||
const suggestions = this.getValidPathSuggestions();
|
||||
const helpMessage = `
|
||||
常用路径示例:
|
||||
${suggestions.slice(0, 10).join('\n')}
|
||||
|
||||
路径规则:
|
||||
• 多个路径用逗号分隔
|
||||
• 路径必须以 / 开头
|
||||
• 支持动态路由参数
|
||||
• 不要包含域名,只写路径部分
|
||||
• 路径格式自由,不做严格验证
|
||||
• 支持任意路径格式
|
||||
`;
|
||||
|
||||
this.$alert(helpMessage, '路径格式说明', {
|
||||
@@ -399,7 +391,7 @@ export default {
|
||||
return [];
|
||||
}
|
||||
return buttonContent
|
||||
.split(',')
|
||||
.split(/[,,]/)
|
||||
.map(btn => btn.trim())
|
||||
.filter(btn => btn);
|
||||
},
|
||||
@@ -414,7 +406,7 @@ export default {
|
||||
return [];
|
||||
}
|
||||
return buttonPath
|
||||
.split(',')
|
||||
.split(/[,,]/)
|
||||
.map(path => path.trim())
|
||||
.filter(path => path);
|
||||
},
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { documentsList,findDataInfo} from '../../api/documentManagement'
|
||||
|
||||
/**
|
||||
* 本地存储选中的问题ID的键名(常见问题页)
|
||||
* @type {string}
|
||||
*/
|
||||
const SELECTED_PROBLEM_ID_KEY = 'commonProblem:selectedId'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -47,14 +53,29 @@ export default {
|
||||
if(res && res.code === 200){
|
||||
this.problems = res.rows;
|
||||
|
||||
if (this.$route.query.id) {
|
||||
this.DetailsParams.id = this.$route.query.id
|
||||
// 优先级:URL 参数 > 本地存储 > 列表首项
|
||||
const routeId = this.$route && this.$route.query && this.$route.query.id ? String(this.$route.query.id) : ''
|
||||
const savedId = this.getSavedSelectedId()
|
||||
let resolvedId = routeId || savedId || ''
|
||||
|
||||
}else if(this.problems.length > 0){
|
||||
this.DetailsParams.id = this.problems[0].id;
|
||||
if (!resolvedId && this.problems && this.problems.length > 0) {
|
||||
resolvedId = String(this.problems[0].id)
|
||||
}
|
||||
|
||||
if (resolvedId) {
|
||||
const existsInList = (this.problems || []).some(item => String(item.id) === String(resolvedId))
|
||||
if (!existsInList && this.problems && this.problems.length > 0) {
|
||||
resolvedId = String(this.problems[0].id)
|
||||
}
|
||||
}
|
||||
|
||||
this.DetailsParams.id = resolvedId
|
||||
this.persistSelectedId(this.DetailsParams.id)
|
||||
this.updateRouteQueryId(this.DetailsParams.id)
|
||||
if (this.DetailsParams.id) {
|
||||
this.fetchProblemDetails(this.DetailsParams)
|
||||
}
|
||||
}
|
||||
this.setLoading('problemLoading', false);
|
||||
},
|
||||
|
||||
@@ -76,9 +97,61 @@ export default {
|
||||
* @param {number} id 问题ID
|
||||
*/
|
||||
handleClick(id) {
|
||||
|
||||
this.DetailsParams.id = id;
|
||||
this.persistSelectedId(this.DetailsParams.id)
|
||||
this.updateRouteQueryId(this.DetailsParams.id)
|
||||
this.fetchProblemDetails(this.DetailsParams)
|
||||
},
|
||||
|
||||
/**
|
||||
* 将选中的问题ID持久化到本地存储
|
||||
* @param {string|number} id 问题ID
|
||||
* @returns {void}
|
||||
*/
|
||||
persistSelectedId(id) {
|
||||
try {
|
||||
window.localStorage.setItem(SELECTED_PROBLEM_ID_KEY, String(id))
|
||||
} catch (error) {
|
||||
console.error('persistSelectedId error', error)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 读取本地存储中保存的选中问题ID
|
||||
* @returns {string}
|
||||
*/
|
||||
getSavedSelectedId() {
|
||||
try {
|
||||
return window.localStorage.getItem(SELECTED_PROBLEM_ID_KEY) || ''
|
||||
} catch (error) {
|
||||
console.error('getSavedSelectedId error', error)
|
||||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 使用 replace 同步更新当前路由的查询参数中的 id
|
||||
* 避免产生新的历史记录条目
|
||||
* @param {string|number} id 问题ID
|
||||
* @returns {void}
|
||||
*/
|
||||
updateRouteQueryId(id) {
|
||||
try {
|
||||
if (!this.$route) return
|
||||
const targetId = String(id)
|
||||
const currentId = this.$route && this.$route.query && this.$route.query.id ? String(this.$route.query.id) : ''
|
||||
if (currentId === targetId) return
|
||||
|
||||
const nextQuery = { ...(this.$route.query || {}), id: targetId }
|
||||
if (this.$router && typeof this.$router.replace === 'function') {
|
||||
const maybePromise = this.$router.replace({ query: nextQuery })
|
||||
if (maybePromise && typeof maybePromise.catch === 'function') {
|
||||
maybePromise.catch(() => {})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('updateRouteQueryId error', error)
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -380,7 +380,7 @@ export default Vue.extend({
|
||||
this.$message.success(this.$t("backendSystem.updateSuccess"));
|
||||
// 发布成功后清除本地草稿
|
||||
const LOCAL_STORAGE_KEY = "editor_draft_add";
|
||||
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
sessionStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
this.$router.push({ path: `/${this.$i18n.locale}/documentManagement` });
|
||||
for (const key in this.addParams) {
|
||||
this.addParams[key] = "";
|
||||
@@ -409,7 +409,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
handelAddDocument() {
|
||||
|
||||
this.addParams.title = this.addParams.title.trim();
|
||||
// 强制同步编辑器内容
|
||||
if (this.editor) {
|
||||
this.addParams.content = this.editor.txt.html();
|
||||
@@ -426,6 +426,17 @@ export default Vue.extend({
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.addParams.title) {
|
||||
this.$message({
|
||||
message:
|
||||
this.$t("backendSystem.pleaseInputTitle") ||
|
||||
"请输入标题",
|
||||
type: "warning",
|
||||
duration: 4000,
|
||||
showClose: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(this.addParams.type,this.typeArray, "this.addParams.type");
|
||||
|
||||
if (!this.addParams.type ) {
|
||||
@@ -449,17 +460,8 @@ export default Vue.extend({
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.addParams.title) {
|
||||
this.$message({
|
||||
message:
|
||||
this.$t("backendSystem.pleaseInputTitle") ||
|
||||
"请输入标题",
|
||||
type: "warning",
|
||||
duration: 4000,
|
||||
showClose: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.addParams.type == "1" && !this.screenCurrency) {
|
||||
@@ -598,7 +600,7 @@ export default Vue.extend({
|
||||
};
|
||||
|
||||
const LOCAL_STORAGE_KEY = "editor_draft_add";
|
||||
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(saveData));
|
||||
sessionStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(saveData));
|
||||
this.lastSaveTime = saveData.timestamp;
|
||||
this.isSaving = false;
|
||||
} catch (error) {
|
||||
@@ -610,7 +612,7 @@ export default Vue.extend({
|
||||
loadFromLocalStorage() {
|
||||
try {
|
||||
const LOCAL_STORAGE_KEY = "editor_draft_add";
|
||||
const savedData = localStorage.getItem(LOCAL_STORAGE_KEY);
|
||||
const savedData = sessionStorage.getItem(LOCAL_STORAGE_KEY);
|
||||
if (savedData) {
|
||||
const data = JSON.parse(savedData);
|
||||
console.log(data, "data");
|
||||
@@ -621,7 +623,7 @@ export default Vue.extend({
|
||||
|
||||
if (isExpired) {
|
||||
console.log("本地数据已过期,清除缓存");
|
||||
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
sessionStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -632,10 +634,11 @@ export default Vue.extend({
|
||||
|
||||
this.addParams.title = data.title || "";
|
||||
this.addParams.content = data.content || "";
|
||||
this.addParams.type = data.type || "1";
|
||||
this.addParams.type = data.type || "";
|
||||
this.addParams.imageUrl = data.imageUrl || "";
|
||||
this.lastSaveTime = data.timestamp || "";
|
||||
console.log(data.type,this.typeArray, "data.type");
|
||||
this.typeArray = [data.type];
|
||||
// 如果编辑器已经创建,直接设置内容
|
||||
if (this.editor) {
|
||||
this.editor.txt.html(data.content || "");
|
||||
@@ -651,7 +654,7 @@ export default Vue.extend({
|
||||
|
||||
clearDraft() {
|
||||
const LOCAL_STORAGE_KEY = "editor_draft_add";
|
||||
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
sessionStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
this.lastSaveTime = "";
|
||||
this.isSaving = false;
|
||||
},
|
||||
@@ -779,7 +782,7 @@ export default Vue.extend({
|
||||
}
|
||||
// 清除本地草稿
|
||||
const LOCAL_STORAGE_KEY = "editor_draft_add";
|
||||
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
sessionStorage.removeItem(LOCAL_STORAGE_KEY);
|
||||
this.$message.success(
|
||||
this.$t("backendSystem.contentReset") || "内容已重置"
|
||||
);
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
{//公告中心
|
||||
value:"3",
|
||||
label:"backendSystem.announcementCenter",
|
||||
articleUrl:"announcementDetails"
|
||||
articleUrl:"announcements"
|
||||
},
|
||||
{//其他
|
||||
value:"0",
|
||||
|
||||
@@ -375,7 +375,7 @@ export default Vue.extend({
|
||||
if (this.editor) {
|
||||
this.addParams.content = this.editor.txt.html();
|
||||
}
|
||||
console.log(this.addParams.content, "this.addParams.content");
|
||||
this.addParams.title = this.addParams.title.trim();
|
||||
if (!this.addParams.content.trim()) {
|
||||
this.$message({
|
||||
message:
|
||||
@@ -610,10 +610,10 @@ export default Vue.extend({
|
||||
|
||||
this.addParams.title = data.title || "";
|
||||
this.addParams.content = data.content || "";
|
||||
this.addParams.type = data.type || "1";
|
||||
this.addParams.type = data.type || "";
|
||||
this.addParams.imageUrl = data.imageUrl || "";
|
||||
this.lastSaveTime = data.timestamp || "";
|
||||
|
||||
this.typeArray = [data.type];
|
||||
// 如果编辑器已经创建,直接设置内容
|
||||
if (this.editor) {
|
||||
this.editor.txt.html(data.content || "");
|
||||
|
||||
@@ -69,32 +69,47 @@ export default{
|
||||
pageSize:10
|
||||
},
|
||||
TypeList:[
|
||||
{
|
||||
{//挖矿教程
|
||||
value:"1",
|
||||
label:"挖矿教程"
|
||||
label:"backendSystem.miningTutorial",
|
||||
articleUrl:"AccessMiningPool"
|
||||
},
|
||||
{
|
||||
{//常见问题
|
||||
value:"2",
|
||||
label:"常见问题"
|
||||
label:"backendSystem.commonProblems",
|
||||
articleUrl:"commonProblem"
|
||||
},
|
||||
{
|
||||
{//公告中心
|
||||
value:"3",
|
||||
label:"公告中心"
|
||||
label:"backendSystem.announcementCenter",
|
||||
articleUrl:"announcements"
|
||||
},
|
||||
{
|
||||
{//其他
|
||||
value:"0",
|
||||
label:"其他"
|
||||
},
|
||||
|
||||
label:"backendSystem.other",
|
||||
articleUrl:"",
|
||||
children:[{
|
||||
value:"1",
|
||||
label:"home.serviceTerms",
|
||||
articleUrl:"serviceTerms"
|
||||
},{
|
||||
value:"2",
|
||||
label:"home.rate",
|
||||
articleUrl:"rate"
|
||||
},{
|
||||
value:"3",
|
||||
label:"home.APIfile",
|
||||
articleUrl:"apiFile"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
try {
|
||||
this.TypeList = JSON.parse(localStorage.getItem('TypeList'))
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
this.$addStorageEvent(1, "TypeList", JSON.stringify(this.TypeList));
|
||||
|
||||
this.fetchActivityList(this.activeParams)
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<div class="help-center">
|
||||
<!-- 顶部蓝色渐变背景区域 -->
|
||||
<div class="top-section">
|
||||
<div class="filter-icon">
|
||||
<!-- <div class="filter-icon">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 7H21L15 13V19L9 15V13L3 7Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<div class="search-container">
|
||||
|
||||
@@ -1546,6 +1546,7 @@ export default {
|
||||
this.showCalculator = false
|
||||
},
|
||||
|
||||
|
||||
changeSelection(scope) {
|
||||
let brand = scope
|
||||
for (let index in this.currencyList) {
|
||||
@@ -1584,6 +1585,32 @@ export default {
|
||||
this.$router.push(cleanPath);
|
||||
}
|
||||
|
||||
},
|
||||
handelJumpBroadcast(url){
|
||||
|
||||
if (url === '/AccessMiningPool') {
|
||||
const coin = this.currencyList.find(item => item.value === this.params.coin);
|
||||
if (!coin) return;
|
||||
// let jumpName = coin.path.charAt(0).toUpperCase() + coin.path.slice(1) //name跳转 首字母大写
|
||||
|
||||
let url = `/${this.lang}/AccessMiningPool`
|
||||
// 使用 name 进行导航,避免重复的路由参数
|
||||
this.$router.push({
|
||||
name:'AccessMiningPool',
|
||||
params: {
|
||||
coin: this.params.coin,
|
||||
imgUrl: this.currencyPath
|
||||
|
||||
},
|
||||
replace: false // 保留历史记录,允许回退
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$router.push(`/${this.lang}${url}`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
handelCalculation() {
|
||||
this.calculateIncome()
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
:title="buttonText"
|
||||
:key="`button-${item.id}-${buttonIndex}`"
|
||||
class="view"
|
||||
@click.stop="handelJump(item.buttonPath[buttonIndex])"
|
||||
@click.stop="handelJumpBroadcast(item.buttonPath[buttonIndex])"
|
||||
>
|
||||
{{ buttonText || $t(`home.view`) }}
|
||||
</span>
|
||||
@@ -506,7 +506,7 @@
|
||||
:title="buttonText"
|
||||
:key="`button-${item.id}-${buttonIndex}`"
|
||||
class="view"
|
||||
@click.stop="handelJump(item.buttonPath[buttonIndex])"
|
||||
@click.stop="handelJumpBroadcast(item.buttonPath[buttonIndex])"
|
||||
>
|
||||
{{ buttonText || $t(`home.view`) }}
|
||||
</span>
|
||||
@@ -1485,6 +1485,9 @@ export default {
|
||||
margin-left: 8px;
|
||||
color: #6e3edb;
|
||||
// background: palegoldenrod;
|
||||
text-transform: uppercase ;
|
||||
|
||||
|
||||
}
|
||||
.view:hover {
|
||||
color: #000;
|
||||
@@ -1553,6 +1556,7 @@ export default {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-transform: capitalize;
|
||||
|
||||
|
||||
&:hover {
|
||||
@@ -2074,6 +2078,8 @@ export default {
|
||||
margin-left: 8px;
|
||||
color: #6e3edb;
|
||||
// background: palegoldenrod;
|
||||
text-transform: capitalize;
|
||||
|
||||
}
|
||||
.view:hover {
|
||||
color: #000;
|
||||
@@ -2142,6 +2148,7 @@ export default {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-transform: capitalize;
|
||||
|
||||
|
||||
&:hover {
|
||||
@@ -2769,7 +2776,7 @@ export default {
|
||||
}
|
||||
span {
|
||||
margin-top: 10px;
|
||||
text-transform: uppercase;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
}
|
||||
.computationalPower {
|
||||
@@ -3403,7 +3410,7 @@ export default {
|
||||
// }
|
||||
|
||||
// span {
|
||||
// text-transform: uppercase;
|
||||
// text-transform: capitalize;
|
||||
// // margin-top: 5px;
|
||||
// // background: gold;
|
||||
// width: 90%;
|
||||
@@ -3474,6 +3481,8 @@ export default {
|
||||
margin-left: 8px;
|
||||
color: #6e3edb;
|
||||
// background: palegoldenrod;
|
||||
text-transform: capitalize;
|
||||
|
||||
}
|
||||
.view:hover {
|
||||
color: #000;
|
||||
@@ -3555,6 +3564,8 @@ i {
|
||||
margin-left: 8px;
|
||||
color: #6e3edb;
|
||||
// background: palegoldenrod;
|
||||
text-transform: capitalize;
|
||||
|
||||
}
|
||||
.view:hover {
|
||||
color: #000;
|
||||
@@ -3589,6 +3600,7 @@ i {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-transform: capitalize;
|
||||
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -109,6 +109,8 @@ export default {
|
||||
* 获取文档类型名称
|
||||
*/
|
||||
getDocumentTypeName(type) {
|
||||
console.log(type,"typ俯瞰风景分开发饭饭登记费记得发e",this.documentTypes);
|
||||
|
||||
try {
|
||||
let label = this.documentTypes.find(item => item.value == type)?.label
|
||||
return this.$t(label)
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
<div class="result-header">
|
||||
<div class="header-container">
|
||||
<div class="header-left">
|
||||
<h1 class="page-title">搜索结果</h1>
|
||||
<h1 class="page-title">{{ $t(`backendSystem.searchResult`) || `搜索结果` }} </h1>
|
||||
<p class="search-info" v-if="searchResults.length > 0">
|
||||
关键词 "<strong>{{ searchKeyword }}</strong>" 找到 <strong>{{ totalCount }}</strong> 条相关结果
|
||||
{{ $t(`backendSystem.keyword`) || `关键词` }} "<strong>{{ searchKeyword }}</strong>" {{ $t(`backendSystem.find`) || `找到` }} <strong>{{ totalCount }}</strong> {{ $t(`backendSystem.relatedResults`) || `条相关结果` }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<el-button type="primary" @click="goBack">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
返回搜索
|
||||
{{ $t(`backendSystem.returnSearch`) || `返回搜索` }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,7 +73,7 @@
|
||||
@click.stop="handlePreview(item)"
|
||||
>
|
||||
<i class="el-icon-view"></i>
|
||||
预览
|
||||
{{ $t(`backendSystem.preview`) || `预览` }}
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
@@ -85,9 +85,9 @@
|
||||
<div class="no-result-icon">
|
||||
<i class="el-icon-search"></i>
|
||||
</div>
|
||||
<h3>未找到相关结果</h3>
|
||||
<p>关键词 "<strong>{{ searchKeyword }}</strong>" 没有找到匹配的文档</p>
|
||||
<el-button type="primary" @click="goBack">重新搜索</el-button>
|
||||
<h3>{{ $t(`backendSystem.noResult`) || `未找到相关结果` }}</h3>
|
||||
<p>{{ $t(`backendSystem.keyword`) || `关键词` }} "<strong>{{ searchKeyword }}</strong>" {{ $t(`backendSystem.noMatch`) || `没有找到匹配的文档` }}</p>
|
||||
<el-button type="primary" @click="goBack">{{ $t(`backendSystem.resetSearch`) || `重新搜索` }}</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
<!-- 预览对话框 -->
|
||||
<el-dialog
|
||||
title="文档预览"
|
||||
:title="$t(`backendSystem.documentPreview`) || `文档预览`"
|
||||
:visible.sync="previewVisible"
|
||||
width="80%"
|
||||
:before-close="handlePreviewClose"
|
||||
@@ -116,9 +116,9 @@
|
||||
<div class="preview-content" v-if="previewData">
|
||||
<h2>{{ previewData.title }}</h2>
|
||||
<div class="preview-meta">
|
||||
<span>类型:{{ getDocumentTypeName(previewData.type) }}</span>
|
||||
<span>创建时间:{{ formatDate(previewData.createTime) }}</span>
|
||||
<span>创建者:{{ previewData.createUser }}</span>
|
||||
<span>{{ $t(`backendSystem.type`) || `类型` }}:{{ getDocumentTypeName(previewData.type) }}</span>
|
||||
<span>{{ $t(`backendSystem.createTime`) || `创建时间` }}:{{ formatDate(previewData.createTime) }}</span>
|
||||
<span>{{ $t(`backendSystem.createUser`) || `创建者` }}:{{ previewData.createUser }}</span>
|
||||
</div>
|
||||
<div class="preview-body" v-html="previewData.content"></div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
1
mining-pool/test/css/app-189e7968.08b6b890.css
Normal file
1
mining-pool/test/css/app-189e7968.08b6b890.css
Normal file
File diff suppressed because one or more lines are too long
1
mining-pool/test/css/chunk-vendors-bc050c32.6f97509c.css
Normal file
1
mining-pool/test/css/chunk-vendors-bc050c32.6f97509c.css
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><meta name=google-site-verification content=pKAZogQ0NQ6L4j9-V58WJMjm7zYCFwkJXSJzWu9UDM8><meta name=robots content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"><meta name=googlebot content="index, follow"><meta name=googlebot-news content="index, follow"><meta name=bingbot content="index, follow"><link rel=alternate hreflang=zh href=https://m2pool.com/zh><link rel=alternate hreflang=en href=https://m2pool.com/en><link rel=alternate hreflang=x-default href=https://m2pool.com/en><meta property=og:title content="M2pool - Stable leading high-yield mining pool"><meta property=og:description content="M2Pool provides professional mining services, supporting multiple cryptocurrency mining"><meta property=og:url content=https://m2pool.com/en><meta property=og:site_name content=M2Pool><meta property=og:type content=website><meta property=og:image content=https://m2pool.com/logo.png><link rel=icon href=/favicon.ico><link rel=stylesheet href=//at.alicdn.com/t/c/font_4582735_7i8wfzc0art.css><title>M2pool - Stable leading high-yield mining pool</title><meta name=keywords content="M2Pool, cryptocurrency mining pool,Entropyx(enx),entropyx, bitcoin mining, DGB mining, mining pool service, 加密货币矿池, 比特币挖矿, DGB挖矿"><meta name=description content="M2Pool provides professional mining services, supporting multiple cryptocurrency mining, including nexa, grs, mona, dgb, rxd, enx"><meta name=format-detection content="telephone=no"><meta name=apple-mobile-web-app-capable content=yes><script defer src=/js/chunk-vendors-945ce2fe.648a91a9.js></script><script defer src=/js/chunk-vendors-aacc2dbb.d317c558.js></script><script defer src=/js/chunk-vendors-bc050c32.3f2f14d2.js></script><script defer src=/js/chunk-vendors-3003db77.d0b93d36.js></script><script defer src=/js/chunk-vendors-9d134daf.bb668c99.js></script><script defer src=/js/chunk-vendors-439af1fa.48a48f35.js></script><script defer src=/js/chunk-vendors-5c533fba.b9c00e08.js></script><script defer src=/js/chunk-vendors-96cecd74.a7d9b845.js></script><script defer src=/js/chunk-vendors-c2f7d60e.3710fdc2.js></script><script defer src=/js/chunk-vendors-89d5c698.2190b4ca.js></script><script defer src=/js/chunk-vendors-377fed06.159de137.js></script><script defer src=/js/chunk-vendors-5a805870.4cfc0ae8.js></script><script defer src=/js/chunk-vendors-cf2e0a28.c6e99da0.js></script><script defer src=/js/chunk-vendors-c9ff040c.57bd8c18.js></script><script defer src=/js/app-42f9d7e6.a2ad6942.js></script><script defer src=/js/app-d87c119a.9b7e8112.js></script><script defer src=/js/app-5c551db8.6078f6e3.js></script><script defer src=/js/app-b4c4f6ec.c346427f.js></script><script defer src=/js/app-45954fd3.88a2b2bc.js></script><script defer src=/js/app-ca0caf25.ba8086a4.js></script><script defer src=/js/app-cfd820c8.9d119032.js></script><script defer src=/js/app-f035d474.a2a8f5af.js></script><script defer src=/js/app-7023e5b0.fc505df9.js></script><script defer src=/js/app-113c6c50.0117a862.js></script><link href=/css/chunk-vendors-5c533fba.6f97509c.css rel=stylesheet><link href=/css/app-42f9d7e6.3510b1e0.css rel=stylesheet><link href=/css/app-d87c119a.8d130cfb.css rel=stylesheet><link href=/css/app-b4c4f6ec.d99a94fb.css rel=stylesheet><link href=/css/app-45954fd3.bdb4aecd.css rel=stylesheet><link href=/css/app-ca0caf25.a1364666.css rel=stylesheet><link href=/css/app-cfd820c8.2f7622f2.css rel=stylesheet><link href=/css/app-f035d474.0348646a.css rel=stylesheet><link href=/css/app-7023e5b0.b2dd9d63.css rel=stylesheet><link href=/css/app-113c6c50.36a20683.css rel=stylesheet></head><body><div id=app></div></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><meta name=google-site-verification content=pKAZogQ0NQ6L4j9-V58WJMjm7zYCFwkJXSJzWu9UDM8><meta name=robots content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"><meta name=googlebot content="index, follow"><meta name=googlebot-news content="index, follow"><meta name=bingbot content="index, follow"><link rel=alternate hreflang=zh href=https://m2pool.com/zh><link rel=alternate hreflang=en href=https://m2pool.com/en><link rel=alternate hreflang=x-default href=https://m2pool.com/en><meta property=og:title content="M2pool - Stable leading high-yield mining pool"><meta property=og:description content="M2Pool provides professional mining services, supporting multiple cryptocurrency mining"><meta property=og:url content=https://m2pool.com/en><meta property=og:site_name content=M2Pool><meta property=og:type content=website><meta property=og:image content=https://m2pool.com/logo.png><link rel=icon href=/favicon.ico><link rel=stylesheet href=//at.alicdn.com/t/c/font_4582735_7i8wfzc0art.css><title>M2pool - Stable leading high-yield mining pool</title><meta name=keywords content="M2Pool, cryptocurrency mining pool,Entropyx(enx),entropyx, bitcoin mining, DGB mining, mining pool service, 加密货币矿池, 比特币挖矿, DGB挖矿"><meta name=description content="M2Pool provides professional mining services, supporting multiple cryptocurrency mining, including nexa, grs, mona, dgb, rxd, enx"><script defer=defer src=/js/chunk-vendors-c0d76f48.f34181ba.js></script><script defer=defer src=/js/chunk-vendors-bc050c32.8062ab74.js></script><script defer=defer src=/js/chunk-vendors-3003db77.d0b93d36.js></script><script defer=defer src=/js/chunk-vendors-9d134daf.bb668c99.js></script><script defer=defer src=/js/chunk-vendors-96cecd74.a7d9b845.js></script><script defer=defer src=/js/chunk-vendors-c2f7d60e.3710fdc2.js></script><script defer=defer src=/js/chunk-vendors-89d5c698.2190b4ca.js></script><script defer=defer src=/js/chunk-vendors-377fed06.0e89b4b7.js></script><script defer=defer src=/js/chunk-vendors-c9ff040c.57bd8c18.js></script><script defer=defer src=/js/app-42f9d7e6.2094f944.js></script><script defer=defer src=/js/app-5c551db8.47473daa.js></script><script defer=defer src=/js/app-45954fd3.021a00eb.js></script><script defer=defer src=/js/app-ca0caf25.6463d629.js></script><script defer=defer src=/js/app-f035d474.a2a8f5af.js></script><script defer=defer src=/js/app-113c6c50.f9ecb579.js></script><link href=/css/chunk-vendors-bc050c32.6f97509c.css rel=stylesheet><link href=/css/app-189e7968.08b6b890.css rel=stylesheet></head><body><div id=app></div></body></html>
|
||||
1
mining-pool/test/js/app-113c6c50.f9ecb579.js
Normal file
1
mining-pool/test/js/app-113c6c50.f9ecb579.js
Normal file
File diff suppressed because one or more lines are too long
1
mining-pool/test/js/app-42f9d7e6.2094f944.js
Normal file
1
mining-pool/test/js/app-42f9d7e6.2094f944.js
Normal file
File diff suppressed because one or more lines are too long
1
mining-pool/test/js/app-45954fd3.021a00eb.js
Normal file
1
mining-pool/test/js/app-45954fd3.021a00eb.js
Normal file
File diff suppressed because one or more lines are too long
1
mining-pool/test/js/app-5c551db8.47473daa.js
Normal file
1
mining-pool/test/js/app-5c551db8.47473daa.js
Normal file
File diff suppressed because one or more lines are too long
1
mining-pool/test/js/app-ca0caf25.6463d629.js
Normal file
1
mining-pool/test/js/app-ca0caf25.6463d629.js
Normal file
File diff suppressed because one or more lines are too long
30
mining-pool/test/js/chunk-vendors-377fed06.0e89b4b7.js
Normal file
30
mining-pool/test/js/chunk-vendors-377fed06.0e89b4b7.js
Normal file
File diff suppressed because one or more lines are too long
25
mining-pool/test/js/chunk-vendors-bc050c32.8062ab74.js
Normal file
25
mining-pool/test/js/chunk-vendors-bc050c32.8062ab74.js
Normal file
File diff suppressed because one or more lines are too long
2
mining-pool/test/js/chunk-vendors-c0d76f48.f34181ba.js
Normal file
2
mining-pool/test/js/chunk-vendors-c0d76f48.f34181ba.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,278 +1,53 @@
|
||||
const { defineConfig } = require('@vue/cli-service');
|
||||
const path = require('path');
|
||||
const PrerenderSPAPlugin = require('@dreysolano/prerender-spa-plugin');
|
||||
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer;
|
||||
const SitemapWebpackPlugin = require('sitemap-webpack-plugin').default;
|
||||
const CompressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
module.exports = defineConfig({
|
||||
transpileDependencies: true,
|
||||
|
||||
devServer: {
|
||||
hot: true, // 启用HMR
|
||||
liveReload: true, // 启用实时重载
|
||||
client: {
|
||||
overlay: false // 禁用错误遮罩层
|
||||
}
|
||||
},
|
||||
// 生产环境不生成source map
|
||||
productionSourceMap: false,
|
||||
|
||||
configureWebpack: config => {
|
||||
const baseConfig = {
|
||||
cache: {
|
||||
type: 'filesystem', // 使用文件系统缓存 加快二次构建速度 减少重复编译
|
||||
buildDependencies: {
|
||||
config: [__filename]
|
||||
},
|
||||
// 添加缓存配置
|
||||
cacheDirectory: path.resolve(__dirname, 'node_modules/.cache/webpack'),
|
||||
name: process.env.NODE_ENV // 区分环境
|
||||
},
|
||||
configureWebpack: {
|
||||
optimization: {
|
||||
moduleIds: 'deterministic',
|
||||
splitChunks: { // 代码分割配置文件系统缓存比内存缓存更持久 可以在多次构建之间复用编译结果
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
minSize: 30000, // 最小分块大小
|
||||
maxSize: 300000, // 最大分块大小 避免单个文件过大
|
||||
cacheGroups: { // 缓存组配置
|
||||
vendors: { // 第三方库分组
|
||||
minSize: 100000, // 增加最小分块大小到100KB
|
||||
maxSize: 500000, // 增加最大分块大小到500KB
|
||||
cacheGroups: {
|
||||
vendors: {
|
||||
name: 'chunk-vendors',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: -10,
|
||||
chunks: 'initial'
|
||||
},
|
||||
common: { // 公共模块分组
|
||||
common: {
|
||||
name: 'chunk-common',
|
||||
minChunks: 2,
|
||||
priority: -20,
|
||||
chunks: 'initial',
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
plugins: [ //压缩静态资源 减少传输体积 提升加载速度
|
||||
new CompressionPlugin({
|
||||
test: /\.(js|css|html|svg)$/,
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
]
|
||||
};
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// 优化预渲染插件配置
|
||||
const prerenderPlugin = new PrerenderSPAPlugin({
|
||||
staticDir: path.join(__dirname, 'dist'),
|
||||
// 只预渲染最重要的路由
|
||||
routes: ['/zh', '/en','/en/dataDisplay', '/zh/dataDisplay','/zh/rate', '/en/rate','/zh/ServiceTerms', '/en/ServiceTerms','/zh/apiFile', '/en/apiFile'],
|
||||
renderer: new Renderer({
|
||||
renderAfterTime: 1000, // 增加等待时间,确保内容加载完成
|
||||
maxConcurrentRoutes:2, // 降低并发数,避免资源竞争
|
||||
timeout: 10000, // 增加超时时间
|
||||
headless: true,
|
||||
|
||||
|
||||
|
||||
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
|
||||
const zhSitemapPlugin = new SitemapWebpackPlugin({
|
||||
base: 'https://m2pool.com/zh',
|
||||
paths: [
|
||||
{
|
||||
path: '/zh',
|
||||
changefreq: 'daily',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/dataDisplay',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/ServiceTerms',
|
||||
changefreq: 'monthly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/apiFile',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/rate',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/nexaAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/grsAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/monaAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/dgbsAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/dgbqAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/dgboAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/zh/AccessMiningPool/rxdAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
],
|
||||
options: {
|
||||
filename: 'sitemap-zh.xml',
|
||||
lastmod: true,
|
||||
changefreq: 'weekly',
|
||||
priority: 0.7
|
||||
}
|
||||
});
|
||||
|
||||
const enSitemapPlugin = new SitemapWebpackPlugin({
|
||||
base: 'https://m2pool.com/en',
|
||||
paths: [
|
||||
{
|
||||
path: '/en',
|
||||
priority: 1.0,
|
||||
changefreq: 'daily',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/dataDisplay',
|
||||
priority: 0.8,
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/ServiceTerms',
|
||||
priority: 0.6,
|
||||
changefreq: 'monthly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/apiFile',
|
||||
priority: 0.7,
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/rate',
|
||||
priority: 0.8,
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/nexaAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/grsAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/monaAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/dgbsAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/dgbqAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/dgboAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
path: '/en/AccessMiningPool/rxdAccess',
|
||||
changefreq: 'weekly',
|
||||
lastmod: new Date().toISOString()
|
||||
},
|
||||
|
||||
],
|
||||
options: {
|
||||
filename: 'sitemap-en.xml',
|
||||
lastmod: true,
|
||||
changefreq: 'weekly',
|
||||
priority: 0.7
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
baseConfig.plugins.push(zhSitemapPlugin);
|
||||
baseConfig.plugins.push(enSitemapPlugin);
|
||||
baseConfig.plugins.push(prerenderPlugin);
|
||||
|
||||
}
|
||||
|
||||
return baseConfig;
|
||||
},
|
||||
|
||||
chainWebpack: config => {
|
||||
// HTML压缩配置
|
||||
// 移除 prefetch 插件,减少不必要的预加载
|
||||
config.plugins.delete('prefetch');
|
||||
|
||||
// 简化HTML压缩
|
||||
config.plugin('html').tap(args => {
|
||||
args[0].minify = {
|
||||
removeComments: true, // 删除 HTML 注释减小文件体积
|
||||
collapseWhitespace: true, // 压缩空白字符 删除多余的空格和换行
|
||||
removeAttributeQuotes: true, // 删除属性的引号
|
||||
collapseBooleanAttributes: true, // 简化布尔属性
|
||||
removeScriptTypeAttributes: true // 删除默认的 script type 属性type="text/javascript"
|
||||
};
|
||||
// META 标签配置
|
||||
args[0].meta = {
|
||||
// 移动端视口配置
|
||||
viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no',
|
||||
'format-detection': 'telephone=no',// 禁用电话号码自动识别
|
||||
'apple-mobile-web-app-capable': 'yes' // 支持添加到 iOS 主屏幕
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
};
|
||||
return args;
|
||||
});
|
||||
|
||||
// 移除 prefetch 插件
|
||||
//禁用 Vue CLI 默认的预取功能 prefetch 会在主资源加载完后,
|
||||
// 自动下载所有其他路由的资源对于大型应用,可能会预加载过多不必要的资源
|
||||
config.plugins.delete('prefetch')
|
||||
},
|
||||
//生产环境不生成 source map 文件源码映射信息 减小打包体积 提高网站安全性
|
||||
productionSourceMap: false,
|
||||
|
||||
css: {
|
||||
extract: true, //组件中的 CSS 提取至独立的 CSS 文件中 支持并行加载,减少页面阻塞
|
||||
sourceMap: false,// CSS 不启用 source maps 减少构建文件大小
|
||||
loaderOptions: {
|
||||
css: {}
|
||||
}
|
||||
extract: true,
|
||||
sourceMap: false
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user