askbot-dragon 0.6.17 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/babel.config.js +5 -5
- package/dragon.iml +7 -7
- package/package.json +54 -52
- package/public/index.html +27 -26
- package/src/App.vue +31 -31
- package/src/api/index.js +1 -1
- package/src/api/mock.http +2 -2
- package/src/api/requestUrl.js +185 -185
- package/src/assets/less/common.css +6760 -6760
- package/src/assets/less/converSationContainer/common.less +4751 -4751
- package/src/assets/less/converSationContainer/converSatonContainer.less +492 -492
- package/src/assets/less/ticketMessage.less +319 -319
- package/src/components/ActionAlertIframe.vue +117 -117
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +1388 -1388
- package/src/components/FileType.vue +88 -88
- package/src/components/Message.vue +27 -27
- package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
- package/src/components/ask-components/Msgloading.vue +37 -37
- package/src/components/ask-components/SatisfactionV2.vue +15 -15
- package/src/components/chatContent.vue +512 -512
- package/src/components/feedBack.vue +133 -133
- package/src/components/file/AliyunOssComponents.vue +109 -109
- package/src/components/formTemplate.vue +1898 -2039
- package/src/components/message/ActionAlertIframe.vue +116 -116
- package/src/components/message/ShopMessage.vue +168 -168
- package/src/components/message/TextMessage.vue +895 -895
- package/src/components/message/TicketMessage.vue +173 -173
- package/src/components/message/swiper/index.js +4 -4
- package/src/components/message/swiper/ticketSwiper.vue +530 -530
- package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
- package/src/components/selector/hOption.vue +20 -20
- package/src/components/selector/hSelector.vue +199 -199
- package/src/components/selector/hWrapper.vue +216 -216
- package/src/components/source/BotMessage.vue +24 -24
- package/src/components/source/CustomMessage.vue +24 -24
- package/src/components/test.vue +260 -260
- package/src/components/utils/AliyunIssUtil.js +72 -72
- package/src/components/utils/ckeditor.js +124 -0
- package/src/components/utils/format_date.js +18 -18
- package/src/components/utils/index.js +6 -6
- package/src/components/utils/math_utils.js +15 -15
- package/src/main.js +44 -43
- package/vue.config.js +34 -28
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
const OSS = require('ali-oss');
|
|
2
|
-
|
|
3
|
-
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
4
|
-
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
5
|
-
|
|
6
|
-
function uid(len) {
|
|
7
|
-
let i = 0, tmp = (len || 11);
|
|
8
|
-
if (!BUFFER || ((IDX + tmp) > SIZE * 2)) {
|
|
9
|
-
for (BUFFER = '', IDX = 0; i < SIZE; i++) {
|
|
10
|
-
BUFFER += HEX[Math.random() * 256 | 0];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return BUFFER.substring(IDX, IDX++ + tmp);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function dataFormat(fmt, date = new Date()) {
|
|
18
|
-
const o = {
|
|
19
|
-
"M+": date.getMonth() + 1, //月份
|
|
20
|
-
"d+": date.getDate(), //日
|
|
21
|
-
"h+": date.getHours(), //小时
|
|
22
|
-
"m+": date.getMinutes(), //分
|
|
23
|
-
"s+": date.getSeconds(), //秒
|
|
24
|
-
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
|
|
25
|
-
"S": date.getMilliseconds() //毫秒
|
|
26
|
-
};
|
|
27
|
-
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
28
|
-
for (const k in o)
|
|
29
|
-
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
30
|
-
return fmt;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function pathGenerate(filename) {
|
|
34
|
-
return "front-oss/" + dataFormat("yyyy/MM/dd/hh/mm/") + uid(32) + "/" + filename;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function upload(ossConfig, data) {
|
|
39
|
-
let ossClient = new OSS(ossConfig);
|
|
40
|
-
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
41
|
-
let objectKey = pathGenerate(data.name);
|
|
42
|
-
let result = ossClient.put(objectKey, data);
|
|
43
|
-
console.debug(result);
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function multipartUpload(ossConfig, data, callback,extCallback) {
|
|
48
|
-
let ossClient = new OSS(ossConfig);
|
|
49
|
-
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
50
|
-
let objectKey = pathGenerate(data.name);
|
|
51
|
-
|
|
52
|
-
let res = ossClient.multipartUpload(objectKey, data, {
|
|
53
|
-
progress: function (p, checkpoint) {
|
|
54
|
-
console.debug('progress callback', p, checkpoint);
|
|
55
|
-
// 断点记录点。浏览器重启后无法直接继续上传,您需要手动触发上传操作。
|
|
56
|
-
if (callback && callback instanceof Function) {
|
|
57
|
-
callback(p, checkpoint,data,extCallback);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
return res;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function ossFileUrl(ossConfig, path, cname) {
|
|
65
|
-
if (cname == null) {
|
|
66
|
-
return 'https://' + ossConfig.bucket + '.' + ossConfig.region + '.aliyuncs.com/' + path;
|
|
67
|
-
} else {
|
|
68
|
-
return cname + '/' + path;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export {upload, multipartUpload, ossFileUrl}
|
|
1
|
+
const OSS = require('ali-oss');
|
|
2
|
+
|
|
3
|
+
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
4
|
+
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
5
|
+
|
|
6
|
+
function uid(len) {
|
|
7
|
+
let i = 0, tmp = (len || 11);
|
|
8
|
+
if (!BUFFER || ((IDX + tmp) > SIZE * 2)) {
|
|
9
|
+
for (BUFFER = '', IDX = 0; i < SIZE; i++) {
|
|
10
|
+
BUFFER += HEX[Math.random() * 256 | 0];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return BUFFER.substring(IDX, IDX++ + tmp);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function dataFormat(fmt, date = new Date()) {
|
|
18
|
+
const o = {
|
|
19
|
+
"M+": date.getMonth() + 1, //月份
|
|
20
|
+
"d+": date.getDate(), //日
|
|
21
|
+
"h+": date.getHours(), //小时
|
|
22
|
+
"m+": date.getMinutes(), //分
|
|
23
|
+
"s+": date.getSeconds(), //秒
|
|
24
|
+
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
|
|
25
|
+
"S": date.getMilliseconds() //毫秒
|
|
26
|
+
};
|
|
27
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
28
|
+
for (const k in o)
|
|
29
|
+
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
30
|
+
return fmt;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function pathGenerate(filename) {
|
|
34
|
+
return "front-oss/" + dataFormat("yyyy/MM/dd/hh/mm/") + uid(32) + "/" + filename;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
function upload(ossConfig, data) {
|
|
39
|
+
let ossClient = new OSS(ossConfig);
|
|
40
|
+
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
41
|
+
let objectKey = pathGenerate(data.name);
|
|
42
|
+
let result = ossClient.put(objectKey, data);
|
|
43
|
+
console.debug(result);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function multipartUpload(ossConfig, data, callback,extCallback) {
|
|
48
|
+
let ossClient = new OSS(ossConfig);
|
|
49
|
+
// object-key可以自定义为文件名(例如file.txt)或目录(例如abc/test/file.txt)的形式,实现将文件上传至当前Bucket或Bucket下的指定目录。
|
|
50
|
+
let objectKey = pathGenerate(data.name);
|
|
51
|
+
|
|
52
|
+
let res = ossClient.multipartUpload(objectKey, data, {
|
|
53
|
+
progress: function (p, checkpoint) {
|
|
54
|
+
console.debug('progress callback', p, checkpoint);
|
|
55
|
+
// 断点记录点。浏览器重启后无法直接继续上传,您需要手动触发上传操作。
|
|
56
|
+
if (callback && callback instanceof Function) {
|
|
57
|
+
callback(p, checkpoint,data,extCallback);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
return res;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ossFileUrl(ossConfig, path, cname) {
|
|
65
|
+
if (cname == null) {
|
|
66
|
+
return 'https://' + ossConfig.bucket + '.' + ossConfig.region + '.aliyuncs.com/' + path;
|
|
67
|
+
} else {
|
|
68
|
+
return cname + '/' + path;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {upload, multipartUpload, ossFileUrl}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {multipartUpload, ossFileUrl} from "./AliyunIssUtil";
|
|
2
|
+
const ossConfig={
|
|
3
|
+
region: "oss-cn-zhangjiakou",
|
|
4
|
+
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
5
|
+
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
6
|
+
accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
7
|
+
// stsToken: '<Your securityToken(STS)>',
|
|
8
|
+
bucket: "guoranopen-zjk",
|
|
9
|
+
}
|
|
10
|
+
class MyUploadAdapter {
|
|
11
|
+
constructor( loader ) {
|
|
12
|
+
// 要在上载期间使用的文件加载器实例
|
|
13
|
+
this.loader = loader;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 启动上载过程
|
|
17
|
+
upload() {
|
|
18
|
+
return this.loader.file
|
|
19
|
+
.then( file => new Promise( ( resolve ) => {
|
|
20
|
+
/* this._initRequest();
|
|
21
|
+
this._initListeners( resolve, reject, file );
|
|
22
|
+
this._sendRequest( file );*/
|
|
23
|
+
this.uploadFile(file,resolve)
|
|
24
|
+
} ) );
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 中止上载过程
|
|
28
|
+
abort() {
|
|
29
|
+
if ( this.xhr ) {
|
|
30
|
+
this.xhr.abort();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
uploadFile(file,resolve){
|
|
34
|
+
let imgInfo = {
|
|
35
|
+
url:'',
|
|
36
|
+
}
|
|
37
|
+
let res = multipartUpload(
|
|
38
|
+
ossConfig,
|
|
39
|
+
file,
|
|
40
|
+
null,
|
|
41
|
+
imgInfo
|
|
42
|
+
);
|
|
43
|
+
res.then(resp=>{
|
|
44
|
+
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
45
|
+
console.log(imgInfo)
|
|
46
|
+
resolve({
|
|
47
|
+
default:imgInfo.url
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
// 使用传递给构造函数的URL初始化XMLHttpRequest对象.
|
|
52
|
+
_initRequest() {
|
|
53
|
+
const xhr = this.xhr = new XMLHttpRequest();
|
|
54
|
+
console.log(xhr)
|
|
55
|
+
xhr.open( 'POST', '/open-api/oss/public?token=8c98087dfd2d48f856d8c95c09115def', true );
|
|
56
|
+
xhr.responseType = '';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 初始化 XMLHttpRequest 监听.
|
|
60
|
+
_initListeners( resolve, reject, file ) {
|
|
61
|
+
const xhr = this.xhr;
|
|
62
|
+
const loader = this.loader;
|
|
63
|
+
console.log(this.loader)
|
|
64
|
+
const genericErrorText = `无法上传文件: ${ file.name }.`;
|
|
65
|
+
|
|
66
|
+
xhr.addEventListener( 'error', () => reject( genericErrorText ) );
|
|
67
|
+
xhr.addEventListener( 'abort', () => reject() );
|
|
68
|
+
xhr.addEventListener( 'load', () => {
|
|
69
|
+
const response = xhr.response;
|
|
70
|
+
// 当code==200说明上传成功,可以增加弹框提示;
|
|
71
|
+
// 当上传失败时,必须调用reject()函数。
|
|
72
|
+
|
|
73
|
+
console.log('response', xhr)
|
|
74
|
+
|
|
75
|
+
if ( !response || response.error ) {
|
|
76
|
+
return reject( response && response.error ? response.error.message : genericErrorText );
|
|
77
|
+
}
|
|
78
|
+
//上传成功,从后台获取图片的url地址
|
|
79
|
+
resolve( {
|
|
80
|
+
default: response
|
|
81
|
+
} );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
// 支持时上传进度。文件加载器有#uploadTotal和#upload属性,用于在编辑器用户界面中显示上载进度栏。
|
|
85
|
+
if ( xhr.upload ) {
|
|
86
|
+
xhr.upload.addEventListener( 'progress', evt => {
|
|
87
|
+
if ( evt.lengthComputable ) {
|
|
88
|
+
loader.uploadTotal = evt.total;
|
|
89
|
+
loader.uploaded = evt.loaded;
|
|
90
|
+
}
|
|
91
|
+
} );
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 准备数据并发送请求
|
|
96
|
+
_sendRequest( file ) {
|
|
97
|
+
//通过FormData构造函数创建一个空对象
|
|
98
|
+
const data = new FormData();
|
|
99
|
+
//通过append()方法在末尾追加key为files值为file的数据
|
|
100
|
+
|
|
101
|
+
console.log('file',file)
|
|
102
|
+
data.append( 'file', file );//上传的参数data
|
|
103
|
+
// data.append( 'memberId', "666" );
|
|
104
|
+
/**
|
|
105
|
+
* 重要提示:这是实现诸如身份验证和CSRF保护等安全机制的正确位置。
|
|
106
|
+
* 例如,可以使用XMLHttpRequest.setRequestHeader()设置包含应用程序先前生成的CSRF令牌的请求头。
|
|
107
|
+
*/
|
|
108
|
+
this.xhr.send( data );
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function MyCustomUploadAdapterPlugin( editor ) {
|
|
113
|
+
editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => {
|
|
114
|
+
console.log('loader',loader)
|
|
115
|
+
|
|
116
|
+
// 在这里将URL配置为后端上载脚本
|
|
117
|
+
return new MyUploadAdapter( loader );
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
MyUploadAdapter,
|
|
123
|
+
MyCustomUploadAdapterPlugin
|
|
124
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const formatDate = (fmt) => { //author: meizz
|
|
2
|
-
var o = {
|
|
3
|
-
"M+": this.getMonth() + 1, //月份
|
|
4
|
-
"d+": this.getDate(), //日
|
|
5
|
-
"h+": this.getHours(), //小时
|
|
6
|
-
"m+": this.getMinutes(), //分
|
|
7
|
-
"s+": this.getSeconds(), //秒
|
|
8
|
-
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
9
|
-
"S": this.getMilliseconds() //毫秒
|
|
10
|
-
};
|
|
11
|
-
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
12
|
-
for (var k in o)
|
|
13
|
-
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
14
|
-
return fmt;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { formatDate };
|
|
18
|
-
|
|
1
|
+
const formatDate = (fmt) => { //author: meizz
|
|
2
|
+
var o = {
|
|
3
|
+
"M+": this.getMonth() + 1, //月份
|
|
4
|
+
"d+": this.getDate(), //日
|
|
5
|
+
"h+": this.getHours(), //小时
|
|
6
|
+
"m+": this.getMinutes(), //分
|
|
7
|
+
"s+": this.getSeconds(), //秒
|
|
8
|
+
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
9
|
+
"S": this.getMilliseconds() //毫秒
|
|
10
|
+
};
|
|
11
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
12
|
+
for (var k in o)
|
|
13
|
+
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
14
|
+
return fmt;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { formatDate };
|
|
18
|
+
|
|
19
19
|
// new Date("2019-12-14T00:09:16.000+0000").Format("yyyy-MM-dd hh:mm:ss")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {formatDate} from './format_date';
|
|
2
|
-
|
|
3
|
-
let utils = {
|
|
4
|
-
formatDate
|
|
5
|
-
}
|
|
6
|
-
|
|
1
|
+
import {formatDate} from './format_date';
|
|
2
|
+
|
|
3
|
+
let utils = {
|
|
4
|
+
formatDate
|
|
5
|
+
}
|
|
6
|
+
|
|
7
7
|
export { utils }
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
//生成从minNum到maxNum-1的随机数
|
|
2
|
-
function randomNum(minNum,maxNum){
|
|
3
|
-
switch(arguments.length){
|
|
4
|
-
case 1:
|
|
5
|
-
return parseInt(Math.random()*minNum+1,10)-1;
|
|
6
|
-
case 2:
|
|
7
|
-
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10)-1;
|
|
8
|
-
default:
|
|
9
|
-
return 0;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
randomNum
|
|
15
|
-
}
|
|
1
|
+
//生成从minNum到maxNum-1的随机数
|
|
2
|
+
function randomNum(minNum,maxNum){
|
|
3
|
+
switch(arguments.length){
|
|
4
|
+
case 1:
|
|
5
|
+
return parseInt(Math.random()*minNum+1,10)-1;
|
|
6
|
+
case 2:
|
|
7
|
+
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10)-1;
|
|
8
|
+
default:
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
randomNum
|
|
15
|
+
}
|
package/src/main.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
import VueResource from 'vue-resource'
|
|
4
|
-
import ElementUI from 'element-ui';
|
|
5
|
-
import { requestUrl } from './api/index';
|
|
6
|
-
import { utils } from '../src/components/utils/index';
|
|
7
|
-
/*import 'element-ui/lib/theme-chalk/index.css';*/
|
|
8
|
-
import './assets/theme/index.css'
|
|
9
|
-
import 'video.js/dist/video-js.css'
|
|
10
|
-
import Vant from 'vant';
|
|
11
|
-
import 'vant/lib/index.css';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Vue.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Vue.
|
|
37
|
-
Vue.use(
|
|
38
|
-
Vue.
|
|
39
|
-
Vue.prototype.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import VueResource from 'vue-resource'
|
|
4
|
+
import ElementUI from 'element-ui';
|
|
5
|
+
import { requestUrl } from './api/index';
|
|
6
|
+
import { utils } from '../src/components/utils/index';
|
|
7
|
+
/*import 'element-ui/lib/theme-chalk/index.css';*/
|
|
8
|
+
import './assets/theme/index.css'
|
|
9
|
+
import 'video.js/dist/video-js.css'
|
|
10
|
+
import Vant from 'vant';
|
|
11
|
+
import 'vant/lib/index.css';
|
|
12
|
+
|
|
13
|
+
import CKEditor from '@ckeditor/ckeditor5-vue';
|
|
14
|
+
Vue.use(CKEditor);
|
|
15
|
+
/*import VConsole from 'vconsole'
|
|
16
|
+
const vConsole = new VConsole();
|
|
17
|
+
Vue.use(vConsole);*/
|
|
18
|
+
import $ from 'jquery'
|
|
19
|
+
Vue.prototype._$ = $;
|
|
20
|
+
Vue.use(Vant);
|
|
21
|
+
Date.prototype.Format = function (fmt) { //author: meizz
|
|
22
|
+
var o = {
|
|
23
|
+
"M+": this.getMonth() + 1, //月份
|
|
24
|
+
"d+": this.getDate(), //日
|
|
25
|
+
"h+": this.getHours(), //小时
|
|
26
|
+
"m+": this.getMinutes(), //分
|
|
27
|
+
"s+": this.getSeconds(), //秒
|
|
28
|
+
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
29
|
+
"S": this.getMilliseconds() //毫秒
|
|
30
|
+
};
|
|
31
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
32
|
+
for (var k in o)
|
|
33
|
+
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
34
|
+
return fmt;
|
|
35
|
+
}
|
|
36
|
+
Vue.config.productionTip = false
|
|
37
|
+
Vue.use(VueResource)
|
|
38
|
+
Vue.use(ElementUI)
|
|
39
|
+
Vue.prototype.requestUrl = requestUrl;
|
|
40
|
+
Vue.prototype.utils = utils;
|
|
41
|
+
|
|
42
|
+
new Vue({
|
|
43
|
+
render: h => h(App),
|
|
44
|
+
}).$mount('#app')
|
package/vue.config.js
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
const webpack = require('webpack')
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
// 修改的配置
|
|
6
|
-
// 将baseUrl: '/api',改为baseUrl: '/',
|
|
7
|
-
devServer: {
|
|
8
|
-
port: '8081', // 指定打开浏览器的端口号
|
|
9
|
-
proxy: {
|
|
10
|
-
'/api/': {
|
|
11
|
-
// target: 'http://test.open.abitai.com:9001',
|
|
12
|
-
target: 'http://test.open.askbot.cn:32001',
|
|
13
|
-
changeOrigin: true,
|
|
14
|
-
ws: true,
|
|
15
|
-
pathRewrite: {
|
|
16
|
-
'^/api': '/'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
'/open/': {
|
|
20
|
-
target: 'http://new-test.guoranbot.com:32001',
|
|
21
|
-
changeOrigin: true,
|
|
22
|
-
pathRewrite: {
|
|
23
|
-
'^/open': '/'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
|
|
1
|
+
const webpack = require('webpack')
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
// 修改的配置
|
|
6
|
+
// 将baseUrl: '/api',改为baseUrl: '/',
|
|
7
|
+
devServer: {
|
|
8
|
+
port: '8081', // 指定打开浏览器的端口号
|
|
9
|
+
proxy: {
|
|
10
|
+
'/api/': {
|
|
11
|
+
// target: 'http://test.open.abitai.com:9001',
|
|
12
|
+
target: 'http://test.open.askbot.cn:32001',
|
|
13
|
+
changeOrigin: true,
|
|
14
|
+
ws: true,
|
|
15
|
+
pathRewrite: {
|
|
16
|
+
'^/api': '/'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
'/open/': {
|
|
20
|
+
target: 'http://new-test.guoranbot.com:32001',
|
|
21
|
+
changeOrigin: true,
|
|
22
|
+
pathRewrite: {
|
|
23
|
+
'^/open': '/'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
configureWebpack: {
|
|
29
|
+
|
|
30
|
+
externals: {
|
|
31
|
+
'ckeditor': 'CKEDITOR'
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
|
|
29
35
|
};
|