mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化客户端加载
This commit is contained in:
parent
95ab44d118
commit
16d0d1687f
@ -219,7 +219,7 @@ export default {
|
|||||||
if (buttons.length === 0) {
|
if (buttons.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buttons.each((index, item) => {
|
buttons.each((_, item) => {
|
||||||
if ($A(item).text().indexOf("搜索")) {
|
if ($A(item).text().indexOf("搜索")) {
|
||||||
button = $A(item);
|
button = $A(item);
|
||||||
}
|
}
|
||||||
@ -467,8 +467,9 @@ export default {
|
|||||||
this.autoTheme()
|
this.autoTheme()
|
||||||
$A.updateTimezone()
|
$A.updateTimezone()
|
||||||
$A.IDBTest()
|
$A.IDBTest()
|
||||||
if (this.lastCheckUpgradeYmd != $A.daytz().format('YYYY-MM-DD')) {
|
const nowYmd = $A.daytz().format('YYYY-MM-DD')
|
||||||
this.lastCheckUpgradeYmd = $A.daytz().format('YYYY-MM-DD')
|
if (this.lastCheckUpgradeYmd != nowYmd) {
|
||||||
|
this.lastCheckUpgradeYmd = nowYmd
|
||||||
$A.eeuiAppCheckUpdate();
|
$A.eeuiAppCheckUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
resources/assets/js/app.js
vendored
11
resources/assets/js/app.js
vendored
@ -98,10 +98,9 @@ VueRouter.prototype.push = function push(location) {
|
|||||||
return originalPush.call(this, location).catch(err => err)
|
return originalPush.call(this, location).catch(err => err)
|
||||||
}
|
}
|
||||||
|
|
||||||
const router = new VueRouter({
|
// 路由方式
|
||||||
mode: isSoftware && !/https?:/i.test(window.location.protocol) ? 'hash' : 'history',
|
const routeMode = isSoftware && !/https?:/i.test(window.location.protocol) ? 'hash' : 'history';
|
||||||
routes
|
const router = new VueRouter({mode: routeMode, routes});
|
||||||
});
|
|
||||||
|
|
||||||
// 进度条配置
|
// 进度条配置
|
||||||
if (!isSoftware) {
|
if (!isSoftware) {
|
||||||
@ -292,8 +291,8 @@ const $init = async () => {
|
|||||||
|
|
||||||
const $preload = async () => {
|
const $preload = async () => {
|
||||||
await store.dispatch("preload");
|
await store.dispatch("preload");
|
||||||
const currentPath = (window.location.pathname || window.location.hash).replace(/^[#\/]/, '');
|
const hash = (window.location[routeMode === 'history' ? 'pathname' : 'hash']).replace(/^[#\/\s]/, '');
|
||||||
if (currentPath !== 'preload') {
|
if (hash !== 'preload') {
|
||||||
$init().catch(_ => {})
|
$init().catch(_ => {})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user