MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / apiUrlToAuto

Function apiUrlToAuto

public/iframe/lib/js/commonFun.js:79–86  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

77 return [...map.values()];
78 },
79 apiUrlToAuto(url) {
80 // url中存在windowLocationOrigin的替换为自动获取
81 if (!url) return
82 const reg = /^http(s|):\/\/\S*?\//
83 const nowUrl = url.match(reg)[0]
84 const result = url.replace(nowUrl, "windowLocationOrigin/"); // 如果url中存在windowLocationOrigin 则替换为window.location.origin 自动获取
85 return result;
86 },
87 getPathByKey(arr, key, value) {
88 // arr为树形结构数组,value为要查询的树节点的标识值,key则为标识
89 // 获取指定节点的路径数组

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected