1获取默认api
This commit is contained in:
		| @ -1,7 +1,5 @@ | ||||
| "use strict"; | ||||
|  | ||||
| const { getBaseDir, getLogDir } = require("ee-core/ps"); | ||||
|  | ||||
| /** | ||||
|  *  coverage config.default.js | ||||
|  */ | ||||
| @ -10,20 +8,8 @@ module.exports = () => { | ||||
|     openDevTools: false, | ||||
|     // 生产环境 API 配置 | ||||
|     remote: { | ||||
|       enable: false, | ||||
|       enable: true, | ||||
|       url: "fanyi.hccc.site", | ||||
|     }, | ||||
|     // 日志配置 | ||||
|     logger: { | ||||
|       encoding: "utf8", | ||||
|       dir: getLogDir(), | ||||
|       buffer: true, | ||||
|       rotator: "day", | ||||
|       level: "INFO", | ||||
|       outputJSON: false, | ||||
|       appLogName: "ee.log", | ||||
|       coreLogName: "ee-core.log", | ||||
|       errorLogName: "ee-error.log", | ||||
|     }, | ||||
|     } | ||||
|   }; | ||||
| }; | ||||
|  | ||||
| @ -358,19 +358,21 @@ class Lifecycle { | ||||
|    * electron app ready | ||||
|    */ | ||||
|   async electronAppReady() { | ||||
|     logger.info("[lifecycle] electron-app-ready"); | ||||
|     await initializeDatabase(); | ||||
|     await initializePlatform(); | ||||
|     await initializeTableData(); | ||||
|     app.viewsMap = new Map(); | ||||
|  | ||||
|     logger.info("[lifecycle] ---- electron-app-ready"); | ||||
|     const { remote } = getConfig(); | ||||
|  | ||||
|     const endpoint = remote ? remote.url : "hiapp.org"; | ||||
|     const wsBaseUrl = `ws://${endpoint}`; | ||||
|     const baseUrl = `http://${endpoint}/api`; | ||||
|     // 将配置保存到app对象供其他模块使用 | ||||
|     app.baseUrl = baseUrl; | ||||
|     app.wsBaseUrl = wsBaseUrl; | ||||
|  | ||||
|     await initializeDatabase(); | ||||
|     await initializePlatform(); | ||||
|     await initializeTableData(); | ||||
|     app.viewsMap = new Map(); | ||||
|  | ||||
|   } | ||||
|   ready; | ||||
|   /** | ||||
|  | ||||
| @ -133,7 +133,7 @@ class SystemService { | ||||
|       const reqData = { username, password, device }; | ||||
|       const res = await post(url, reqData, { timeout: 30000 }); | ||||
|       const { code, message, device_valid_until, user_remaining_chars, device_status, user_name, parent_id, user_id, userApiKey } = res.data | ||||
|       logger.info('响应数据======:', res.data) | ||||
|        | ||||
|       // 根据响应code处理不同情况 | ||||
|       switch (code) { | ||||
|         case 2000: // 请求成功 | ||||
|  | ||||
| @ -1,12 +1,12 @@ | ||||
| { | ||||
|   "name": "liangzi", | ||||
|   "version": "1.0.54", | ||||
|   "version": "1.0.55", | ||||
|   "description": "量子翻译", | ||||
|   "main": "./public/electron/main.js", | ||||
|   "scripts": { | ||||
|     "dev": "set BASE_URL=127.0.0.1:8000&& chcp 65001&&ee-bin dev", | ||||
|     "build": "set BASE_URL=haiapp.org&& npm run build-frontend && npm run build-electron && ee-bin encrypt", | ||||
|     "start": "ee-bin start", | ||||
|     "start": "chcp 65001 && set NODE_OPTIONS=--max_old_space_size=4096 && ee-bin start", | ||||
|     "dev-frontend": "set BASE_URL=127.0.0.1:8000&& ee-bin dev --serve=frontend", | ||||
|     "dev-electron": "set BASE_URL=127.0.0.1:8000&& ee-bin dev --serve=electron", | ||||
|     "build-frontend": "ee-bin build --cmds=frontend && ee-bin move --flag=frontend_dist", | ||||
|  | ||||
		Reference in New Issue
	
	Block a user