@ajaxjs/util 1.1.3 → 1.2.0

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/dist/index.esm.js CHANGED
@@ -1,525 +1,81 @@
1
- /**
2
- * 获取某个 Cookie
3
- *
4
- * @param name 键名称
5
- * @returns 值
6
- */
7
- function getCookie(name) {
8
- let arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
9
- // @ts-ignore
10
- if (arr = document.cookie.match(reg))
11
- return unescape(arr[2]);
12
- else
13
- return null;
14
- }
15
- /**
16
- * 设置某个 Cookie
17
- *
18
- * @param name 键名称
19
- * @param value 值
20
- */
21
- function setCookie(name, value) {
22
- let days = 2, exp = new Date();
23
- exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
24
- // @ts-ignore
25
- document.cookie = name + "=" + escape(value) + ";path=/;expires=" + exp.toGMTString();
26
- }
27
- /**
28
- * 清空 Cookie
29
- */
30
- function delCookie() {
31
- let keys = document.cookie.match(/[^ =;]+(?==)/g);
32
- if (keys) {
33
- let date = new Date(0).toUTCString();
34
- for (let i = keys.length; i--;) {
35
- document.cookie = keys[i] + '=0;path=/;expires=' + date; // 清除当前域名下的,例如:m.ratingdog.cn
36
- document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + date; // 清除当前域名下的,例如 .m.ratingdog.cn
37
- document.cookie = keys[i] + '=0;path=/;domain=' + location.host + ';expires=' + date; // 清除一级域名下的或指定的,例如 .ratingdog.cn
38
- }
39
- }
40
- }
41
-
42
- var cookies = /*#__PURE__*/Object.freeze({
43
- __proto__: null,
44
- delCookie: delCookie,
45
- getCookie: getCookie,
46
- setCookie: setCookie
47
- });
48
-
49
- /**
50
- * 向父级元素递归搜索
51
- *
52
- * @param _el 当前所在元素
53
- * @param tagName 目标标签名称
54
- * @param className 目标元素样式类
55
- * @returns 目标元素,找不到为 null
56
- */
57
- function up(_el, tagName, className) {
58
- if (tagName && className)
59
- throw '只能任选一种参数,不能同时传';
60
- let el = _el.parentNode;
61
- tagName = tagName && tagName.toUpperCase();
62
- while (el) {
63
- if (tagName && el.tagName == tagName)
64
- return el;
65
- if (className && el.className && ~el.className.indexOf(className))
66
- return el;
67
- el = el.parentNode;
68
- }
69
- return null;
70
- }
71
- /**
72
- * 加载脚本
73
- *
74
- * @param url 脚本地址
75
- * @param id 脚本元素 id,可选的
76
- * @param cb 回调函数,可选的
77
- */
78
- function loadScript(url, id, cb) {
79
- let script = document.createElement("script");
80
- script.src = url;
81
- if (cb)
82
- script.onload = cb;
83
- if (id)
84
- script.id = id;
85
- document.getElementsByTagName("head")[0].appendChild(script);
86
- }
87
-
88
- var dom = /*#__PURE__*/Object.freeze({
89
- __proto__: null,
90
- loadScript: loadScript,
91
- up: up
92
- });
93
-
94
- /**
95
- * 通用工具类
96
- */
97
- /**
98
- * 是否调试模式中
99
- *
100
- * 打包成组件之后不能用
101
- *
102
- * @returns
103
- */
104
- function isDebug() {
105
- // @ts-ignore
106
- return process.env.NODE_ENV === 'development';
107
- }
108
- function isDev() {
109
- let currentHostname = window.location.hostname;
110
- // 判断主机名是否是内网地址
111
- return (currentHostname.startsWith('192.168.') || currentHostname.startsWith('10.') || currentHostname === 'localhost');
112
- }
113
- /**
114
- * 日期格式化。详见博客文章:http://blog.csdn.net/zhangxin09/archive/2011/01/01/6111294.aspx
115
- * e.g: new Date().format("yyyy-MM-dd hh:mm:ss")
116
- *
117
- * @param {String} format
118
- * @return {String}
119
- */
120
- function dateFormat(format) {
121
- let $1, o = {
122
- "M+": this.getMonth() + 1, // 月份,从0开始算
123
- "d+": this.getDate(), // 日期
124
- "h+": this.getHours(), // 小时
125
- "m+": this.getMinutes(), // 分钟
126
- "s+": this.getSeconds(), // 秒钟
127
- // 季度 quarter
128
- "q+": Math.floor((this.getMonth() + 3) / 3),
129
- "S": this.getMilliseconds() // 千秒
130
- };
131
- if (/(y+)/.test(format))
132
- // @ts-ignore
133
- $1 = RegExp.$1, format = format.replace($1, String(this.getFullYear()).substr(4 - $1));
134
- let key, value;
135
- for (key in o) { // 如果没有指定该参数,则子字符串将延续到 stringvar 的最后。
136
- if (new RegExp("(" + key + ")").test(format)) {
137
- $1 = RegExp.$1,
138
- value = String(o[key]),
139
- value = $1.length == 1 ? value : ("00" + value).substr(value.length),
140
- format = format.replace($1, value);
141
- }
1
+ function request(api, method, bodyData, callback, header) {
2
+ let headers = {};
3
+ if (header)
4
+ for (const key in header)
5
+ headers[key] = header[key];
6
+ method = method.toUpperCase();
7
+ let body = bodyData;
8
+ if (bodyData && (method === 'POST' || method === 'PUT')) {
9
+ if (headers['Content-Type'] == 'application/json')
10
+ body = JSON.stringify(bodyData);
11
+ else if (headers['Content-Type'] == "application/x-www-form-urlencoded")
12
+ body = json2formParams(bodyData);
142
13
  }
143
- return format;
144
- }
145
- /**
146
- * 日期格式化
147
- * @author meizz
148
- * @param date 日期,必须为 Date 类型
149
- * @param fmt 格式模板
150
- * @returns 格式化后的字符串
151
- */
152
- function dateFormat2(date, fmt) {
153
- let o = {
154
- "M+": date.getMonth() + 1, // 月份
155
- "d+": date.getDate(), // 日
156
- "h+": date.getHours(), // 小时
157
- "m+": date.getMinutes(), //
158
- "s+": date.getSeconds(), // 秒
159
- "q+": Math.floor((date.getMonth() + 3) / 3), // 季度
160
- "S": date.getMilliseconds() // 毫秒
161
- };
162
- if (/(y+)/.test(fmt))
163
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
164
- for (var k in o)
165
- if (new RegExp("(" + k + ")").test(fmt)) {
166
- let obj = (RegExp.$1.length == 1) ? o[k] : ("00" + o[k]).substr(("" + o[k]).length);
167
- // @ts-ignore
168
- fmt = fmt.replace(RegExp.$1, obj);
169
- }
170
- return fmt;
171
- }
172
- /**
173
- * 并行和串行任务
174
- *
175
- * @author https://segmentfault.com/a/1190000013265925
176
- * @param arr
177
- * @param finnaly
178
- */
179
- function parallel(arr, _finally) {
180
- let fn, index = 0;
181
- // @ts-ignore
182
- let statusArr = Array(arr.length).fill().map(() => ({ isActive: false, data: null }));
183
- let isFinished = function () {
184
- return statusArr.every((item) => item.isActive === true);
185
- };
186
- let resolve = function (index) {
187
- return function (data) {
188
- statusArr[index].data = data;
189
- statusArr[index].isActive = true;
190
- let isFinish = isFinished();
191
- if (isFinish) {
192
- let datas = statusArr.map((item) => item.data);
193
- _finally(datas);
194
- }
195
- };
196
- };
197
- // @ts-ignore
198
- while ((fn = arr.shift())) {
199
- fn(resolve(index)); // 给 resolve 函数追加参数,可以使用 bind 函数实现,这里使用了柯里化
200
- index++;
201
- }
202
- }
203
- /**
204
- * 函数节流
205
- *
206
- * @author https://www.cnblogs.com/moqiutao/p/6875955.html
207
- * @param fn
208
- * @param delay
209
- * @param mustRunDelay
210
- */
211
- function throttle(fn, delay, mustRunDelay) {
212
- var timer, t_start;
213
- return function () {
214
- var t_curr = +new Date();
215
- window.clearTimeout(timer);
216
- if (!t_start)
217
- t_start = t_curr;
218
- if (t_curr - t_start >= mustRunDelay) {
219
- // @ts-ignore
220
- fn.apply(this, arguments);
221
- t_start = t_curr;
222
- }
223
- else {
224
- var args = arguments;
225
- // @ts-ignore
226
- timer = window.setTimeout(() => fn.apply(this, args), delay);
227
- }
228
- };
229
- }
230
- /**
231
- * 复制文字到剪切板
232
- *
233
- * @param {string} text
234
- */
235
- function copyToClipboard(text) {
236
- if (navigator.clipboard)
237
- navigator.clipboard.writeText(text); // clipboard api 复制
238
- else {
239
- let textarea = document.createElement('textarea');
240
- document.body.appendChild(textarea); // 隐藏此输入框
241
- textarea.style.position = 'fixed';
242
- textarea.style.clip = 'rect(0 0 0 0)';
243
- textarea.style.top = '10px';
244
- textarea.value = text; // 赋值
245
- textarea.select(); // 选中
246
- document.execCommand('copy', true); // 复制
247
- document.body.removeChild(textarea); // 移除输入框
248
- }
249
- }
250
-
251
- var utils = /*#__PURE__*/Object.freeze({
252
- __proto__: null,
253
- copyToClipboard: copyToClipboard,
254
- dateFormat: dateFormat,
255
- dateFormat2: dateFormat2,
256
- isDebug: isDebug,
257
- isDev: isDev,
258
- parallel: parallel,
259
- throttle: throttle
260
- });
261
-
262
- /**
263
- * 默认的请求配置
264
- */
265
- const DEFAULT_XHR_CFG = {
266
- timeout: 5000,
267
- withCredentials: false,
268
- parseContentType: 'json'
269
- };
270
- /**
271
- * 全局请求的 head 参数
272
- */
273
- let BASE_HEAD_PARAMS = null;
274
- /**
275
- * 设置全局请求的 head 参数
276
- *
277
- * @param param
278
- */
279
- function setBaseHeadParams(params) {
280
- if (BASE_HEAD_PARAMS === null)
281
- BASE_HEAD_PARAMS = {};
282
- Object.assign(BASE_HEAD_PARAMS, params);
283
- }
284
- /**
285
- *
286
- * @param getOrDel
287
- * @param url
288
- * @param cb
289
- * @param params
290
- * @param cfg
291
- */
292
- function getOrDel(getOrDel, url, cb, params, cfg = DEFAULT_XHR_CFG) {
293
- let xhr = initXhr(cfg);
294
- if (params != null) {
295
- if (url.indexOf('?') != -1)
296
- url += '&' + toParams(params);
297
- else
298
- url += '?' + toParams(params);
14
+ fetch(api, {
15
+ method,
16
+ headers: headers,
17
+ body,
18
+ credentials: 'include'
19
+ }).then(response => {
20
+ if (response.status === 404)
21
+ throw new Error('Not found 404: ' + api);
22
+ else if (response.status === 500)
23
+ throw new Error('Server error: ' + api);
24
+ else if (!response.ok)
25
+ throw new Error(`Unexpected status: ${response.status}`);
26
+ return response.json();
27
+ })
28
+ .then(data => {
29
+ if (callback)
30
+ callback(data); // 调用回调
31
+ })
32
+ .catch(error => {
33
+ console.error('Network error when fetching from: ' + api, error); // 网络错误时才会 reject Promise
34
+ });
35
+ }
36
+ function json2formParams(params) {
37
+ const pairs = [];
38
+ for (const [key, value] of Object.entries(params)) {
39
+ if (value !== null && value !== undefined && typeof value !== 'function')
40
+ pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
299
41
  }
300
- xhr.open(getOrDel.toUpperCase(), url, true);
301
- xhr.onreadystatechange = function () {
302
- responseHandle(this, cb, cfg);
303
- };
304
- if (BASE_HEAD_PARAMS) // 设置自定义请求头
305
- for (let key in BASE_HEAD_PARAMS)
306
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
307
- xhr.send();
308
- }
309
- /**
310
- *
311
- * @param method
312
- * @param url
313
- * @param cb
314
- * @param params
315
- * @param cfg
316
- */
317
- function postOrPut(method, url, cb, params, cfg = DEFAULT_XHR_CFG) {
318
- let xhr = initXhr(cfg);
319
- xhr.open(method, url, true);
320
- xhr.onreadystatechange = function () {
321
- responseHandle(this, cb, cfg);
322
- };
323
- if (BASE_HEAD_PARAMS) // 设置自定义请求头
324
- for (let key in BASE_HEAD_PARAMS)
325
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
326
- // 此方法必须在 open() 方法和 send() 之间调用
327
- if (!cfg.contentType) // 如未设置,默认为表单请求
328
- xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
329
- else
330
- xhr.setRequestHeader("Content-Type", cfg.contentType);
331
- let _params = typeof params != 'string' ? toParams(params) : params;
332
- if (_params)
333
- xhr.send(_params);
334
- else
335
- xhr.send();
336
- }
337
- /**
338
- *
339
- * @param url
340
- * @param cb
341
- * @param params
342
- * @param cfg
343
- */
344
- function xhr_post_upload(url, cb, params, cfg = DEFAULT_XHR_CFG) {
345
- let xhr = initXhr(cfg);
346
- xhr.open('post', url, true);
347
- xhr.onreadystatechange = function () {
348
- responseHandle(this, cb, cfg);
349
- };
350
- if (BASE_HEAD_PARAMS) // 设置自定义请求头
351
- for (let key in BASE_HEAD_PARAMS)
352
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
353
- // 什么 Content-Type 都不设置
354
- xhr.send(params);
355
- }
356
- /**
357
- * XHR GET 请求
358
- *
359
- * @param url 请求地址
360
- * @param cb 回调函数 @example (json: {}, text: string) => void;
361
- * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
362
- * @param cfg 配置,可选的
363
- */
364
- function xhr_get(url, cb, params, cfg = DEFAULT_XHR_CFG) {
365
- getOrDel('get', url, cb, params, cfg);
42
+ return pairs.join('&');
366
43
  }
367
44
  /**
368
- * XHR DELETE 请求
45
+ * HTTP GET 请求
369
46
  *
370
- * @param url 请求地址
371
- * @param cb 回调函数 @example (json: {}, text: string) => void;
372
- * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
373
- * @param cfg 配置,可选的
47
+ * @param api API 地址
48
+ * @param callback
49
+ * @param header
374
50
  */
375
- function xhr_del(url, cb, params, cfg = DEFAULT_XHR_CFG) {
376
- getOrDel('delete', url, cb, params, cfg);
51
+ function get(api, callback, header) {
52
+ request(api, 'GET', null, callback, header);
377
53
  }
378
- /**
379
- * XHR POST 请求
380
- *
381
- * @param url 请求地址
382
- * @param cb 回调函数 @example (json: {}, text: string) => void;
383
- * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
384
- * @param cfg 配置,可选的
385
- */
386
- function xhr_post(url, cb, params, cfg = DEFAULT_XHR_CFG) {
387
- postOrPut('post', url, cb, params, cfg);
388
- }
389
- /**
390
- * XHR PUT 请求
391
- *
392
- * @param url 请求地址
393
- * @param cb 回调函数 @example (json: {}, text: string) => void;
394
- * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
395
- * @param cfg 配置,可选的
396
- */
397
- function xhr_put(url, cb, params, cfg = DEFAULT_XHR_CFG) {
398
- postOrPut('put', url, cb, params, cfg);
54
+ function post(api, bodyData, callback, header) {
55
+ request(api, 'POST', bodyData, callback, Object.assign({ 'Content-Type': 'application/json' }, header));
399
56
  }
400
- /**
401
- * 初始化 XHR
402
- *
403
- * @param cfg
404
- * @returns
405
- */
406
- function initXhr(cfg) {
407
- let xhr = new XMLHttpRequest();
408
- if (cfg && cfg.timeout) {
409
- xhr.timeout = cfg.timeout;
410
- xhr.ontimeout = (e) => console.error('系统异常,XHR 连接服务超时');
411
- }
412
- if (cfg && cfg.withCredentials)
413
- xhr.withCredentials = true;
414
- return xhr;
57
+ function postForm(api, bodyData, callback, header) {
58
+ request(api, 'POST', bodyData, callback, Object.assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, header));
415
59
  }
416
- /**
417
- * 错误处理
418
- *
419
- * @param xhr
420
- */
421
- function errHandle(xhr) {
422
- let msg;
423
- if (xhr.status <= 400)
424
- msg = '请求参数错误或者权限不足。';
425
- else if (xhr.status <= 500)
426
- msg = '服务端异常。';
427
- else
428
- msg = `未知异常,HTTP code:${xhr.status}。`;
429
- if (!xhr.responseText)
430
- msg += " 服务端返回空的字符串!";
431
- console.error(msg, xhr.responseText);
60
+ function put(api, bodyData, callback, header) {
61
+ request(api, 'PUT', bodyData, callback, Object.assign({ 'Content-Type': 'application/json' }, header));
432
62
  }
433
- /**
434
- * 响应处理
435
- *
436
- * @param xhr
437
- * @param cb
438
- * @param cfg
439
- */
440
- function responseHandle(xhr, cb, cfg) {
441
- if (xhr.readyState == 4) {
442
- if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
443
- let text = xhr.responseText;
444
- let json;
445
- if (!text)
446
- console.warn('服务端没有返回任何字符串');
447
- switch (cfg.parseContentType) {
448
- case 'text':
449
- break;
450
- case 'xml':
451
- json = xhr.responseXML;
452
- break;
453
- case 'json':
454
- default:
455
- try {
456
- json = JSON.parse(text);
457
- }
458
- catch (e) {
459
- console.error('解析 JSON 时候发生错误,非法 JSON');
460
- console.warn(e);
461
- }
462
- }
463
- cb && cb(json, text);
464
- }
465
- else
466
- errHandle(xhr);
467
- }
468
- }
469
- /**
470
- * 对象转换为 URL 参数列表,用 & 分隔
471
- *
472
- * @param {Object} param JSON 对象
473
- * @returns URL 参数列表
474
- */
475
- function toParams(param) {
476
- let result = "";
477
- for (let name in param) {
478
- if (typeof param[name] != "function")
479
- result += "&" + name + "=" + encodeURIComponent(param[name]);
480
- }
481
- return result.substring(1);
482
- }
483
- /**
484
- * 获取 QueryString 的某个参数
485
- *
486
- * @param val
487
- * @returns
488
- */
489
- function getQuery(val) {
490
- const w = location.hash.indexOf('?');
491
- const query = location.hash.substring(w + 1);
492
- let vars = query.split('&');
493
- for (let i = 0; i < vars.length; i++) {
494
- const pair = vars[i].split('=');
495
- if (pair[0] == val)
496
- return pair[1];
497
- }
498
- return '';
63
+ function putForm(api, bodyData, callback, header) {
64
+ request(api, 'PUT', bodyData, callback, Object.assign({ 'Content-Type': 'application/x-www-form-urlencoded' }, header));
499
65
  }
500
- function getPageList(self, listArray, callback) {
501
- return (j) => {
502
- if (j.status) {
503
- listArray.total = j.total;
504
- listArray.data = j.data;
505
- callback && callback();
506
- }
507
- else
508
- self.$Message.warning(j.message || '获取数据失败');
509
- };
66
+ function del(api, callback, header) {
67
+ request(api, 'DELETE', null, callback, header);
510
68
  }
511
69
 
512
70
  var xhr = /*#__PURE__*/Object.freeze({
513
71
  __proto__: null,
514
- getPageList: getPageList,
515
- getQuery: getQuery,
516
- setBaseHeadParams: setBaseHeadParams,
517
- toParams: toParams,
518
- xhr_del: xhr_del,
519
- xhr_get: xhr_get,
520
- xhr_post: xhr_post,
521
- xhr_post_upload: xhr_post_upload,
522
- xhr_put: xhr_put
72
+ del: del,
73
+ get: get,
74
+ post: post,
75
+ postForm: postForm,
76
+ put: put,
77
+ putForm: putForm
523
78
  });
524
79
 
525
- export { cookies as Cookies, dom as Dom, utils as Utils, xhr as Xhr };
80
+ export { xhr as Xhr };
81
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/xhr.ts"],"sourcesContent":[null],"names":[],"mappings":"AAQA,SAAS,OAAO,CAAC,GAAW,EAAE,MAAc,EAAE,QAAa,EAAE,QAA0B,EAAE,MAAoB,EAAA;IACzG,IAAI,OAAO,GAAgB,EAAE;AAE7B,IAAA,IAAI,MAAM;QACN,KAAK,MAAM,GAAG,IAAI,MAAM;YACpB,OAAO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