|
楼主 |
发表于 2016-8-25 20:16:13
|
显示全部楼层
代码如下:
- // 点击登录
- Model.prototype.loginBtClick = function(event) {
- var username = this.comp('nameInput').val();
- var password = this.comp('passwordInput').val();
- // alert(username);
- var khdata = this.comp('baasData1');
- khdata.clear();
- var stuid = khdata.getValue("stuid");
- var pwd = khdata.getValue("pwd");
- // khdata.setFilter('filter0', "stuid='" + username + "' and pwd='" +
- // password + "'");
- khdata.filters.setVar("stuid", stuid);
- khdata.filters.setVar("pwd", pwd);
- khdata.refreshData();
- if (khdata.count() > 0) {
- justep.Util.hint("登录成功");
- // justep.Shell.userName.set(userData.val('stuid'));
- // justep.Shell.userId.set(userData.val('username'));
- justep.Shell.showPage({
- url : require.toUrl("./st_mainActivity.w")
- });
- } else {
- justep.Util.hint("账号密码错误");
- }
- }
复制代码
在queryUsers中的condition行默认值添加了 stuid =:stuid and pwd=:pwd |
|