emailURL.html 1.32 KB
<html>
<head>
    <script>

        /**
         * 取地址栏参
         * @param name
         * @returns {*}
         */
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)
                return unescape(r[2])
            return null;
        }

        /**
         * 返回移动端和PC端地址
         * @param resourcetype
         * @param isPc
         * @returns {string}
         */
        function getResourceUrl(isPc) {
            var host = window.location.origin;
            if (isPc) {
                return host+"/common/chatResource/emailURL.jsp?requestid=";
            } else {
                return host+"/common/chatResource/view.html?resourcetype=0&resourceid=";
            }

        }

        function init(){

            var params = window.location.search;
            var requestid = getUrlParam('requestid');
            var clientType = getUrlParam('em_client_type');
            var isPc = clientType == null || clientType == 'pc';

            var url = getResourceUrl(isPc);
            url += requestid;
            url += params.replace('?','&');

            window.location.href = url;
        }

        init();

    </script>
</head>
<body>
</body>
</html>