#6434 - SignIn issue_improve-signInLogMethod #1848
|
@ -12,6 +12,7 @@
|
|||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"loopback",
|
||||
"salix",
|
||||
"fdescribe"
|
||||
]
|
||||
|
|
|
@ -124,6 +124,14 @@ module.exports = function(Self) {
|
|||
|
||||
return email.send();
|
||||
});
|
||||
|
||||
/**
|
||||
* Sign-in validate. *
|
||||
* @param {Integer} user The user
|
||||
* @param {Object} userToken Options
|
||||
* @param {Object} token accessToken
|
||||
* @param {Object} ctx context
|
||||
*/
|
||||
Self.signInValidate = async(user, userToken, token, ctx) => {
|
||||
const [[key, value]] = Object.entries(Self.userUses(user));
|
||||
const isOwner = Self.rawSql(`SELECT ? = ? `, [userToken[key], value]);
|
||||
|
@ -139,7 +147,13 @@ module.exports = function(Self) {
|
|||
}
|
||||
};
|
||||
|
||||
Self.validateLogin = async function(user, password, ctx = null) {
|
||||
/**
|
||||
* Validate login params*
|
||||
* @param {String} user The user
|
||||
* @param {String} password
|
||||
* @param {Object} ctx context
|
||||
*/
|
||||
Self.validateLogin = async function(user, password, ctx) {
|
||||
const loginInfo = Object.assign({password}, Self.userUses(user));
|
||||
const token = await Self.login(loginInfo, 'user');
|
||||
|
||||
|
|
|
@ -75,6 +75,20 @@ export default class Controller extends Section {
|
|||
});
|
||||
}
|
||||
|
||||
compareDate(date) {
|
||||
let today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
let timeTicket = new Date(date);
|
||||
timeTicket.setHours(0, 0, 0, 0);
|
||||
|
||||
let comparation = today - timeTicket;
|
||||
|
||||
if (comparation == 0)
|
||||
return 'warning';
|
||||
if (comparation < 0)
|
||||
return 'success';
|
||||
}
|
||||
|
||||
get checked() {
|
||||
const tickets = this.$.model.data || [];
|
||||
const checkedLines = [];
|
||||
|
|
Loading…
Reference in New Issue