mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
perf: 客户端窗口标题
This commit is contained in:
parent
343c5eb587
commit
d368e24f75
4
cmd
4
cmd
@ -96,13 +96,13 @@ run_electron() {
|
|||||||
if [ -d "./electron/dist" ]; then
|
if [ -d "./electron/dist" ]; then
|
||||||
rm -rf "./electron/dist"
|
rm -rf "./electron/dist"
|
||||||
fi
|
fi
|
||||||
if [ -d "./electron/public" ]; then
|
if [ -d "./electron/public" ] && [ "$argv" != "--nobuild" ]; then
|
||||||
rm -rf "./electron/public"
|
rm -rf "./electron/public"
|
||||||
fi
|
fi
|
||||||
mkdir -p ./electron/public
|
mkdir -p ./electron/public
|
||||||
cp ./electron/index.html ./electron/public/index.html
|
cp ./electron/index.html ./electron/public/index.html
|
||||||
#
|
#
|
||||||
if [ "$argv" != "dev" ]; then
|
if [ "$argv" != "dev" ] && [ "$argv" != "--nobuild" ]; then
|
||||||
npx mix --production -- --env --electron
|
npx mix --production -- --env --electron
|
||||||
fi
|
fi
|
||||||
node ./electron/build.js $argv
|
node ./electron/build.js $argv
|
||||||
|
|||||||
13
electron/build.js
vendored
13
electron/build.js
vendored
@ -106,12 +106,13 @@ const platform = ["build-mac", "build-mac-arm", "build-win"];
|
|||||||
|
|
||||||
// 生成配置、编译应用
|
// 生成配置、编译应用
|
||||||
function step1(data, publish) {
|
function step1(data, publish) {
|
||||||
let systemInfo = `window.systemInformation = {
|
let systemInfo = {
|
||||||
version: "${config.version}",
|
title: data.name,
|
||||||
origin: "./",
|
version: config.version,
|
||||||
apiUrl: "${formatUrl(data.url)}api/"
|
origin: "./",
|
||||||
}`;
|
apiUrl: formatUrl(data.url) + "api/",
|
||||||
fs.writeFileSync(electronDir + "/config.js", systemInfo, 'utf8');
|
}
|
||||||
|
fs.writeFileSync(electronDir + "/config.js", "window.systemInformation = " + JSON.stringify(systemInfo), 'utf8');
|
||||||
fs.writeFileSync(nativeCachePath, formatUrl(data.url));
|
fs.writeFileSync(nativeCachePath, formatUrl(data.url));
|
||||||
fs.writeFileSync(devloadCachePath, "", 'utf8');
|
fs.writeFileSync(devloadCachePath, "", 'utf8');
|
||||||
//
|
//
|
||||||
|
|||||||
@ -9,12 +9,68 @@
|
|||||||
<meta name="format-detection" content="telephone=no" />
|
<meta name="format-detection" content="telephone=no" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
<title>Dootask</title>
|
<title></title>
|
||||||
<link rel="stylesheet" type="text/css" href="./css/app.css">
|
<link rel="stylesheet" type="text/css" href="./css/app.css">
|
||||||
<link rel="stylesheet" type="text/css" href="./css/iview.css">
|
<link rel="stylesheet" type="text/css" href="./css/iview.css">
|
||||||
<script src="./js/language.all.js"></script>
|
<script src="./js/language.all.js"></script>
|
||||||
<script src="./js/scroll-into-view.min.js"></script>
|
<script src="./js/scroll-into-view.min.js"></script>
|
||||||
<script src="./config.js"></script>
|
<script src="./config.js"></script>
|
||||||
|
<script>
|
||||||
|
window.$B = {
|
||||||
|
ishave: function (set) {
|
||||||
|
return !!(set !== null && set !== "null" && set !== undefined && set !== "undefined" && set);
|
||||||
|
},
|
||||||
|
|
||||||
|
strExists: function (string, find, lower = false) {
|
||||||
|
string += "";
|
||||||
|
find += "";
|
||||||
|
if (lower !== true) {
|
||||||
|
string = string.toLowerCase();
|
||||||
|
find = find.toLowerCase();
|
||||||
|
}
|
||||||
|
return (string.indexOf(find) !== -1);
|
||||||
|
},
|
||||||
|
|
||||||
|
getMiddle: function (string, start, end) {
|
||||||
|
string = string.toString();
|
||||||
|
if (this.ishave(start) && this.strExists(string, start)) {
|
||||||
|
string = string.substring(string.indexOf(start) + start.length);
|
||||||
|
}
|
||||||
|
if (this.ishave(end) && this.strExists(string, end)) {
|
||||||
|
string = string.substring(0, string.indexOf(end));
|
||||||
|
}
|
||||||
|
return string;
|
||||||
|
},
|
||||||
|
|
||||||
|
urlParameter: function(key) {
|
||||||
|
let params = this.urlParameterAll();
|
||||||
|
return typeof key === "undefined" ? params : params[key];
|
||||||
|
},
|
||||||
|
|
||||||
|
urlParameterAll: function() {
|
||||||
|
let search = window.location.search || window.location.hash;
|
||||||
|
let arr = [];
|
||||||
|
if (this.strExists(search, "?")) {
|
||||||
|
arr = this.getMiddle(search, "?").split("&");
|
||||||
|
}
|
||||||
|
let params = {};
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
let data = arr[i].split("=");
|
||||||
|
if (data.length === 2) {
|
||||||
|
params[data[0]] = data[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
(function(){
|
||||||
|
let title = $B.urlParameter("title");
|
||||||
|
if (title) {
|
||||||
|
title = decodeURIComponent(title);
|
||||||
|
}
|
||||||
|
window.setTitle(title || window.systemInformation.title);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user