|
@@ -85,15 +85,27 @@
|
|
|
created: function () {
|
|
|
// return get_present_data()
|
|
|
|
|
|
- if (!localStorage.getItem('frontend-userid')) {
|
|
|
- this.$router.push('login');
|
|
|
- return;
|
|
|
- }
|
|
|
- let userId = localStorage.getItem("frontend-userid");
|
|
|
- // 判断userId 是不是空的
|
|
|
+ let openid = this.$route.query.o;
|
|
|
+ console.log('openid: ');
|
|
|
+ console.log(openid);
|
|
|
+ let userid = '';
|
|
|
+ BasicFunction.get_data("smartUsers/list?isDel=0&wxOpenid=" + openid, function (response) {
|
|
|
+ console.log("------ User Info --------");
|
|
|
+ console.log(response);
|
|
|
+ if (response.ret === "10000") {
|
|
|
+ let user = response.model.list[0];
|
|
|
+ userid = user.uid;
|
|
|
+ localStorage.setItem('frontend-userid', userid);
|
|
|
+ } else {
|
|
|
+ // 失败的处理
|
|
|
+ console.warn("获取用户信息失败");
|
|
|
+ this.$router.push('warning');
|
|
|
+ }
|
|
|
+ }, {});
|
|
|
|
|
|
+ if (userid === '') return;
|
|
|
let presentList = [];
|
|
|
- BasicFunction.get_data("smartGoods/list?isDel=0&ownerId=" + userId, function (response) {
|
|
|
+ BasicFunction.get_data("smartGoods/list?isDel=0&ownerId" + userid, function (response) {
|
|
|
console.log("------ Data Rcvd in Index --------");
|
|
|
console.log(response);
|
|
|
if (response.ret === "10000") {
|