根据url来获取分享用户的id

This commit is contained in:
zhl 2019-02-28 11:20:43 +08:00
parent f3a78fb8f6
commit 6bf7bb02b3
2 changed files with 15 additions and 2 deletions

View File

@ -76,7 +76,7 @@ cc.Class({
// LIFE-CYCLE CALLBACKS:
onLoad () {
this.shareUser = '5c7655c484dde4098f2196fa';
this.shareUser = stringUtil.getRequest('uid');
let self = this;
webapi.preLogin({})
.then(rep => {

View File

@ -9,6 +9,19 @@ export default {
return /^[a-z,0-9]{4}$/.test(code);
},
parseMobile(mobile) {
return mobile.slice(0,3) + '****' + mobile.slice(7);
return mobile.slice(0, 3) + '****' + mobile.slice(7);
},
getRequest(name) {
var url = location.search;
var theRequest = {};
if (url.indexOf("?") !== -1) {
var str = url.substr(1);
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest[name];
}
}