Skip to content

Commit

Permalink
add jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
paicha committed Feb 11, 2016
1 parent 4e317fd commit 7c99b1d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"globals": {
"$": true,
"wx": true
},
"browser": true,
"indent": 4
}
15 changes: 9 additions & 6 deletions main/static/scripts/auth.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

$(function() {
$('#submit').tap(function() {
var username = $('#username').val().replace(/\s+/g, '');
Expand All @@ -6,13 +8,14 @@ $(function() {
if (!!username && !!password) {
$('#loadingToast').show();
// 判断绑定类型
if ($('.page_title').text() == '微信查成绩') {
var data = {
var data;
if ($('.page_title').text() === '微信查成绩') {
data = {
studentid: username,
studentpwd: password
};
} else {
var data = {
data = {
libraryid: username,
librarypwd: password
};
Expand All @@ -21,8 +24,8 @@ $(function() {
$.post(window.location.href, data, function(res) {
$('#loadingToast').hide();
if (res.errmsg === 'ok') {
$('.page.msg').show()
// 绑定成功3秒后关闭窗口
$('.page.msg').show();
// 绑定成功3秒后关闭窗口
setTimeout(function() {
wx.closeWindow();
}, 3000);
Expand All @@ -31,7 +34,7 @@ $(function() {
$('#err_msg').text(res.errmsg);
$('.weui_dialog_alert').show();
}
})
});
} else {
// 提示输入格式不正确
$('.js_tooltips').show();
Expand Down

0 comments on commit 7c99b1d

Please sign in to comment.