123456789101112131415161718192021222324 |
- 'use strict';
- const { CrudService } = require('naf-framework-mongoose/lib/service');
- // 初始化
- class InstallService extends CrudService {
- constructor(ctx) {
- super(ctx, 'install');
- this.redis = this.app.redis;
- }
- async index() {
- await this.initProject();
- }
- /**
- * 初始化redis中,项目名的缓存
- */
- async initProject() {
- const project = [ 'platlive', 'zhwl', 'live' ];
- await this.redis.set('project', JSON.stringify(project));
- }
- }
- module.exports = InstallService;
|