zhao_js
2023-11-21 19d5fa154937406af1dc8dc017a68c04e55e00ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function getUrlPar(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
 
 
function formatDate(time, fmt) {
    let date = new Date(time);
    const o = {
        'M+': date.getMonth() + 1, //月份
        'd+': date.getDate(), //日期
        'h+': date.getHours(), //小时
        'm+': date.getMinutes(), //分
        's+': date.getSeconds(), //秒
        'q+': Math.floor((date.getMonth() + 3) / 3), //季度
        'S': date.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substring(4 - RegExp.$1.length));
    }
    for (let k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) {
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substring(('' + o[k])
                .length)));
        }
    }
    return fmt;
}
 
function getAllowdId()
{
    return "ocUrg6nVVPhn-m6yNPg7igYnB64g,ocUrg6ud9UqAdLpqnA2sSf24EFd4,ocUrg6klrlpbPTnzMDr6R8WDmOXU,ocUrg6qawIzxqqzOHYy2a9YSfx_0";
}
 
function getSmsStatus(status) {
    switch (status) {
        case 0:
            return '发送中';
        case 1:
            return '发送中';
        case 2:
            return '发送失败';
        case 3:
            return '发送中';
        case 4:
            return '发送中';
        case 5:
            return '接收中';
        case 6:
            return '接收成功';
        case 7:
            return '接收失败';
        default:
            return '接收失败';
    }
}
 
 
function getBackSmsStatus(status) {
    switch (status) {
        case 0:
            return '审核中';
        case 1:
            return '审核成功';
        case 2:
            return '审核失败';
        case 3:
            return '等待发送';
        case 4:
            return '发送中';
        case 5:
            return '接收中';
        case 6:
            return '接收成功';
        case 7:
            return '接收失败';
        default:
            return '接收失败';
    }
}
 
module.exports = {
    getUrlPar,
    formatDate,
    getSmsStatus,
    getBackSmsStatus,
    getAllowdId
}