File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change 2
2
* @Author : Alex Dong
3
3
* @Date : 2020-07-29 13:21:07
4
4
* @Last Modified by: Alex Dong
5
- * @Last Modified time: 2022-05-07 15:41:28
5
+ * @Last Modified time: 2022-06-09 09:11:22
6
6
*/
7
7
8
8
define ( [
@@ -23,17 +23,15 @@ define([
23
23
this . _initSlider ( ) ;
24
24
} ,
25
25
26
- _uniqid : function ( a = "" , b = false ) {
27
- const c = Date . now ( ) / 1000 ;
28
- let d = c . toString ( 16 ) . split ( "." ) . join ( "" ) ;
29
- while ( d . length < 14 ) d += "0" ;
30
- let e = "" ;
31
- if ( b ) {
32
- e = "." ;
33
- e += Math . round ( Math . random ( ) * 100000000 ) ;
34
- }
35
- return a + d + e ;
36
- } ,
26
+ _ . uniqid = function ( length = 10 ) {
27
+ let result = '' ;
28
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ;
29
+ const charactersLength = characters . length ;
30
+ for ( let i = 0 ; i < length ; i ++ ) {
31
+ result += characters . charAt ( Math . floor ( Math . random ( ) * charactersLength ) ) ;
32
+ }
33
+ return result ;
34
+ } ;
37
35
38
36
_initSlider : function ( ) {
39
37
var options = this . options ;
You can’t perform that action at this time.
0 commit comments