feat(route): add 西南石油大学 (#9097)

* feat(route): add 西南石油大学

* typo
This commit is contained in:
CYTMWIA
2022-02-15 20:57:04 +08:00
committed by GitHub
parent 55657b7d64
commit d158e660eb
9 changed files with 342 additions and 0 deletions

22
lib/v2/swpu/utils.js Normal file
View File

@@ -0,0 +1,22 @@
function isCompleteUrl(url) {
return /^\w+?:\/\/.*?\//.test(url);
}
function joinUrl(url1, url2) {
if (isCompleteUrl(url2)) {
return url2;
}
if (!url1.endsWith('/')) {
url1 = url1 + '/';
}
if (url2.startsWith('/')) {
url2 = url2.substr(1);
}
return url1 + url2;
}
module.exports = {
joinUrl,
};