15815213711
2024-08-26 67b8b6731811983447e053d4396b3708c14dfe3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const Utils = require('../utils');
const EEApplication = Symbol('Ee#Application');
const BuiltInApp = Symbol('Ee#BuiltInApp');
 
/**
 * EE
 */
const EE = {
 
  /**
   * 兼容1.x版本api
   */
  get Application() {
    const appClass = require('./application');
    return appClass;
  },
 
  /**
   * 设置实例化app对象
   */  
  set app(appObject) {
    if (!this[EEApplication]) {
      this[EEApplication] = appObject;
    }
  },
 
  /**
   * 获取实例化app对象
   */  
  get app() {
    return this[EEApplication] || null;
  },
 
  /**
   * 设置全局this到CoreApp (eeApp)
   */  
  set CoreApp(obj) {
    if (!this[BuiltInApp]) {
      this[BuiltInApp] = obj;
    }
  },
 
  /**
   * 获取 CoreApp (eeApp)
   */  
  get CoreApp() {
    return this[BuiltInApp] || null;
  },
 
  /**
   * 是否加密
   */  
  isEncrypt(basePath) {
    return Utils.isEncrypt(basePath);
  },
}  
 
module.exports = EE;