emailURL.html
1.32 KB
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
<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>