MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / setUrl

Method setUrl

mini_program/common/ServiceBase.js:155–165  ·  view source on GitHub ↗

* 设置请求路径

(url)

Source from the content-addressed store, hash-verified

153 * 设置请求路径
154 */
155 setUrl(url) {
156 let ishttp = /^http(s)?:\/\/.*/i.test(url);
157 if(ishttp){
158 return url
159 }
160 if(url.startsWith("/")||this.$$basePath.endsWith("/")){
161 return `${this.$$basePath}${this.$$prefix}${url}`
162 }else{
163 return `${this.$$basePath}/${this.$$prefix}${url}`
164 }
165 }
166
167 /**
168 * 设置请求的 header , header 中不能设置 Referer

Callers 1

__defaultRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected