From c93dfd257a2cdbc4ea72c90045694b97c686f7e6 Mon Sep 17 00:00:00 2001 From: tower1229 Date: Wed, 24 Jan 2018 19:12:14 +0800 Subject: [PATCH] v1.1.5 --- package.json | 2 +- sdk/server.js | 4 +--- view/member/index/script.js | 10 ++++++---- view/member/login/script.js | 7 +++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 26c9105..6ebb270 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hybridstart", - "version": "1.0.1", + "version": "1.1.5", "description": "A hybrid application development framework", "main": "lib/index.js", "directories": { diff --git a/sdk/server.js b/sdk/server.js index fa8aa32..929e0b6 100644 --- a/sdk/server.js +++ b/sdk/server.js @@ -79,8 +79,6 @@ define(function(require, exports, module) { if (!userData) { return app.toast('初始化用户信息失败'); } - userData.photo = _source($.trim(userData.photo)); - userData.realName = $.trim(userData.realName); app.storage.val('user', userData); //app初始化 app.storage.val('appInit', 1); @@ -137,7 +135,7 @@ define(function(require, exports, module) { bgclose: false }); }); - return {}; + return null; } return _user; }; diff --git a/view/member/index/script.js b/view/member/index/script.js index ee6b765..3030feb 100644 --- a/view/member/index/script.js +++ b/view/member/index/script.js @@ -11,12 +11,14 @@ define(function(require) { if (reload) { userData = comm.getUser(); } - if(userData.headImg){ - $('#avat')[0].src = userData.headImg; + if(userData){ + if(userData.headImg){ + $('#avat')[0].src = userData.headImg; + } + $('#usern')[0].innerText = (userData.nickName); + $('#score')[0].innerText = (userData.nowScore); } - $('#usern')[0].innerText = (userData.nickName); - $('#score')[0].innerText = (userData.nowScore); }; $('#avat')[0].addEventListener('touchend',function(){ app.openView(null,'member','setPersonal'); diff --git a/view/member/login/script.js b/view/member/login/script.js index dc7ec2c..c051336 100644 --- a/view/member/login/script.js +++ b/view/member/login/script.js @@ -31,6 +31,13 @@ define(function(require) { app.loading.hide(); if (res.status === 'Y') { //初始化用户数据 + comm.initUser({ + tag:'tag1', + id: 123, + nowScore: 100, + nickName: '斑斑', + headImg: "../index/head.jpg" + }); setTimeout(function() { app.openView({ closeself: true