mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 08:46:25 +02:00
feat(core): add table users and torrents global update method
for some fields update with time limit
This commit is contained in:
@@ -124,6 +124,9 @@
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.LATEST_SIGNED_TIME' | translate}}:</dt>
|
||||
<dd class="h-line">{{ vm.user.last_signed | date: 'yyyy-MM-dd HH:mm:ss' }}</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.LATEST_REFRESH_TIME' | translate}}:</dt>
|
||||
<dd class="h-line">{{ vm.user.refreshat | date: 'yyyy-MM-dd HH:mm:ss' }}</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.SIGNED_IP' | translate}}:</dt>
|
||||
<dd class="h-line">
|
||||
<div class="list-all-ips">
|
||||
|
||||
@@ -96,6 +96,9 @@
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.LATEST_SIGNED_TIME' | translate}}:</dt>
|
||||
<dd class="h-line">{{ vm.user.last_signed | date: 'yyyy-MM-dd HH:mm:ss' }}</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.LATEST_REFRESH_TIME' | translate}}:</dt>
|
||||
<dd class="h-line">{{ vm.user.refreshat | date: 'yyyy-MM-dd HH:mm:ss' }}</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.SIGNED_IP' | translate}}:</dt>
|
||||
<dd class="h-line">
|
||||
<div class="list-all-ips">
|
||||
|
||||
@@ -209,6 +209,10 @@ var UserSchema = new Schema({
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
refreshat: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
/* For reset password */
|
||||
resetPasswordToken: {
|
||||
type: String
|
||||
@@ -357,6 +361,15 @@ UserSchema.methods.addLeechedIp = function (ip) {
|
||||
}).exec();
|
||||
};
|
||||
|
||||
/**
|
||||
* globalUpdateMethod
|
||||
*/
|
||||
UserSchema.methods.globalUpdateMethod = function () {
|
||||
this.update({
|
||||
$set: {refreshat: Date.now()}
|
||||
}).exec();
|
||||
};
|
||||
|
||||
/**
|
||||
* update user last client_agent
|
||||
* @param ip
|
||||
|
||||
Reference in New Issue
Block a user