import {au_random} from '@ahg0313/utils'
au_random(1, 100)
import {au_telDesensitization} from '@ahg0313/utils'
au_telDesensitization('123') // ''
au_telDesensitization('15612345678') // 156****5678'
import {au_queryStrToObj} from '@ahg0313/utils'
au_queryStrToObj() // {a: 1, b: 2}
au_queryStrToObj() // {}
import {au_objToQueryStr} from '@ahg0313/utils'
au_objToQueryStr() // ''
au_objToQueryStr({a: 1, b: 2}) // 'a=1&b=2'
import {au_pictureCompression} from '@ahg0313/utils'
au_pictureCompression(file, {size, maxWidth, maxHeight}) // => {base64data, width, height}
import {au_base64ToFile} from '@ahg0313/utils'
au_base64ToFile(base64, fileName)
import {au_timeStampToDate} from '@ahg0313/utils'
au_timeStampToDate(Date.now(), '-') // yyyy-MM-dd HH:mm:ss
au_timeStampToDate(Date.now(), '/') // yyyy/MM/dd HH:mm:ss
import {au_cookie} from '@ahg0313/utils'
// 获取
au_cookie.get('key') // (key: string) => string | undefined
// 设置
// options = {
// expires: '',
// }
au_cookie.set('key', value, options) // (key: string, value: string, options: Object) => void
// 删除
au_cookie.remove('key', options)
更多文档请查看 js-cookie
import {au_localStorage} from '@ahg0313/utils'
// 设置
au_localStorage.set('key', {...val}) // (key: string, val: Object) => void
// 获取
au_localStorage.get(key) // (key: string) => Object | null
import {au_localStorage} from '@ahg0313/utils'
// 设置
au_sessionStorage.set('key', {...val}) // (key: string, val: Object) => void
// 获取
au_sessionStorage.get(key) // (key: string) => Object | null
import {au_isAndroid} from '@ahg0313/utils'
au_isAndroid()
import {au_isIOS} from '@ahg0313/utils'
au_isIOS()
import {au_isWx} from '@ahg0313/utils'
au_isWx()
import {au_getBrowser} from '@ahg0313/utils'
au_getBrowser() // {iPhone: boolean, webApp: boolean, qq: boolean, trident: boolean, gecko: boolean, weixin: boolean, android: boolean, mobile: boolean, iPad: boolean, ios: boolean, presto: boolean, webKit: boolean}