https://58.213.48.102:20004/api/blade-resource/oss/endpoint/down-file?path=upload%2F28167f42-84f3-4ac1-a8b7-979919d6b881.docx,js截取/blade到最后
时间: 2024-09-12 09:08:13 浏览: 40
在JavaScript中,要截取从`/blade`到最后的部分,你可以使用`split`方法配合`join`方法来实现。首先,使用`split`以`/`为分隔符将字符串分割成数组,然后使用`slice`方法跳过前面不需要的部分,最后使用`join`将数组重新组合成字符串。
以下是一个示例代码:
```javascript
var url = "https://58.213.48.102:20004/api/blade-resource/oss/endpoint/down-file?path=upload%2F28167f42-84f3-4ac1-a8b7-979919d6b881.docx";
var parts = url.split("/");
var result = parts.slice(parts.indexOf("blade")).join("/");
console.log(result); // 输出: blade-resource/oss/endpoint/down-file?path=upload%2F28167f42-84f3-4ac1-a8b7-979919d6b881.docx
```
这段代码首先将URL按`/`分割成数组,然后找到`blade`第一次出现的位置,并从这个位置开始截取到数组的末尾。最后,将截取的部分重新用`/`连接成一个新的字符串。
相关问题
执行mvn install:install-file -Dfile=/path/to/aliyun-sdk-oss-2.9.3.jar -DgroupId=com.aliyun.oss -DartifactId=aliyun-sdk-oss -Dversion=2.9.3 -Dpackaging=jar 提示The specified file 'D:\path\to\aliyun-sdk-oss-2.9.3.jar' not exists
The error message is indicating that the specified file does not exist on the given path. Have you replaced "/path/to/aliyun-sdk-oss-2.9.3.jar" with the actual path to the file on your system? Make sure to replace it with the correct path to the file. If the file is located in the D drive, you need to replace "/path/to/" with "D:\".
For example, if the file is located in "D:\aliyun-sdk-oss-2.9.3.jar", you should use the following command:
```
mvn install:install-file -Dfile=D:\aliyun-sdk-oss-2.9.3.jar -DgroupId=com.aliyun.oss -DartifactId=aliyun-sdk-oss -Dversion=2.9.3 -Dpackaging=jar
```
Make sure to replace the file path and any other parameters with the correct values according to your system and project requirements.
阅读全文