no message

This commit is contained in:
kuaifan
2023-02-24 16:11:20 +08:00
parent 0c9b553591
commit f9fdff54ac
17 changed files with 38 additions and 15 deletions
+3
View File
@@ -432,6 +432,9 @@ if [ $# -gt 0 ]; then
shift 1
run_exec php "php app/Models/clearHelper.php"
run_exec php "php artisan ide-helper:models -W"
elif [[ "$1" == "translate" ]]; then
shift 1
run_exec php "cd /var/www/language && php translate.php"
elif [[ "$1" == "test" ]]; then
shift 1
e="./vendor/bin/phpunit $@" && run_exec php "$e"
+13 -7
View File
@@ -52,10 +52,9 @@ function changeLog() {
}
let start = content.indexOf(array[0]);
if (array.length > 5) {
let length = content.indexOf(array[5]) - start;
content = content.substr(start, length)
content = content.substring(start, content.indexOf(array[5]))
} else {
content = content.substr(start)
content = content.substring(start)
}
return content;
}
@@ -120,8 +119,6 @@ function startBuild(data, publish, release) {
// drawio
cloneDrawio(systemInfo)
}
// language
fse.copySync(path.resolve(__dirname, "../public/js/language"), path.resolve(electronDir, "js/language"))
// config.js
fs.writeFileSync(electronDir + "/config.js", "window.systemInfo = " + JSON.stringify(systemInfo), 'utf8');
fs.writeFileSync(nativeCachePath, utils.formatUrl(data.url));
@@ -129,10 +126,19 @@ function startBuild(data, publish, release) {
// default (解决 Failed to load resource: net::ERR_FILE_NOT_FOUND 报错)
fs.writeFileSync(electronDir + "/default", "default", 'utf8');
// index.html
let manifestFile = path.resolve(electronDir, "manifest.json");
if (!fs.existsSync(manifestFile)) {
console.log("manifest non-existent!");
process.exit()
}
let manifestContent = JSON.parse(fs.readFileSync(manifestFile, 'utf8'));
let indexFile = path.resolve(electronDir, "index.html");
let indexString = fs.readFileSync(indexFile, 'utf8');
indexString = indexString.replace(/<title>(.*?)<\/title>/g, `<title>${data.name}</title>`);
indexString = indexString.replace("<!--style-->", `<link rel="stylesheet" type="text/css" href="./${manifestContent['resources/assets/js/app.js']['css'][0]}">`);
indexString = indexString.replace("<!--script-->", `<script type="module" src="./${manifestContent['resources/assets/js/app.js']['file']}"></script>`);
fs.writeFileSync(indexFile, indexString, 'utf8');
//
if (data.id === 'app') {
const publicDir = path.resolve(__dirname, "../resources/mobile/src/public");
fse.removeSync(publicDir)
@@ -152,7 +158,7 @@ function startBuild(data, publish, release) {
econfig.name = data.name;
econfig.version = config.version;
econfig.build.appId = data.id;
econfig.build.directories.output = `dist/${data.id}/${data.platform}`;
econfig.build.directories.output = `dist/${data.id.replace(/\./g, '-')}/${data.platform}`;
econfig.build.artifactName = appName + "-v${version}-${os}-${arch}.${ext}";
econfig.build.nsis.artifactName = appName + "-v${version}-${os}-${arch}.${ext}";
if (!process.env.APPLEID || !process.env.APPLEIDPASS || publish !== true) {
@@ -187,7 +193,7 @@ function startBuild(data, publish, release) {
if (["dev"].includes(argv[2])) {
// 开发模式
fs.writeFileSync(devloadCachePath, utils.formatUrl("127.0.0.1:" + env.parsed.APP_PORT), 'utf8');
child_process.spawn("npx", ["mix", "watch", "--hot", "--", "--env", "--electron"], {stdio: "inherit"});
child_process.spawn("npx", ["vite", "--", "fromcmd", "electron"], {stdio: "inherit"});
child_process.spawn("npm", ["run", "start-quiet"], {stdio: "inherit", cwd: "electron"});
} else if (["app"].includes(argv[2])) {
// 编译给app
+3 -4
View File
@@ -9,8 +9,9 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title></title>
<link rel="stylesheet" type="text/css" href="./css/app.css">
<!--style-->
<link rel="stylesheet" type="text/css" href="./css/iview.css">
<link rel="stylesheet" type="text/css" href="./css/loading.css">
<script src="./js/scroll-into-view.min.js"></script>
<script src="./config.js"></script>
</head>
@@ -32,9 +33,7 @@
</div>
</div>
<script type="text/javascript">
document.writeln("<script type=\"module\" src=\"./js/app.js?v=" + window.systemInfo.version + "\"><\/script>");
</script>
<!--script-->
</body>
</html>
+1 -1
View File
@@ -1,7 +1,7 @@
const fs = require("fs");
const {shell, dialog, session} = require("electron");
export default {
module.exports = {
/**
* 是否数组
* @param obj
+5
View File
@@ -299,10 +299,15 @@ try {
print_r("[$type] $file saved\n");
}
} elseif ($type === 'web') {
if (!is_dir("../resources/assets/statics/public/js/language")) {
mkdir("../resources/assets/statics/public/js/language", 0777, true);
}
if (!is_dir("../public/js/language")) {
mkdir("../public/js/language", 0777, true);
}
foreach ($results as $key => $item) {
$file = "../resources/assets/statics/public/js/language/$key.js";
file_put_contents($file, "if(typeof window.LANGUAGE_DATA===\"undefined\")window.LANGUAGE_DATA={};window.LANGUAGE_DATA[\"{$key}\"]=" . json_encode($item, JSON_UNESCAPED_UNICODE));
$file = "../public/js/language/$key.js";
file_put_contents($file, "if(typeof window.LANGUAGE_DATA===\"undefined\")window.LANGUAGE_DATA={};window.LANGUAGE_DATA[\"{$key}\"]=" . json_encode($item, JSON_UNESCAPED_UNICODE));
print_r("[$type] $file saved\n");
+2 -1
View File
@@ -5,7 +5,8 @@
"scripts": {
"start": "./cmd dev",
"build": "./cmd prod",
"version": "node ./version.js"
"version": "node ./version.js",
"translate": "./cmd translate"
},
"author": {
"name": "KuaiFan",
+1 -1
View File
@@ -2558,7 +2558,7 @@ export default {
const resData = result.data;
if ($A.isJson(resData.dialog)) {
const dialogData = Object.assign(resData.dialog, {user_ms: $A.TimeM(resData.dialog.user_at)})
setTimeout(_ => dispatch("saveDialog", dialogData), 100) // 延迟更新对话详情是因为等消息处理完
setTimeout(_ => dispatch("saveDialog", dialogData), 300) // 延迟更新对话详情是因为等消息处理完
//
const ids = resData.list.map(({id}) => id)
state.dialogMsgs = state.dialogMsgs.filter(item => {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
if(typeof window.LANGUAGE_DATA==="undefined")window.LANGUAGE_DATA={};window.LANGUAGE_DATA["zh"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
+1 -1
View File
@@ -21,7 +21,7 @@ export default defineConfig(({command, mode}) => {
const port = parseInt(env['APP_DEV_PORT'])
return {
base: '/',
base: isElectron ? './' : '/',
publicDir: publicPath,
server: {
host,