/*** mc 系列之 mjs * 对接宜搭公共JavaScript库 * 公共库地址:https://mc.cloudpure.cn/mjs/mjs.min.js * 本地库地址: http://127.0.0.1:7001/dist/mjs.js ***/ import { loadVConsole } from "./config/vConsole" /** @远程调试工具 */ import auth from "./auth/copyright"; import com from "./aliwork/com"; import dom from "./aliwork/dom"; import bus from "./aliwork/bus"; import optimize from "./utils/optimize"; import storage from "./utils/storage"; import date from "./vendor/date"; import math from "./utils/math" import conf from "./config/conf"; /** @全局公共配置 */ import xhr from "./service/request"; /** @前端网络对象 */ import dp from "./aliwork/dp"; /** @宜搭前端查询 */ import { crossDomainByScript } from "./service/vendor"; /** @前端网络三方 */ import ding from "./vendor/dingApi"; /** @钉钉API */ import cp from "./sample/cloudpure" import guyuan from "./sample/guyuan" import hangshi from "./sample/hangshi" export async function init (_this, config = {}) { console.log(this) this.$this = _this // this全局化 this.env = com.checkEnv(); // 环境: 0提交(其它),1查看,2编辑(审批) loadVConsole(config.vconsole) this.auth = auth; // 授权 this.dom = dom; // 样式 this.com = com; // 通用 this.bus = bus; // 事件 this.conf = conf; // 配置 this.optimize = optimize; // 优化 this.storage = storage; // 存储 this.date = date; // 日期 this.math = math; // 数字 this.request = { dp, xhr, net: { crossDomainByScript } }; // 请求 this.ding = ding; this.corp = { cp, guyuan, hangshi } // 输出日志; const msg = `mjs load success. ♨ 访问应用: ${pageConfig.appType} ${pageConfig.appName} ©️ 版权请请联系: https://www.aliwork.com/o/mc`; console.log(msg, mjs, config); }