* 设置请求路径
(url)
| 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 |