更新小程序仓库
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
getCurrentPageUrl,
|
||||
getCurrentPageParam
|
||||
} from "./getUrl"
|
||||
function formatUrl(){
|
||||
let redirectUrl=getCurrentPageUrl();
|
||||
let options=getCurrentPageParam();
|
||||
let params="";
|
||||
let url='';
|
||||
for (const key in options) {
|
||||
if(params){
|
||||
params=params+'&'+key+'='+options[key];
|
||||
}else{
|
||||
params=params+key+'='+options[key];
|
||||
}
|
||||
};
|
||||
if(params){
|
||||
url=redirectUrl+"?"+params
|
||||
}else{
|
||||
url=redirectUrl
|
||||
}
|
||||
return encodeURIComponent(url);
|
||||
}
|
||||
module.exports={
|
||||
formatUrl
|
||||
}
|
||||
Reference in New Issue
Block a user