@@ -102,7 +102,7 @@ export async function systemLock (req, res, next) {
102102 return
103103 }
104104
105- await Settings . set ( Const . PW_USER_ADMINID , 'systemlock' , '1' )
105+ await Settings . set ( Const . PW_USER_ADMINID , Const . SYSTEM_LOCK , '1' )
106106 Config . generateJWTKey ( )
107107
108108 res . send ( R . ok ( ) )
@@ -121,7 +121,7 @@ export async function systemUnlock (req, res, next) {
121121 return
122122 }
123123
124- await Settings . set ( Const . PW_USER_ADMINID , 'systemlock' , '0' )
124+ await Settings . set ( Const . PW_USER_ADMINID , Const . SYSTEM_LOCK , '0' )
125125
126126 res . send ( R . ok ( ) )
127127}
@@ -139,7 +139,7 @@ export async function systemReadOnly (req, res, next) {
139139 return
140140 }
141141
142- await Cache . set ( Const . PW_USER_ADMINID , 'readonly' , true )
142+ await Cache . set ( Const . PW_USER_ADMINID , Const . SYSTEM_READONLY , true )
143143
144144 res . send ( R . ok ( ) )
145145}
@@ -157,7 +157,7 @@ export async function systemReadWrite (req, res, next) {
157157 return
158158 }
159159
160- await Cache . set ( Const . PW_USER_ADMINID , 'readonly' , false )
160+ await Cache . set ( Const . PW_USER_ADMINID , Const . SYSTEM_READONLY , false )
161161
162162 res . send ( R . ok ( ) )
163163}
@@ -169,7 +169,7 @@ export async function systemReadWrite (req, res, next) {
169169 * @param {Object } next Express next
170170 */
171171export async function systemGetReadOnly ( req , res , next ) {
172- const readonly = await Cache . get ( Const . PW_USER_ADMINID , 'readonly' )
172+ const readonly = await Cache . get ( Const . PW_USER_ADMINID , Const . SYSTEM_READONLY )
173173 res . send ( R . ok ( { readonly } ) )
174174}
175175
@@ -180,9 +180,9 @@ export async function systemGetReadOnly (req, res, next) {
180180 * @param {Object } next Express next
181181 */
182182export async function systemGetLock ( req , res , next ) {
183- const settings = await Settings . get ( Const . PW_USER_ADMINID , 'systemlock' )
183+ const settings = await Settings . get ( Const . PW_USER_ADMINID , Const . SYSTEM_LOCK )
184184 for ( const setting of settings ) {
185- if ( setting . setting === 'systemlock' ) {
185+ if ( setting . setting === Const . SYSTEM_LOCK ) {
186186 res . send ( R . ok ( { locked : setting . value === '1' } ) )
187187 return
188188 }
0 commit comments