-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
76 lines (75 loc) · 2.86 KB
/
index.html
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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script type="text/javascript">
window.officeConfig = {
//0表示jsplugins.xml模式,1表示publish模式,2表示多进程加动态传递jsplugins.xml模式(使用0请到根目录下修改jsplugins.xml的url)
MODE: 1,
// WpsOAAssist路径,必须以“/”结尾
WPS_URL: "{$config['wps_open_api']}/static/wps/WpsOAAssist/",
// EtOAAssist路径,必须以“/”结尾
ETO_URL: '{$config['wps_open_api ']}/static/wps/EtOAAssist/',
// WppOAAssist路径,必须以“/”结尾
WPP_URL: '{$config['wps_open_api ']}/static/wps/WppOAAssist/',
// jsPlugins.xml文件路径
XML_URL: '{$config['wps_open_api ']}/static/wps/jsplugins.xml'
}
</script>
<script src="{$config['wps_open_api']}/static/wps/js/wpsjsrpcsdk.js" type="text/javascript" charset="utf-8">
</script>
<script src="{$config['wps_open_api']}/static/wps/js/wps.js" type="text/javascript" charset="utf-8">
</script>
<title>正在唤起WPS Office客户端</title>
</head>
<body>
<div style="height: 1048px;display: flex;justify-content: center;margin-top: 30px;font-size: 32px">
正在打开中(
<span id="seconds">20</span>
秒后自动关闭窗口)...
</div>
</body>
<script type="text/javascript">
window.onload = function() {
const downloadPath =
"{$config['wps_open_api']}{$config['wps_open_pass']}/file/wps/downloading/{$fileId}";
const uploadPath = "{$config['wps_open_api']}{$config['wps_open_pass']}/file/wps/uploading";
console.log(uploadPath)
const uploadFieldName = 'file';
const openName = "{$userInfo['name']}";
const id = "{$id}";
const token = "{$token}";
const openFileName = "{$file["
file_origin_name "]}";
const type = "{$type}";
const fileId = "{$fileId}";
_WpsInvoke([{
"OpenDoc": {
"uploadPath": uploadPath, // 保存文档上传接口(必填非空)
"fileName": downloadPath, // 下载文档接口(必填非空)
"uploadFieldName": uploadFieldName, // 上传文件字段(必填非空)
"userName": openName, // 打开文档用户(必填非空)
"id": id, // 信息ID
"headerToken": token, // 登录Token(必填非空)
"openName": openFileName, // 打开文档名称(不填会从下载文档接口响应头参数Content-Disposition中截取文件名,请确保该参数是不出问题,否则会打开文档失败)
"accessoryType": type, // 信息类型
"fileId": fileId, // 文件ID
}
}])
countdown(20);
}
const countdown = function(timeout) {
document.getElementById('seconds').innerHTML = timeout;
if (timeout == 0) {
window.close();
} else {
timeout--;
setTimeout(function() {
countdown(timeout)
}, 1000);
}
}
</script>
</html>