Verschieden Settings hinzugefügt (inkomplett)

This commit is contained in:
Torsten Schulz
2024-07-22 20:55:33 +02:00
parent 89842ff6c5
commit 4c12303edc
23 changed files with 269 additions and 208 deletions

View File

@@ -28,11 +28,9 @@ const UserParam = sequelize.define('user_param', {
if (value) {
try {
const iv = generateIv();
console.log(value);
this.setDataValue('iv', iv.toString('hex'));
this.setDataValue('value', encrypt(value, iv));
this.setDataValue('value', encrypt(value.toString(), iv));
} catch (error) {
console.log('Error setting value:', error);
this.setDataValue('value', '');
}
}
@@ -43,7 +41,6 @@ const UserParam = sequelize.define('user_param', {
const iv = Buffer.from(this.getDataValue('iv'), 'hex');
return decrypt(value, iv);
} catch (error) {
console.log('Error getting value:', error);
return '';
}
}

View File

@@ -1,21 +1,21 @@
import User from './community/user.js';
import UserParam from './community/user_param.js';
import UserParamType from './type/user_param.js';
import Login from './logs/login.js';
import UserRightType from './type/user_right.js';
import UserRight from './community/user_right.js';
import SettingsType from './type/settings.js';
import UserParamValue from './type/user_param_value.js';
import UserParamType from './type/user_param.js';
import UserRightType from './type/user_right.js';
import User from './community/user.js';
import UserParam from './community/user_param.js';
import Login from './logs/login.js';
import UserRight from './community/user_right.js';
const models = {
User,
UserParam,
UserParamType,
Login,
UserRightType,
UserRight,
SettingsType,
UserParamValue,
UserParamType,
UserRightType,
User,
UserParam,
Login,
UserRight,
};
export default models;