代码拉取完成,页面将自动刷新
同步操作将从 后盾人/HDJS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/**
* 前端模块配置
* @author 向军 <2300071698@qq.com>
*/
config = {
urlArgs: 'version=4.0.18',
baseUrl: window.hdjs.base,
paths: {
hdjs: 'hdjs',
css: 'css.min',
domReady: 'domReady',
vue: 'package/vue.min',
scrollTo: 'package/jquery.scrollTo.min',
Aliplayer: 'package/aliplayer-min',
//微信JSSDK
jweixin: 'http://res.wx.qq.com/open/js/jweixin-1.2.0',
//百度编辑器
ueditor: 'package/ueditor/ueditor.all',
//代码高亮
prism: 'package/prism/prism',
//剪贴版
ZeroClipboard: 'package/ZeroClipboard.min',
//JS验证
validator: 'package/validator.min',
//上传组件
webuploader: 'package/webuploader/dist/webuploader',
bootstrap: 'package/bootstrap.bundle.min',
lodash: 'package/lodash.min',
moment: 'package/moment.min',
oss: 'component/oss',
'jquery-mousewheel': 'package/jquery.mousewheel.min',
jquery: 'package/jquery.min',
axios: 'package/axios.min',
codemirror: 'package/codemirror.min',
plupload: 'package/plupload/plupload.full.min',
simditor: 'package/simditor/scripts/simditor',
'simditor-fullscreen': 'package/simditor/simditor-fullscreen-master/lib/simditor-fullscreen',
'marked': 'package/marked.min',
'to-markdown': 'package/to-markdown.min',
'simditor-markdown': 'package/simditor/simditor-markdown/lib/simditor-markdown',
'simditor-dropzone': 'package/simditor/simditor-dropzone/lib/simditor-dropzone',
'simple-module': 'package/simditor/scripts/module',
DPlayer: 'package/dplayer/DPlayer.min',
highlight: 'package/highlight.min',
MarkdownIt: 'package/markdown-it.min',
//editor.md
prettify: 'package/prettify.min',
raphael: 'package/editor.md/lib/raphael.min',
underscore: 'package/underscore-min',
flowchart: 'package/editor.md/lib/flowchart.min',
jqueryflowchart: 'package/editor.md/lib/jquery.flowchart.min',
sequenceDiagram: 'package/editor.md/lib/sequence-diagram.min',
katex: 'package/katex.min',
editormd: 'package/editor.md/editormd.amd',
iziToast: 'package/iziToast/iziToast.min',
tuiEditor: 'https://uicdn.toast.com/tui-editor/latest/tui-editor-Editor',
//
bootstrapTable: 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.2/locale/bootstrap-table-zh-CN.min'
},
shim: {
bootstrapTable: {
deps: [
'jquery',
'bootstrap',
'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.2/bootstrap-table.min.js',
'css!http://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.2/bootstrap-table.min.css'
]
},
tuiEditor: {
deps: [
'/bower_components/tui-code-snippet/dist/tui-code-snippet.js'
]
},
iziToast: {
deps: ['css!package/iziToast/iziToast.min.css']
},
bootstrap: {
deps: ['jquery']
},
hdjs: {
deps: ['css!package/font-awesome-4.7.0/css/font-awesome.min.css']
},
DPlayer: {
deps: ['css!package/dplayer/DPlayer.min.css']
},
simditor: {
deps: [
'jquery',
'package/simditor/scripts/module',
'package/simditor/scripts/hotkeys',
'package/simditor/scripts/uploader',
'css!package/simditor/simditor-fullscreen-master/styles/simditor-fullscreen.css',
'css!package/simditor/styles/simditor.css',
'css!package/simditor/styles/hdjs.css',
'css!package/simditor/simditor-markdown/styles/simditor-markdown.css'
]
},
plupload: {
exports: 'plupload'
},
highlight: {
deps: ['css!https://cdn.bootcss.com/highlight.js/9.12.0/styles/atom-one-dark.min.css']
},
editormd: {
deps: [
'underscore',
'flowchart',
'sequenceDiagram',
'css!package/editor.md/css/editormd.css',
'css!package/editor.md/lib/codemirror/codemirror.min.css'
]
},
sequenceDiagram: {
deps: [
'raphael'
]
},
jqueryflowchart: {
deps: ['flowchart', 'raphael']
},
webuploader: {
deps: ['css!package/webuploader/css/webuploader.css']
},
prism: {
deps: [
'css!package/prism/prism.css'
]
},
ueditor: {
deps: ['ZeroClipboard', 'package/ueditor/ueditor.config']
}
},
waitSeconds: 30
};
if (hdjs.requireJs) {
config.paths = Object.assign(config.paths, hdjs.requireJs.paths);
config.shim = Object.assign(config.shim, hdjs.requireJs.shim);
}
// console.log(config);
require.config(config);
require([
'jquery',
'axios'
], function ($, axios) {
window.$ = window.jQuery = $
//全局错误定义
$.ajaxSetup({
error: function (XMLHttpRequest, textStatus, errorThrown) {
require(['hdjs'], function (hdjs) {
if (XMLHttpRequest.responseJSON) {
if (XMLHttpRequest.responseJSON.message) {
hdjs.message(XMLHttpRequest.responseJSON.message);
} else {
hdjs.message(JSON.stringify(XMLHttpRequest.responseJSON));
}
} else {
hdjs.message('网站忙碌,请稍候连接');
}
})
}
});
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
//为异步请求设置CSRF令牌
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': token.content
}
});
}
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。