App-Android(使用App+htnl5框架,解决消息推送兼容SignalR问题)
loulijun2021
2022-09-26 272476c57140cd80a7137bf8ea5b87e68a872b49
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
(function(w) {
    // 格式化地址栏参数    将对象自动拼接成地址栏传参形式
    w.formatParams = function(data) {
        let temp = ''
        Object.keys(data).map((key, index) => {
            temp += '&' + key + '=' + data[key]
        })
        let firstCharAt = temp.charAt(0)
        temp = temp.replace(firstCharAt, '?')
        return temp;
    }
 
    w.topPopoverClick = function(type) {
 
        if (type === '操作指导') {
            console.log('操作指导')
        } else if (type === '成品追溯') {
            console.log('成品追溯')
        } else if (type === '退出登录') {
            const data = {
                userid: localStorage.getItem('userid'),
                usercode: localStorage.getItem('usercode'),
                username: localStorage.getItem('username'),
                usertype: localStorage.getItem('usertype')
            }
            post('Login/LoginAppOut' + formatParams(data)).then(res => {
                if (res.code === '200') {
                    window.location.href = '../login/index.html'
                }
            })
        }
 
        // return 1
    }
 
})(window);