haoutil.js 插件 知识点.txt

haoutil.js 插件 知识点.txt

1.获取 window.location.href 的 传参。
haoutil.system.getRequestByName("parameterName", defaultValue) -> parameterValue.

例如:http://localhost:63342/MarsGisPlatform/index.html?
config=http://xxxx/3D_Model/Project/b39cb2e0-47b6-11ea-93c5-000c29bc3fa5.json
&config2d=http://xxxx/2D_Model/Project/b39cb2e0-47b6-11ea-93c5-000c29bc3fa5.json

let config3dPath = haoutil.system.getRequestByName("config", URL_CONFIG.CONFIG_3D_URL);
// http://xxxx/3D_Model/Project/b39cb2e0-47b6-11ea-93c5-000c29bc3fa5.json
let config2dPath = haoutil.system.getRequestByName("config2d", URL_CONFIG.CONFIG_2D_URL);
// http://xxxx/2D_Model/Project/b39cb2e0-47b6-11ea-93c5-000c29bc3fa5.json


2.下载文件
haoutil.file.downloadFile('cs.json', JSON.stringify(e)),
其中,cs.json是文件名,JSON.stringify(e)是文件内容。
e, 可以是 js 中的对象 object,array。
经测试,默认下载到:C:\Users\Administrator\Downloads\路径下。
实例:https://blog.csdn.net/weixin_42193179/article/details/98869597


发布了197 篇原创文章 · 获赞 61 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/weixin_42193179/article/details/104950875