返回列表 发帖
查看: 959|回复: 9

[BUG反馈] DQ(v3.0.220723)网页加载速度优化

2

主题

11

回帖

18

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2023-12-23 21:24:16 | 显示全部楼层 |阅读模式
大家有没有发现一个问题:

  1. setTimeout(function() {
  2.         var appid = '';
  3.         var channelname = window.location.hostname;
  4.         if (!!window.navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
  5.           appid = '500D36509CE649E88446FB4E7A51B221'; // h5
  6.         } else {
  7.           appid = '4F323A1D5F444BF69C7C4E10704AEA2F'; // pc
  8.         }
  9.         var url = 'http://sdk.talkingdata.com/app/h5/v1?appid=' + appid + '&vn=' + 'v3.0.220113' + '&vc=' + 'v3.0.220113' + '&td_channelid=' + channelname;
  10.         if ( window.location.protocol.indexOf('https') != -1 ) {
  11.           url = 'https://jic.talkingdata.com/app/h5/v1?appid=' + appid + '&vn=' + 'v3.0.220113' + '&vc=' + 'v3.0.220113' + '&td_channelid=' + channelname;
  12.         }
  13.         var talkingdata = document.createElement('script');
  14.         talkingdata.type = 'text/javascript';
  15.         talkingdata.async = true;
  16.         talkingdata.src = url;
  17.         document.getElementsByTagName('body')[0].appendChild(talkingdata);


  18.         window.sessionStorage.setItem('__TD_td_channel', window.location.hostname.replace(/./g, '_'));
  19.         var tdjs = document.createElement('script');
  20.         tdjs.type = 'text/javascript';
  21.         tdjs.async = true;
  22.         tdjs.src = 'https://jic.talkingdata.com/app/h5/v1?appid=750AEE91CF4446A19A2D12D5EE32F725';
  23.         document.getElementsByTagName('body')[0].appendChild(tdjs);

  24.         var dzqjs = document.createElement('script');
  25.         dzqjs.type = 'text/javascript';
  26.         dzqjs.async = true;
  27.         dzqjs.src = '/js/dzq.js';
  28.         document.getElementsByTagName('body')[0].appendChild(dzqjs);
  29.       }, 2000);
复制代码
这个引用有153个,涉及文件78个
仔细阅读发现,这个function 是判断客户端的浏览器类型,以及针对不同浏览器创建不同的js文件


试想一下,如果离线或者网络不通情况下,是不是会延迟网络加载速度,虽然代码里写的是异步访问,但是随着时间的推移,网络后台缓存会不断尝试连接并报错!


不知道开发者当时的设计思路,为什么不调用本地的js呢? 而且78个文件中都有这个调用,为什么不引用一个公共函数?


昨天我翻电脑,找到了官方最后一个版本的安装包,尝试修改了其中的js文件调用,现在只有上面代码中提到的2个链接,经过试验发现,正常安装,而且页面打开速度很快


刚刚尝试把代码中的js文件保存到本地,修改成本地调用后,现在打开首页速度稳定在0.05秒,可怕不?


对了还有一个大家不知道的代码:
  1. img.src = "https://discuzq-0gxi1bn2969fa48d.service.tcloudbase.com/access?" + pt + "&dn=" + encodeURIComponent(window.location.hostname.replace(/\./g, "_"));
复制代码
这个是引用的图片,居然是一个点,每次开页面都回访问,不知道官方是统计访问次数还是? 不得而知。

还是那句话,接触discuz已经10多年了,没有感情是不可能的,虽然DQ停止了维护,但是不能把摊子直接甩掉吧? 很伤感情。
回复

使用道具 举报

2

主题

11

回帖

18

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 2023-12-23 21:51:36 | 显示全部楼层
本帖最后由 wuxiandianzi 于 2023-12-23 22:27 编辑
  1. http://sdk.talkingdata.com/app/h5/v1?appid=4F323A1D5F444BF69C7C4E10704AEA2F&vn=v3.0.220113&vc=v3.0.220113&td_channelid=127.0.0.1
复制代码
  1. http://sdk.talkingdata.com/app/h5/v1?appid=500D36509CE649E88446FB4E7A51B221&vn=v3.0.220113&vc=v3.0.220113&td_channelid=127.0.0.1
复制代码
访问上面这个地址会返回这个:
  1. var appid = '500D36509CE649E88446FB4E7A51B221';
  2. var vn = 'v3.0.220113';
  3. var vc = 'v3.0.220113';
  4. var TDBaseUrl = 'http://sdk.talkingdata.com/app/h5/v1/websdk';
  5. var TDRequestUrl = 'http://h5data.talkingdata.net/app/v1';
  6. function createScriptTd(url) {
  7.     var _head = document.getElementsByTagName('head')[0];
  8.     var _script = document.createElement('script');
  9.     _script.type = 'text/javascript';
  10.     _script.src = url;
  11.     _head.appendChild(_script)
  12. };
  13. createScriptTd(TDBaseUrl + '/js/sdk_release.js');
  14. if (!window['JSON'] || typeof JSON !== 'object') {
  15.     createScriptTd(TDBaseUrl + '/js/json2.js')
  16. };
  17. window["TDAPP"] = {};
  18. window["TDAPP"].onEvent = function (id, label, params) {
  19.     if (arguments.length > 0) {
  20.         try {
  21.             var opts = {
  22.                 count: 1,
  23.                 start: new Date().getTime()
  24.             };
  25.             if (id != undefined) {
  26.                 opts["id"] = typeof id != "string" ? JSON.stringify(id) : id
  27.             }
  28.             if (label != undefined) {
  29.                 opts["label"] = typeof label != "string" ? JSON.stringify(label) : label
  30.             } else {
  31.                 opts["label"] = ""
  32.             }
  33.             if (params != undefined) {
  34.                 var isJson = function (obj) {
  35.                     var isjson = typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
  36.                     return isjson
  37.                 };
  38.                 if (isJson(params)) {
  39.                     opts["params"] = params
  40.                 } else {
  41.                     opts["params"] = {
  42.                         params: ""
  43.                     }
  44.                 }
  45.             }
  46.             var eventName = "__TD_td-init-event";
  47.             var ev = localStorage[eventName];
  48.             if (ev) {
  49.                 var ca = JSON.parse(ev);
  50.                 ca.push(opts);
  51.                 localStorage.setItem(eventName, JSON.stringify(ca));
  52.                 return
  53.             };
  54.             localStorage.setItem(eventName, "[" + JSON.stringify(opts) + "]")
  55.         } catch (e) {}
  56.     }
  57. };
复制代码


注意上述代码中会执行创建以下js文件:
TDRequestUrl=http://h5data.talkingdata.net/app/v1

TDBaseUrl=http://sdk.talkingdata.com/app/h5/v1/


http://sdk.talkingdata.com/app/h5/v1/websdk/js/sdk_release.js
http://sdk.talkingdata.com/app/h5/v1/websdk/js/js/json2.js

经过合并后会得到sdk_release.js, 那么是否可以在此处直接根据条件 引用本地js呢?


同理访问:
  1. https://jic.talkingdata.com/app/h5/v1?appid=750AEE91CF4446A19A2D12D5EE32F725
复制代码
会返回:
  1. var appid = '750AEE91CF4446A19A2D12D5EE32F725';
  2. var vn = '';
  3. var vc = '';
  4. var TDBaseUrl = 'https://jic.talkingdata.com/app/h5/v1/websdk';
  5. var TDRequestUrl = 'https://h5.udrig.com/app/v1';
  6. function createScriptTd(url) {
  7.     var _head = document.getElementsByTagName('head')[0];
  8.     var _script = document.createElement('script');
  9.     _script.type = 'text/javascript';
  10.     _script.src = url;
  11.     _head.appendChild(_script)
  12. };
  13. createScriptTd(TDBaseUrl + '/js/sdk_release.js');
  14. if (!window['JSON'] || typeof JSON !== 'object') {
  15.     createScriptTd(TDBaseUrl + '/js/json2.js')
  16. };
  17. window["TDAPP"] = {};
  18. window["TDAPP"].onEvent = function (id, label, params) {
  19.     if (arguments.length > 0) {
  20.         try {
  21.             var opts = {
  22.                 count: 1,
  23.                 start: new Date().getTime()
  24.             };
  25.             if (id != undefined) {
  26.                 opts["id"] = typeof id != "string" ? JSON.stringify(id) : id
  27.             }
  28.             if (label != undefined) {
  29.                 opts["label"] = typeof label != "string" ? JSON.stringify(label) : label
  30.             } else {
  31.                 opts["label"] = ""
  32.             }
  33.             if (params != undefined) {
  34.                 var isJson = function (obj) {
  35.                     var isjson = typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
  36.                     return isjson
  37.                 };
  38.                 if (isJson(params)) {
  39.                     opts["params"] = params
  40.                 } else {
  41.                     opts["params"] = {
  42.                         params: ""
  43.                     }
  44.                 }
  45.             }
  46.             var eventName = "__TD_td-init-event";
  47.             var ev = localStorage[eventName];
  48.             if (ev) {
  49.                 var ca = JSON.parse(ev);
  50.                 ca.push(opts);
  51.                 localStorage.setItem(eventName, JSON.stringify(ca));
  52.                 return
  53.             };
  54.             localStorage.setItem(eventName, "[" + JSON.stringify(opts) + "]")
  55.         } catch (e) {}
  56.     }
  57. };
复制代码

似乎和上面的代码一样,一个是http协议 一个是https协议
最终都是获取sdk_release.js 文件:
  1. !function () {
  2.     "use strict";
  3.     var _ = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
  4.         return typeof e
  5.     }
  6.      : function (e) {
  7.         return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  8.     },
  9.     c = function (c) {
  10.         var d,
  11.         u,
  12.         a = 0,
  13.         s = c.document,
  14.         l = /^(?:text|application)\/javascript/i,
  15.         p = /^(?:text|application)\/xml/i,
  16.         f = "application/json",
  17.         g = "text/html",
  18.         m = /^\s*$/,
  19.         v = function e(t) {
  20.             var o = A({}, t || {});
  21.             for (d in e.settings)
  22.                 void 0 === o[d] && (o[d] = e.settings[d]);
  23.             (n = o).global && 0 == v.active++ && S(n),
  24.             o.crossDomain || (o.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(o.url) && RegExp.$2 != c.location.host);
  25.             var r = o.dataType,
  26.             t = /=\?/.test(o.url);
  27.             if ("jsonp" == r || t)
  28.                 return t || (o.url = P(o.url, "callback=?")), e.JSONP(o);
  29.             o.url || (o.url = c.location.toString()),
  30.             D(o);
  31.             var i,
  32.             n = o.accepts[r],
  33.             t = {},
  34.             a = /^([\w-]+:)\/\//.test(o.url) ? RegExp.$1 : c.location.protocol,
  35.             s = e.settings.xhr();
  36.             o.crossDomain || (t["X-Requested-With"] = "XMLHttpRequest"),
  37.             n && (-1 < (t.Accept = n).indexOf(",") && (n = n.split(",", 2)[0]), s.overrideMimeType && s.overrideMimeType(n)),
  38.             (o.contentType || o.data && "GET" != o.type.toUpperCase()) && (t["Content-Type"] = o.contentType || "application/x-www-form-urlencoded"),
  39.             o.headers = A(t, o.headers || {}),
  40.             s.onreadystatechange = function () {
  41.                 if (4 == s.readyState) {
  42.                     clearTimeout(i);
  43.                     var e,
  44.                     t = !1;
  45.                     if (200 <= s.status && s.status < 300 || 304 == s.status || 0 == s.status && "file:" == a) {
  46.                         r = r || ((n = s.getResponseHeader("content-type")) && (n == g ? "html" : n == f ? "json" : l.test(n) ? "script" : p.test(n) && "xml") || "text"),
  47.                         e = s.responseText;
  48.                         try {
  49.                             "script" == r ? (0, eval)(e) : "xml" == r ? e = s.responseXML : "json" == r && (e = m.test(e) ? null : JSON.parse(e))
  50.                         } catch (e) {
  51.                             t = e
  52.                         }
  53.                         t ? y(t, "parsererror", s, o) : T(e, s, o)
  54.                     } else
  55.                         y(null, "error", s, o)
  56.                 }
  57.                 var n
  58.             };
  59.             t = !("async" in o) || o.async;
  60.             for (u in s.open(o.type, o.url, t), o.headers)
  61.                 s.setRequestHeader(u, o.headers[u]);
  62.             return !1 === function (e, t) {
  63.                 var n = t.context;
  64.                 if (!1 === t.beforeSend.call(n, e, t) || !1 === S(t))
  65.                     return !1;
  66.                 S(t)
  67.             }
  68.             (s, o) ? (s.abort(), !1) : (0 < o.timeout && (i = setTimeout(function () {
  69.                         s.onreadystatechange = w,
  70.                         s.abort(),
  71.                         y(null, "timeout", s, o)
  72.                     }, o.timeout)), s.send(o.data || null), s)
  73.         };
  74.         function S(e) {
  75.             if (e.global)
  76.                 return !0
  77.         }
  78.         function T(e, t, n) {
  79.             var o = n.context,
  80.             r = "success";
  81.             n.success.call(o, e, r, t),
  82.             S(n),
  83.             h(r, t, n)
  84.         }
  85.         function y(e, t, n, o) {
  86.             var r = o.context;
  87.             o.error.call(r, n, t, e),
  88.             S(o),
  89.             h(t, n, o)
  90.         }
  91.         function h(e, t, n) {
  92.             var o = n.context;
  93.             n.complete.call(o, t, e),
  94.             S(n),
  95.             (n = n).global && !--v.active && S(n)
  96.         }
  97.         function w() {}
  98.         function P(e, t) {
  99.             return (e + "&" + t).replace(/[&?]{1,2}/, "?")
  100.         }
  101.         function D(e) {
  102.             var t,
  103.             n,
  104.             o;
  105.             "object" === _(e.data) && (e.data = (t = e.data, (o = []).add = function (e, t) {
  106.                     this.push(r(e) + "=" + r(t))
  107.                 }, function e(t, n, o, r) {
  108.                     var i = "array" == typeof n;
  109.                     for (var a in n) {
  110.                         var s = n[a];
  111.                         r && (a = o ? r : r + "[" + (i ? "" : a) + "]"),
  112.                         !r && i ? t.add(s.name, s.value) : (o ? "array" == typeof s : "object" === (void 0 === s ? "undefined" : _(s))) ? e(t, s, o, a) : t.add(a, s)
  113.                     }
  114.                 }
  115.                     (o, t, n), o.join("&").replace("%20", "+"))),
  116.             !e.data || e.type && "GET" != e.type.toUpperCase() || (e.url = P(e.url, e.data))
  117.         }
  118.         v.active = 0,
  119.         v.JSONP = function (t) {
  120.             if (!("type" in t))
  121.                 return v(t);
  122.             var n,
  123.             o = "jsonp" + ++a,
  124.             e = s.createElement("script"),
  125.             r = {
  126.                 abort: function () {
  127.                     o in c && (c[o] = w),
  128.                     h("abort", r, t)
  129.                 }
  130.             },
  131.             i = s.getElementsByTagName("head")[0] || s.documentElement;
  132.             return t.error && (e.onerror = function () {
  133.                 r.abort(),
  134.                 t.error()
  135.             }),
  136.             c[o] = function (e) {
  137.                 clearTimeout(n),
  138.                 delete c[o],
  139.                 T(e, r, t)
  140.             },
  141.             D(t),
  142.             e.src = t.url.replace(/=\?/, "=" + o),
  143.             i.insertBefore(e, i.firstChild),
  144.             0 < t.timeout && (n = setTimeout(function () {
  145.                     r.abort(),
  146.                     h("timeout", r, t)
  147.                 }, t.timeout)),
  148.             r
  149.         },
  150.         v.settings = {
  151.             type: "GET",
  152.             beforeSend: w,
  153.             success: w,
  154.             error: w,
  155.             complete: w,
  156.             context: null,
  157.             global: !0,
  158.             xhr: function () {
  159.                 return new c.XMLHttpRequest
  160.             },
  161.             accepts: {
  162.                 script: "text/javascript, application/javascript",
  163.                 json: f,
  164.                 xml: "application/xml, text/xml",
  165.                 html: g,
  166.                 text: "text/plain"
  167.             },
  168.             crossDomain: !1,
  169.             timeout: 0
  170.         },
  171.         v.get = function (e, t) {
  172.             return v({
  173.                 url: e,
  174.                 success: t
  175.             })
  176.         },
  177.         v.post = function (e, t, n, o) {
  178.             return "function" == typeof t && (o = o || n, n = t, t = null),
  179.             v({
  180.                 type: "POST",
  181.                 url: e,
  182.                 data: t,
  183.                 success: n,
  184.                 dataType: o
  185.             })
  186.         },
  187.         v.getJSON = function (e, t) {
  188.             return v({
  189.                 url: e,
  190.                 success: t,
  191.                 dataType: "json"
  192.             })
  193.         };
  194.         var r = encodeURIComponent;
  195.         function A(t) {
  196.             return Array.prototype.slice.call(arguments, 1).forEach(function (e) {
  197.                 for (d in e)
  198.                     void 0 !== e[d] && (t[d] = e[d])
  199.             }),
  200.             t
  201.         }
  202.         return {
  203.             ajax: v
  204.         }
  205.     }
  206.     (window),
  207.     u = {
  208.         deviceId: "",
  209.         appkey: appid || "",
  210.         appProfile: {
  211.             versionName: vn || "",
  212.             versionCode: vc || "",
  213.             initTime: "",
  214.             sdkVersion: "H5+APP+v1.0.6",
  215.             partner: ""
  216.         },
  217.         deviceProfile: {
  218.             pixel: "",
  219.             language: navigator.language,
  220.             timezone: (new Date).getTimezoneOffset() / 60 * -1
  221.         },
  222.         msgs: []
  223.     },
  224.     r = {
  225.         type: 2,
  226.         data: {
  227.             id: "",
  228.             start: 0,
  229.             duration: 0
  230.         }
  231.     },
  232.     l = {
  233.         autoTrack: !0
  234.     };
  235.     !function () {
  236.         for (var e = document.getElementsByTagName("script"), t = 0; t < e.length; t++) {
  237.             var n = e[t].getAttribute("td-autoTrack");
  238.             if ("false" === n || !1 === n) {
  239.                 l.autoTrack = !1;
  240.                 break
  241.             }
  242.         }
  243.     }
  244.     ();
  245.     var p = (new Date).getTime(),
  246.     e = function (e, t, n) {
  247.         e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent ? e.attachEvent("on" + t, n) : e["on" + t] = n
  248.     };
  249.     function t(e, t, n) {
  250.         if (void 0 === t) {
  251.             var o = null;
  252.             if (document.cookie && "" != document.cookie)
  253.                 for (var r = document.cookie.split(";"), i = 0; i < r.length; i++) {
  254.                     var a = r[i];
  255.                     if (a.substring(0, e.length + 1) == e + "=") {
  256.                         o = decodeURIComponent(a.substring(e.length + 1));
  257.                         break
  258.                     }
  259.                 }
  260.             return o
  261.         }
  262.         n = n || {},
  263.         null === t && (t = "", n.expires = -1);
  264.         var s = "";
  265.         n.expires && ("number" == typeof n.expires || n.expires.toUTCString) && ("number" == typeof n.expires ? (d = new Date).setTime(d.getTime() + 24 * n.expires * 60 * 60 * 1e3) : d = n.expires, s = "; expires=" + d.toUTCString());
  266.         var c = n.path ? "; path=" + n.path : "",
  267.         d = n.domain ? "; domain=" + n.domain : "",
  268.         n = n.secure ? "; secure" : "";
  269.         document.cookie = [e, "=", encodeURIComponent(t), s, c, d, n].join("")
  270.     }
  271.     l.localStorage = {
  272.         add: function (e, t) {
  273.             this.addLocalStorage(e, t),
  274.             "sessionId" != e && this.addCookie(e, t)
  275.         },
  276.         get: function (e) {
  277.             var t = this.getLocalStorage(e);
  278.             return t || this._getCookie(e)
  279.         },
  280.         create: function () {
  281.             t("__TD_LOCAL") || (this._addCookie(""), window.localStorage)
  282.         },
  283.         addCookie: function (e, t) {
  284.             if (!window.localStorage) {
  285.                 this.create();
  286.                 var n = this.cookieList();
  287.                 n[e] = t;
  288.                 var o,
  289.                 r = [];
  290.                 for (o in n)
  291.                     r.push(o + "=" + n[o]);
  292.                 this._addCookie(r.join(";"))
  293.             }
  294.         },
  295.         _setCookie: function () {
  296.             this.cookieList();
  297.             t("__TD_LOCAL", "", {
  298.                 expires: 1095,
  299.                 path: "/",
  300.                 domain: location.hostname
  301.             })
  302.         },
  303.         _addCookie: function (e) {
  304.             t("__TD_LOCAL", e, {
  305.                 expires: 1095,
  306.                 path: "/",
  307.                 domain: location.hostname
  308.             })
  309.         },
  310.         _getCookie: function (e) {
  311.             var t = this.cookieList();
  312.             if (t && t[e])
  313.                 return t[e]
  314.         },
  315.         delCookie: function (e) {},
  316.         cookieList: function () {
  317.             var e = t("__TD_LOCAL");
  318.             return this.format(e)
  319.         },
  320.         addLocalStorage: function (e, t) {
  321.             window.localStorage && ("sessionId" == e && window.sessionStorage ? sessionStorage.setItem("__TD_" + e, t) : localStorage["__TD_" + e] = t)
  322.         },
  323.         delLocalStorage: function (e) {
  324.             window.localStorage && localStorage.removeItem("__TD_" + e)
  325.         },
  326.         getLocalStorage: function (e) {
  327.             if (window.localStorage)
  328.                 return "sessionId" == e && window.sessionStorage ? sessionStorage.getItem("__TD_" + e) : localStorage["__TD_" + e]
  329.         },
  330.         format: function (e) {
  331.             var t = {};
  332.             if (!e)
  333.                 return t;
  334.             for (var n = e.split(";"), o = n.length, r = 0; r < o; r++) {
  335.                 var i = n[r].split("=");
  336.                 2 == i.length && (t[i[0]] = i[1])
  337.             }
  338.             return t
  339.         }
  340.     },
  341.     l.sessionStorage = {
  342.         add: function (e, t) {
  343.             window.sessionStorage && sessionStorage.setItem("__TD_" + e, t)
  344.         },
  345.         get: function (e) {
  346.             return sessionStorage.getItem("__TD_" + e)
  347.         },
  348.         remove: function (e) {
  349.             sessionStorage.removeItem("__TD_" + e)
  350.         }
  351.     };
  352.     var d,
  353.     i,
  354.     a,
  355.     f,
  356.     n,
  357.     g = !0,
  358.     m = !1;
  359.     function v() {
  360.         this.url = TDRequestUrl,
  361.         this.opts = {},
  362.         this.requestArray = new Array
  363.     }
  364.     v.prototype = {
  365.         getAjax: function (o, r, i, a, s) {
  366.             (function (e) {
  367.                 var t,
  368.                 n;
  369.                 0 < navigator.userAgent.indexOf("MSIE 9.0") ? "MSIE6.0" == (t = navigator.appVersion.split(";")[1].replace(/[ ]/g, "")) || "MSIE7.0" == t ? alert("no support IE6,IE7") : window.XDomainRequest && ((n = new XDomainRequest) ? (e.error && "function" == typeof e.error && (n.onerror = function () {
  370.                             e.error()
  371.                         }), e.timeout && "function" == typeof e.timeout && (n.ontimeout = function () {
  372.                             e.timeout()
  373.                         }), e.success && "function" == typeof e.success && (n.onload = function () {
  374.                             e.dataType ? "json" == e.dataType.toLowerCase() && e.success(JSON.parse(n.responseText)) : e.success(n.responseText)
  375.                         }), n.open(e.type, e.url), n.send(e.param)) : alert("Failed to create XDomainRequest")) : g ? (S.add("td-unique", "true"), g = !1, d = c.ajax({
  376.                             type: o,
  377.                             url: r,
  378.                             data: JSON.stringify(i),
  379.                             dataType: "text",
  380.                             success: a,
  381.                             error: s,
  382.                             complete: function () {
  383.                                 g = !(d = void 0),
  384.                                 m && (T.getAjax(), m = !1),
  385.                                 S.delLocalStorage("td-unique")
  386.                             }
  387.                         })) : m = !0
  388.             })({
  389.                 url: this.url,
  390.                 type: "POST",
  391.                 param: JSON.stringify(i),
  392.                 success: a
  393.             })
  394.         },
  395.         set: function (e, t, n) {
  396.             this.opts = e,
  397.             this.send(t, n)
  398.         },
  399.         send: function (e, t) {
  400.             this.getAjax("post", this.url, this.opts, e, t)
  401.         }
  402.     },
  403.     (i = window).TDBASE = i.TDBASE || {},
  404.     TDBASE.cacheName = "cacheList",
  405.     TDBASE.unique = function (e) {
  406.         e.sort();
  407.         for (var t = [e[0]], n = 1; n < e.length; n++)
  408.             e[n] !== t[t.length - 1] && t.push(e[n]);
  409.         return t
  410.     },
  411.     TDBASE.getArgs = function () {
  412.         for (var e = new Object, t = i.location.search.substring(1).split("&"), n = 0; n < t.length; n++) {
  413.             var o,
  414.             r = t[n].indexOf("=");
  415.             -1 != r && (o = t[n].substring(0, r), r = t[n].substring(r + 1), r = decodeURIComponent(r), e[o] = r)
  416.         }
  417.         return e
  418.     },
  419.     TDBASE.getCommon = function (e) {
  420.         var t = S.get("appkey") ? S.get("appkey") : u.appkey,
  421.         e = {
  422.             deviceId: u.deviceId,
  423.             appkey: t,
  424.             appProfile: u.appProfile,
  425.             deviceProfile: u.deviceProfile,
  426.             msgs: e.msg
  427.         };
  428.         return u.appContext && (e.appContext = u.appContext),
  429.         e
  430.     },
  431.     TDBASE.getCommonMsg = function (e, t, n, o, r, i) {
  432.         return {
  433.             type: 2,
  434.             data: {
  435.                 id: e,
  436.                 start: t,
  437.                 status: n,
  438.                 duration: o || 0,
  439.                 pages: i ? [i] : [],
  440.                 events: r || []
  441.             }
  442.         }
  443.     },
  444.     TDBASE.addSessionStart = function (e, t) {
  445.         S.add("lastSession", JSON.stringify({
  446.                 id: r.data.id,
  447.                 start: r.data.start
  448.             })),
  449.         n = (n = S.get("td-hold-event")) && JSON.parse(n);
  450.         var n = TDBASE.getCommonMsg(r.data.id, r.data.start, t, e, n);
  451.         TDBASE.addMsg(n),
  452.         S.delLocalStorage("td-hold-event")
  453.     },
  454.     TDBASE.equal = function (e, t) {
  455.         if ((void 0 === e ? "undefined" : _(e)) != (void 0 === t ? "undefined" : _(t)))
  456.             return !1;
  457.         if (_(e.length) != _(t.length))
  458.             return !1;
  459.         var n = !0,
  460.         o = [],
  461.         r = [];
  462.         for (i in e)
  463.             "count" === i || "start" === i || o.push(i);
  464.         for (i in t)
  465.             "count" === i || "start" === i || r.push(i);
  466.         if (o.length != r.length)
  467.             return !1;
  468.         for (var i = 0, a = r.length; i < a; i++)
  469.             o.push(r[i]);
  470.         for (var s = TDBASE.unique(o), i = 0, a = s.length; i < a; i++) {
  471.             if (!(s[i]in e && s[i]in t))
  472.                 return !1;
  473.             if ("object" == _(e[s[i]]) && "object" == _(t[s[i]]))
  474.                 n = TDBASE.equal(e[s[i]], t[s[i]]);
  475.             else if (e[s[i]] !== t[s[i]])
  476.                 return !1
  477.         }
  478.         return n
  479.     },
  480.     TDBASE.addGenre = function (e, t, n) {
  481.         if (S.get("sessionMsg")) {
  482.             n && n(e);
  483.             var n = JSON.parse(S.get("sessionMsg")),
  484.             o = n.msg[n.msg.length - 1].data[t];
  485.             if ("events" !== t)
  486.                 o.push(e), S.add("sessionMsg", JSON.stringify(n));
  487.             else {
  488.                 if (0 != o.length) {
  489.                     for (var r = !1, i = 0; i < o.length; i++)
  490.                         if (TDBASE.equal(o[i], e)) {
  491.                             r = !0,
  492.                             o[i].count += 1,
  493.                             o[i].start = e.start;
  494.                             break
  495.                         }
  496.                     r || o.push(e)
  497.                 } else
  498.                     o.push(e);
  499.                 S.add("sessionMsg", JSON.stringify(n))
  500.             }
  501.         }
  502.     },
  503.     TDBASE.lealSet = function (e) {
  504.         S.add("leavetime", e),
  505.         S.add("leaveSession", parseInt((e - s.get("SessionStart")) / 1e3))
  506.     },
  507.     TDBASE.addMsg = function (e) {
  508.         var t;
  509.         S.get("sessionMsg") ? ((t = JSON.parse(S.get("sessionMsg"))).msg.push(e), S.add("sessionMsg", JSON.stringify(t))) : S.add("sessionMsg", JSON.stringify({
  510.                 msg: [e]
  511.             }))
  512.     },
  513.     (a = {
  514.             currentPage: null,
  515.             pageStartTime: 0,
  516.             ref: "",
  517.             logoutCalled: !1,
  518.             init: function () {
  519.                 e(window, "pagehide", a.pageLogout),
  520.                 e(window, "beforeunload", a.pageLogout),
  521.                 window.TDAPP = window.TDAPP || {},
  522.                 window.TDAPP.onPage = a.onPage,
  523.                 l.autoTrack && (a.currentPage = window.location.href, a.ref = document.referrer)
  524.             },
  525.             onPage: function (e) {
  526.                 var t = (new Date).getTime();
  527.                 a.pageLogout("force"),
  528.                 a.pageEnter(e, a.currentPage, t),
  529.                 a.ref = a.currentPage,
  530.                 a.currentPage = e,
  531.                 a.pageStartTime = t,
  532.                 T.getAjax()
  533.             },
  534.             pageEnter: function (e, t, n) {
  535.                 t = {
  536.                     name: e,
  537.                     start: n,
  538.                     duration: 0,
  539.                     refer: t || document.referrer
  540.                 };
  541.                 TDBASE.addGenre(t, "pages")
  542.             },
  543.             pageLogout: function (e) {
  544.                 if ("force" !== e) {
  545.                     if (a.logoutCalled)
  546.                         return;
  547.                     a.logoutCalled = !0
  548.                 }
  549.                 var t = null,
  550.                 n = 0,
  551.                 o = null;
  552.                 if (l.autoTrack)
  553.                     t = a.currentPage || window.location.href, n = a.pageStartTime || p, o = a.ref || document.referrer;
  554.                 else {
  555.                     if (!a.currentPage)
  556.                         return;
  557.                     t = a.currentPage,
  558.                     n = a.pageStartTime,
  559.                     o = a.ref || document.referrer
  560.                 }
  561.                 e = (new Date).getTime();
  562.                 TDBASE.lealSet(e),
  563.                 TDBASE.addGenre({
  564.                     name: t,
  565.                     start: n,
  566.                     duration: Math.ceil((e - n) / 1e3),
  567.                     refer: o
  568.                 }, "pages")
  569.             }
  570.         }).init(),
  571.     f = {
  572.         init: function () {
  573.             try {
  574.                 var e = l.localStorage.get("profile");
  575.                 e && (e = JSON.parse(e), e = f._transform(e), u.appContext = u.appContext || {}, u.appContext.account = e)
  576.             } catch (e) {
  577.                 console.error(e)
  578.             }
  579.         },
  580.         _transform: function (e) {
  581.             e = JSON.parse(JSON.stringify(e));
  582.             return e.accountId = e.profileId,
  583.             e.type = e.profileType,
  584.             delete e.profileType,
  585.             delete e.profileId,
  586.             e
  587.         },
  588.         _transformInverse: function (e) {
  589.             e = JSON.parse(JSON.stringify(e));
  590.             return e.profileId = e.accountId,
  591.             e.profileType = e.type,
  592.             delete e.type,
  593.             delete e.accountId,
  594.             e
  595.         },
  596.         login: function (e) {
  597.             f._event(e, "login")
  598.         },
  599.         register: function (e) {
  600.             f._event(e, "register")
  601.         },
  602.         updateProfile: function (e) {
  603.             f._event(e, "update")
  604.         },
  605.         _chekProfile: function () {
  606.             return "object" === _(u.appContext) && "object" === _(u.appContext.account) ? u.appContext.account : null
  607.         },
  608.         _event: function (e, t) {
  609.             if (!e || "object" !== (void 0 === e ? "undefined" : _(e)))
  610.                 return console.log("profile信息必填!");
  611.             if ("update" !== t && !e.profileId && !/0{1}/.test(e.profileId))
  612.                 return console.log("profileId 信息为必填!");
  613.             if ("update" !== t && "number" != typeof e.profileType)
  614.                 return console.log("profileType 为必填!");
  615.             var n,
  616.             o = f._getProfile(e, t),
  617.             r = {
  618.                 profileId: "_setId",
  619.                 profileType: "_setProfileType",
  620.                 name: "_setName",
  621.                 gender: "_setGender",
  622.                 age: "_setAge"
  623.             },
  624.             i = new RegExp("^property[1-9]$");
  625.             for (n in e) {
  626.                 var a,
  627.                 s = e[n],
  628.                 c = r[n];
  629.                 if (!c || "update" === t && "profileId" === n) {
  630.                     if (i.test(n) || "property10" === n)
  631.                         if (a = f._setProperty(o, n, s))
  632.                             return void console.log(a)
  633.                 } else if (a = f[c](o, s))
  634.                     return void console.log(a)
  635.             }
  636.             u.appContext = u.appContext || {},
  637.             u.appContext.account = o;
  638.             var d = f._transformInverse(o);
  639.             l.localStorage.add("profile", JSON.stringify(d)),
  640.             o = f._transform(o),
  641.             d = f._transform(e),
  642.             y.setProfile(d, t)
  643.         },
  644.         _getProfile: function (e, t) {
  645.             var n = {};
  646.             return u.appContext && u.appContext.account && (n = JSON.parse(JSON.stringify(u.appContext.account))),
  647.             "update" == t || e.profileId === n.accountId ? n : {}
  648.         },
  649.         _setId: function (e, t) {
  650.             if (!t && !/0{1}/.test(t))
  651.                 return "profileId为必填字段!";
  652.             e.accountId = t
  653.         },
  654.         _setProfileType: function (e, t) {
  655.             if ("number" != typeof t || t != t || t < -1 || 6 < t && t < 11 || 20 < t)
  656.                 return "请上传正确的profileType";
  657.             e.type = t
  658.         },
  659.         _setName: function (e, t) {
  660.             if ("string" != typeof t)
  661.                 return "profile name 类型错误";
  662.             e.name = t
  663.         },
  664.         _setAge: function (e, t) {
  665.             if ("number" != typeof t || t != t)
  666.                 return "profile age 类型错误";
  667.             e.age = t
  668.         },
  669.         _setGender: function (e, t) {
  670.             if (0 !== t && 1 !== t & 2 !== t)
  671.                 return "profile gender 类型错误";
  672.             e.gender = t
  673.         },
  674.         _setProperty: function (e, t, n) {
  675.             if ("number" == typeof n && n != n || "string" != typeof n && "number" != typeof n)
  676.                 return "profile property 类型错误";
  677.             e[t] = n
  678.         }
  679.     },
  680.     window.TDAPP = window.TDAPP || {},
  681.     window.TDAPP.login = f.login,
  682.     window.TDAPP.register = f.register,
  683.     window.TDAPP.updateProfile = f.updateProfile,
  684.     window.TDAPP.ProfileType = {
  685.         0: "ANONYMOUS",
  686.         1: "REGISTERED",
  687.         2: "SINA_WEIBO",
  688.         3: "QQ",
  689.         4: "QQ_WEIBO",
  690.         5: "ND91",
  691.         6: "WEIXIN",
  692.         11: "TYPE1",
  693.         12: "TYPE2",
  694.         13: "TYPE3",
  695.         14: "TYPE4",
  696.         15: "TYPE5",
  697.         16: "TYPE6",
  698.         17: "TYPE7",
  699.         18: "TYPE8",
  700.         19: "TYPE9",
  701.         20: "TYPE10"
  702.     },
  703.     f.init(),
  704.     n = {
  705.         isObject: function (e) {
  706.             return e && "object" === (void 0 === e ? "undefined" : _(e))
  707.         },
  708.         isStrNotEmpty: function (e) {
  709.             return e || /0{1}/.test(e)
  710.         },
  711.         isNumber: function (e) {
  712.             return "number" == typeof e && e == e
  713.         },
  714.         isCurrencyTypeAvailabal: function (e) {
  715.             return e && "string" == typeof e && 3 === e.length
  716.         },
  717.         _checkParam: function (e) {
  718.             return n.isObject(e) ? n.isStrNotEmpty(e.orderId) ? n.isNumber(e.amount) ? !!n.isCurrencyTypeAvailabal(e.currencyType) || (console.warn("请输入正确的currencyType!"), !1) : (console.warn("请输入正确的amount!"), !1) : (console.warn("请输入正确的orderId!"), !1) : (console.warn("请输入正确的参数!"), !1)
  719.         },
  720.         onPlaceOrder: function (e) {
  721.             n._checkParam(e) && (e = {
  722.                     count: 1,
  723.                     start: (new Date).getTime(),
  724.                     domain: "iap",
  725.                     id: "placeOrder",
  726.                     params: e
  727.                 }, y._saveAndFetch(e))
  728.         },
  729.         onOrderPaySucc: function (e) {
  730.             n._checkParam(e) && ((e = JSON.parse(JSON.stringify(e))).paymentType && n.isStrNotEmpty(e.paymentType) && (e.payType = e.paymentType), delete e.paymentType, e = {
  731.                     count: 1,
  732.                     start: (new Date).getTime(),
  733.                     domain: "iap",
  734.                     id: "pay",
  735.                     params: e
  736.                 }, y._saveAndFetch(e))
  737.         },
  738.         onCancelOrder: function (e) {
  739.             n._checkParam(e) && (e = {
  740.                     count: 1,
  741.                     start: (new Date).getTime(),
  742.                     domain: "iap",
  743.                     id: "cancelOrder",
  744.                     params: e
  745.                 }, y._saveAndFetch(e))
  746.         }
  747.     },
  748.     window.TDAPP = window.TDAPP || {},
  749.     window.TDAPP.onPlaceOrder = n.onPlaceOrder,
  750.     window.TDAPP.onOrderPaySucc = n.onOrderPaySucc,
  751.     window.TDAPP.onCancelOrder = n.onCancelOrder;
  752.     var S = l.localStorage,
  753.     s = l.sessionStorage,
  754.     T = {
  755.         timedif: void 0,
  756.         state: 1,
  757.         deviceId: 0,
  758.         sessionId: 0,
  759.         local: [],
  760.         sendInit: 0,
  761.         set: function () {
  762.             try {
  763.                 this.setDeviceId(),
  764.                 this.setSession(),
  765.                 this.setSessionTime(),
  766.                 this.setInitTime(),
  767.                 this.setPartner(),
  768.                 this.setResolution(),
  769.                 this.addlastSession(),
  770.                 this.setPageEnter(),
  771.                 this.getAjax(1)
  772.             } catch (e) {
  773.                 console.log(e)
  774.             }
  775.         },
  776.         setDeviceId: function () {
  777.             if (S.get("deviceId"))
  778.                 this.deviceId = S.get("deviceId");
  779.             else {
  780.                 this.sendInit = 1;
  781.                 for (var e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""), t = [], n = e.length, o = 0; o < 16; o++)
  782.                     t[o] = e[0 | Math.random() * n];
  783.                 this.deviceId = t.join(""),
  784.                 S.add("deviceId", this.deviceId)
  785.             }
  786.             u.deviceId = this.deviceId
  787.         },
  788.         setSession: function () {
  789.             var e,
  790.             t;
  791.             if (s.get("sessionId") && S.get("appkey") == u.appkey ? t = s.get("sessionId") : (e = (new Date).getTime(), t = -1 < this.deviceId.indexOf("-") ? this.deviceId.split("-")[0] + e : this.deviceId + e, this.sendInit = 0 == this.sendInit ? 2 : this.sendInit, s.add("sessionId", t)), 0 < 32 - t.length)
  792.                 for (var n = 0, o = 32 - t.length; n < o; n++)
  793.                     t += "0";
  794.             32 - t.length < 0 && (t = t.substring(0, 32)),
  795.             r.data.id = this.sessionId = t
  796.         },
  797.         setSessionTime: function () {
  798.             var e = (new Date).getTime();
  799.             s.get("SessionStart") && S.get("appkey") == u.appkey ? e = s.get("SessionStart") : s.add("SessionStart", e),
  800.             r.data.start = parseInt(e)
  801.         },
  802.         setInitTime: function () {
  803.             S.get("initTime") ? u.appProfile.initTime = parseInt(S.get("initTime")) : (u.appProfile.initTime = p, S.add("initTime", p))
  804.         },
  805.         setPartner: function () {
  806.             var e = s.get("td_channel"),
  807.             t = TDBASE.getArgs().td_channelid;
  808.             e ? u.appProfile.partner = e : null != t && (s.add("td_channel", t), u.appProfile.partner = t)
  809.         },
  810.         setResolution: function () {
  811.             var e = [window.screen.width, window.screen.height];
  812.             window.devicePixelRatio && e.push(window.devicePixelRatio),
  813.             u.deviceProfile.pixel = e.join("*")
  814.         },
  815.         addlastSession: function () {
  816.             var e = S.get("lastSession");
  817.             void 0 === e && (S.delLocalStorage("sessionMsg"), S.delLocalStorage("lastSession")),
  818.             e ? (e = JSON.parse(e)).id != r.data.id && (e = TDBASE.getCommonMsg(e.id, e.start, 3, parseInt(S.get("leaveSession"))), TDBASE.addMsg(e), this.timedif = parseInt((r.data.start - S.get("leavetime")) / 1e3), S.get("appkey") && S.get("appkey") != u.appkey || (TDBASE.addSessionStart(this.timedif, 1), this.addAppInitEvent())) : (TDBASE.addSessionStart(0, 1), this.addAppInitEvent())
  819.         },
  820.         setPageEnter: function () {
  821.             var e;
  822.             l.autoTrack && (e = {
  823.                     name: window.location.href,
  824.                     start: (new Date).getTime(),
  825.                     duration: 0,
  826.                     refer: document.referrer
  827.                 }, TDBASE.addGenre(e, "pages"))
  828.         },
  829.         addAppInitEvent: function () {
  830.             var e;
  831.             0 != this.sendInit && (e = {
  832.                     id: "init",
  833.                     domain: "app",
  834.                     start: p || (new Date).getTime(),
  835.                     count: 1,
  836.                     params: {
  837.                         first: !0
  838.                     }
  839.                 }, 2 == this.sendInit && (e.params.first = !1), TDBASE.addGenre(e, "events"))
  840.         },
  841.         getAjax: function (e) {
  842.             var t = this,
  843.             n = new v;
  844.             localStorage.__TD_sessionMsg || TDBASE.addSessionStart(0, 2);
  845.             var o,
  846.             r = JSON.parse(S.get("sessionMsg")),
  847.             i = TDBASE.getCommon(r),
  848.             a = localStorage["__TD_td-init-event"];
  849.             !a || (o = i.msgs[i.msgs.length - 1]) && (r = o.data.events, o.data.events = r.concat(JSON.parse(a))),
  850.             S.delLocalStorage("td-init-event");
  851.             for (var s = [], c = 0; c < i.msgs.length; c++) {
  852.                 var d = i.msgs[c];
  853.                 (2 !== d.data.status || d.data.pages && 0 !== d.data.pages.length || d.data.events && 0 !== d.data.events.length) && s.push(d)
  854.             }
  855.             0 !== s.length && (i.msgs = s, S.get("appkey") ? S.get("appkey") != u.appkey ? n.set(i, function (e) {
  856.                     S.delLocalStorage("sessionMsg"),
  857.                     u.appProfile.initTime = p,
  858.                     S.add("initTime", p),
  859.                     TDBASE.addSessionStart(0, 1),
  860.                     t.addAppInitEvent(),
  861.                     t.getAjax()
  862.                 }, function (e) {
  863.                     console.log(e)
  864.                 }) : n.set(i, function (e) {
  865.                     S.delLocalStorage("sessionMsg"),
  866.                     TDBASE.addSessionStart(0, 2)
  867.                 }, function (e) {
  868.                     console.log(e)
  869.                 }) : n.set(i, function (e) {
  870.                     S.delLocalStorage("sessionMsg"),
  871.                     TDBASE.addSessionStart(0, 2)
  872.                 }, function (e) {
  873.                     console.log(e)
  874.                 }), S.add("appkey", u.appkey))
  875.         }
  876.     };
  877.     T.set();
  878.     var y = {
  879.         set: function (e, t, n, o) {
  880.             var r;
  881.             if (e || /0{1}/.test(e)) {
  882.                 if (0 < arguments.length)
  883.                     try {
  884.                         var i = {
  885.                             count: 1,
  886.                             start: (new Date).getTime()
  887.                         };
  888.                         if (null != e && (i.id = "string" != typeof e ? JSON.stringify(e) : e), i.label = null != t ? "string" != typeof t ? JSON.stringify(t) : t : "", null != n && ("object" != (void 0 === (r = n) ? "undefined" : _(r)) || "[object object]" != Object.prototype.toString.call(r).toLowerCase() || r.length || (i.params = n)), o && "smart" === o)
  889.                             i.type = "smart";
  890.                         else if (void 0 !== o) {
  891.                             if ("number" != typeof o || isNaN(o))
  892.                                 return void console.error("value只能为number");
  893.                             i.value = o
  894.                         }
  895.                         y._saveAndFetch(i)
  896.                     } catch (e) {}
  897.             } else
  898.                 console.warn("event  Id为必填字段!")
  899.         },
  900.         setProfile: function (e, t) {
  901.             e = {
  902.                 count: 1,
  903.                 start: (new Date).getTime(),
  904.                 domain: "account",
  905.                 id: t,
  906.                 params: e
  907.             };
  908.             y._saveAndFetch(e)
  909.         },
  910.         _saveAndFetch: function (e) {
  911.             d ? TDBASE.addGenre(e, "events", function (e) {
  912.                 var t = S.get("td-hold-event"),
  913.                 n = [];
  914.                 if (n.push(e), t) {
  915.                     t = JSON.parse(t);
  916.                     for (var o = 0; o < t.length; o++)
  917.                         if (TDBASE.equal(t[o], e)) {
  918.                             t[o].count += 1,
  919.                             t[o].start = e.start;
  920.                             break
  921.                         }
  922.                     S.add("td-hold-event", JSON.stringify(t))
  923.                 } else
  924.                     S.add("td-hold-event", JSON.stringify(n))
  925.             }) : (TDBASE.addGenre(e, "events"), setTimeout(function () {
  926.                     T.getAjax()
  927.                 }, 500))
  928.         },
  929.         unload: function () {
  930.             try {
  931.                 T.getAjax()
  932.             } catch (e) {}
  933.         }
  934.     };
  935.     window.TDAPP = window.TDAPP || {},
  936.     window.TDAPP.onEvent = y.set
  937. }
  938. ();
复制代码

如果把引用改为访问本地的两个js文件,是不是速度会快很多很多?
试验发现,验证了猜想。

其实原版的DQ3 还有很多js文件调用,统统改为本地文件,不管网络问题还是离线问题,而且首页和编辑器很快可以代开。
这里班门弄斧了,DQ 需要优化的地方太多了,DQ的初衷是为了配合腾讯云的产品吧,所以一切都需要联网,我还停留在discuz那种思维中,这里犯了错误。



回复 支持 反对

使用道具 举报

1

主题

35

回帖

45

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2023-12-25 11:13:33 | 显示全部楼层
Discuz! Q的项目初衷就是腾讯云为了抢占更多云市场而产生的,都弄本地,如何上腾讯云全家桶...
不使用云产品 最起码的内容发布应该可以吧 
发表于 2023-12-27 12:53
回复 支持 1 反对 0

使用道具 举报

14

主题

56

回帖

82

积分

渐入佳境

贡献
0 点
金币
9 个
发表于 2023-12-26 19:17:08 | 显示全部楼层
dq的死因  技术占很大原因,引用了大量外部依赖,一旦云端出点问题,网站就崩了。  后来经历过的BUG: 编辑器加载失败、后台打不开、网站打开慢/打不开...
说的极是 
发表于 2023-12-27 12:52
回复 支持 2 反对 0

使用道具 举报

0

主题

4

回帖

9

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2024-1-22 14:40:57 | 显示全部楼层
你好,最近正好碰到网页加载突然变慢的情况。版本就是3.0 220723 ,印象中只是在尝试SEO设置的设置过SSR功能,不知道会不会跟这个有关?朋友,能帮我查下原因么,我是完全的技术小白,但是使用discuzQ搭建的网站已经稳定运行1年。https://discuz.spaceguests.com ,哪位高人能帮我看看,分析下加载速度慢的原因么?
回复 支持 反对

使用道具 举报

18

主题

52

回帖

79

积分

渐入佳境

贡献
0 点
金币
0 个
发表于 2024-1-31 19:02:16 | 显示全部楼层
woom 发表于 2024-1-22 14:40
你好,最近正好碰到网页加载突然变慢的情况。版本就是3.0 220723 ,印象中只是在尝试SEO设置的设置过SSR功 ...

朋友,你这个小程序端是按官方文档里面的方法打包的吗?
https://doc.q.discuz.vip/guide/install-miniapp.html#步骤三-安装项目依赖
我这边一直不成功,不知道怎么回事
回复 支持 反对

使用道具 举报

0

主题

4

回帖

9

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2024-2-1 14:56:33 | 显示全部楼层
danhuangyou 发表于 2024-1-31 19:02
朋友,你这个小程序端是按官方文档里面的方法打包的吗?
https://doc.q.discuz.vip/guide/install-miniap ...

对的,不过是一年操作的了,也不是记得十分清楚,可以使用xbuilder或者微信开发者工具。我现在这几天貌似速度又正常了,还挺奇怪的。
回复 支持 反对

使用道具 举报

18

主题

52

回帖

79

积分

渐入佳境

贡献
0 点
金币
0 个
发表于 2024-2-1 19:11:55 | 显示全部楼层
woom 发表于 2024-2-1 14:56
对的,不过是一年操作的了,也不是记得十分清楚,可以使用xbuilder或者微信开发者工具。我现在这几天貌似 ...

3.0好像只能用官方编译吧?我这边一直编译失败,不知道什么原因


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2024-5-14 20:52 , Processed in 0.049820 second(s), 7 queries , Redis On.

Powered by Discuz! W1.0 Licensed

Cpoyright © 2001-2024 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表