本地开发
This commit is contained in:
@@ -1,22 +1,3 @@
|
||||
/**
|
||||
* getUrlKey 截取地址栏参数
|
||||
* @param value
|
||||
* @returns {String}
|
||||
*/
|
||||
export function getUrlParam(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
||||
let url = window.location.href.split('#')[0];
|
||||
let search = url.split('?')[1];
|
||||
console.log(search);
|
||||
if (search) {
|
||||
var r = search.substr(0).match(reg);
|
||||
if (r !== null) {
|
||||
return unescape(r[2]);
|
||||
}
|
||||
return null;
|
||||
} else return null;
|
||||
|
||||
}
|
||||
|
||||
export function appInit(ms) {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -26,6 +7,7 @@ export function appInit(ms) {
|
||||
var hd_userId = uni.getStorageSync("hd_userid")
|
||||
if(hd_userId){
|
||||
uni.setStorageSync("userId",hd_userId)
|
||||
|
||||
}else{
|
||||
console.log("============未获取到hd_userid")
|
||||
}
|
||||
@@ -46,9 +28,29 @@ export function appInit(ms) {
|
||||
resolve("ok")
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
uni.setStorageSync("initReady",null)
|
||||
}
|
||||
}, ms);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getUrlKey 截取地址栏参数
|
||||
* @param value
|
||||
* @returns {String}
|
||||
*/
|
||||
export function getUrlParam(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
||||
let url = window.location.href
|
||||
let search = url.split('?')[1];
|
||||
console.log(search);
|
||||
if (search) {
|
||||
var r = search.substr(0).match(reg);
|
||||
if (r !== null) {
|
||||
return unescape(r[2]);
|
||||
}
|
||||
return null;
|
||||
} else return null;
|
||||
}
|
||||
Reference in New Issue
Block a user