WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2021-12-02 8ee79710640b73f616d268460adb91b58d1df521
微调底层文件结构,微调测试环境判断
1 files renamed
1 files modified
20 ■■■■ changed files
bases/BridgeCenterBase.js 4 ●●●● patch | view | raw | blame | history
bases/Fetcher.js 16 ●●●●● patch | view | raw | blame | history
bases/BridgeCenterBase.js
File was renamed from common/BridgeTelling.js
@@ -1,5 +1,5 @@
/**
 * BridgeTelling - 跨端通讯,通知接收基类
 * BridgeCenterBase - 跨端通讯,通知接收基类
 * @author Tevin
 */
@@ -7,7 +7,7 @@
import { $bridge } from '@components/common/Bridge';
import { Fetcher } from '@components/bases/Fetcher';
export class BridgeTelling {
export class BridgeCenterBase {
    constructor(tellings) {
        this._init(tellings);
    }
bases/Fetcher.js
@@ -578,9 +578,23 @@
    static inDevMod = (() => {
        // 网页
        if (process.env.TARO_ENV === 'h5') {
            // 当没有 url 指定时,只有内网 ip 和 33**/35** 的端口号,视为本地开发模式
            // http协议访问
            if (window.location.protocol.indexOf('http') > 0) {
                // 当内网 ip 且使用 33**/35** 的端口号时,视为本地开发模式
            return /^(192|127|localhost).*?:3[35]\d{2}$/i.test(window.location.host);
        }
            // 非http协议访问
            else {
                // 开发编译
                if (process.env.NODE_ENV === 'development') {
                    return true;
                }
                // 生产编译
                else if (process.env.NODE_ENV === 'production') {
                    return false;
                }
            }
        }
        // 小程序
        else if (process.env.TARO_ENV === 'weapp') {
            // 开发编译