Skip to content

Commit bacab14

Browse files
committed
优化一行代码
1 parent 421a58c commit bacab14

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

public/js/app/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ function timeStock($scope, $http) {
7878
});
7979
}
8080

81-
ajaxStock();
81+
8282
function startGetStock(){
8383
var now = new Date();
84-
hours = now.getHours();
85-
if(hours>9&&hours<20){
86-
ajaxStock();
84+
var hours = now.getHours();
85+
if(hours>9&&hours<15){
8786
time=setTimeout(function(){
8887
startGetStock();
8988
},5000);
9089
}
90+
ajaxStock();
9191
}
9292
startGetStock();
9393

public/js/req/controllers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ requirejs(['jquery','angular','angularRoute','bootstrap','header','app','index']
3232
//路由
3333
app.config(function($routeProvider) {
3434
$routeProvider.when('/index', {
35-
templateUrl: 'app/index.html',
35+
templateUrl: 'app/index.html'
3636
controller:indexCtrl
3737
});
3838
// $routeProvider.when('/login', {

0 commit comments

Comments
 (0)