no message

This commit is contained in:
kuaifan 2022-05-13 19:35:26 +08:00
parent 99f9431794
commit bba34ef55e
10 changed files with 144 additions and 13 deletions

3
cmd
View File

@ -379,6 +379,9 @@ if [ $# -gt 0 ]; then
elif [[ "$1" == "prod" ]] || [[ "$1" == "production" ]]; then
shift 1
run_compile prod
elif [[ "$1" == "appbuild" ]] || [[ "$1" == "buildapp" ]]; then
shift 1
run_electron app
elif [[ "$1" == "electron" ]]; then
shift 1
run_electron $@

41
electron/build.js vendored
View File

@ -99,11 +99,16 @@ function genericPublish({url, version, output}) {
// 生成配置、编译应用
function startBuild(data, publish) {
// information
console.log("Name: " + data.name);
console.log("AppId: " + data.id);
console.log("Version: " + config.version);
console.log("Platform: " + data.platform);
console.log("Publish: " + (publish ? 'Yes' : 'No'));
if (data.id === 'app') {
console.log("Name: " + data.name);
console.log("Version: " + config.version);
} else {
console.log("Name: " + data.name);
console.log("AppId: " + data.id);
console.log("Version: " + config.version);
console.log("Platform: " + data.platform);
console.log("Publish: " + (publish ? 'Yes' : 'No'));
}
let systemInfo = {
title: data.name,
version: config.version,
@ -122,6 +127,9 @@ function startBuild(data, publish) {
let indexString = fs.readFileSync(indexFile, 'utf8');
indexString = indexString.replace(/<title>(.*?)<\/title>/g, `<title>${data.name}</title>`);
fs.writeFileSync(indexFile, indexString, 'utf8');
if (data.id === 'app') {
return;
}
// package.json Backup
fse.copySync(packageFile, packageBakFile)
// package.json Generated
@ -163,6 +171,29 @@ 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("npm", ["run", "start-quiet"], {stdio: "inherit", cwd: "electron"});
} else if (["app"].includes(argv[2])) {
let urlChoices = [];
Array.from(new Set(config.app.map(item => item.url))).forEach(url => {
urlChoices.push({
name: url,
value: url
})
})
inquirer.prompt([
{
type: 'list',
name: 'url',
message: "选择网址",
choices: urlChoices
}
]).then(answers => {
startBuild({
name: 'App',
id: 'app',
platform: '',
url: answers.url,
}, false)
});
} else if (platform.includes(argv[2])) {
// 自动编译
let data = config.app.find(({id, publish}) => id === process.env.APPID && publish.provider === process.env.PROVIDER);

View File

@ -88,8 +88,12 @@ export default {
'isDesktop',
]),
isSoftware() {
return this.$Electron || this.$isEEUiApp;
},
showSSO() {
return this.$Electron && ['login'].includes(this.$route.name)
return this.isSoftware && ['login'].includes(this.$route.name)
},
showDown() {

View File

@ -10,7 +10,7 @@
<div v-else class="login-subtitle">{{$L('输入您的凭证以访问您的帐户。')}}</div>
<div class="login-input">
<Input v-if="$Electron && cacheServerUrl" :value="$A.getDomain(cacheServerUrl)" prefix="ios-globe-outline" size="large" readonly clearable @on-clear="clearServerUrl"/>
<Input v-if="isSoftware && cacheServerUrl" :value="$A.getDomain(cacheServerUrl)" prefix="ios-globe-outline" size="large" readonly clearable @on-clear="clearServerUrl"/>
<Input v-model="email" prefix="ios-mail-outline" :placeholder="$L('输入您的电子邮件')" type="email" size="large" @on-enter="onLogin" @on-blur="onBlur" />
@ -107,7 +107,7 @@ export default {
this.getDemoAccount();
this.getNeedStartHome();
//
if (this.$Electron) {
if (this.isSoftware) {
this.chackServerUrl().catch(_ => {});
} else {
this.clearServerUrl();
@ -117,12 +117,14 @@ export default {
this.inputServerUrl();
});
},
beforeDestroy() {
if (this.subscribe) {
this.subscribe.unsubscribe();
this.subscribe = null;
}
},
activated() {
this.loginType = 'login'
//
@ -130,6 +132,7 @@ export default {
this.$Electron.sendMessage('subWindowDestroyAll')
}
},
deactivated() {
this.loginJump = false;
this.password = "";
@ -137,6 +140,7 @@ export default {
this.code = "";
this.invite = "";
},
computed: {
...mapState([
'cacheServerUrl',
@ -145,6 +149,10 @@ export default {
'themeList',
]),
isSoftware() {
return this.$Electron || this.$isEEUiApp;
},
currentLanguage() {
return this.languageList[this.languageType] || 'Language'
},
@ -166,6 +174,7 @@ export default {
return text
}
},
watch: {
'$route' ({query}) {
if (query.type=='reg'){
@ -180,6 +189,7 @@ export default {
}
}
},
methods: {
goHome() {
if (this.needStartHome) {
@ -314,7 +324,7 @@ export default {
isNotServer() {
let apiHome = $A.getDomain(window.systemInfo.apiUrl)
return this.$Electron && (apiHome == "" || apiHome == "public")
return this.isSoftware && (apiHome == "" || apiHome == "public")
},
onBlur() {

View File

@ -6,7 +6,7 @@
right: 0;
background-color: #f8f8f8;
box-shadow: 0 0 2px rgba(28, 34, 43, 0.15);
z-index: 9998;
z-index: 99;
> ul {
display: flex;
align-items: center;

View File

@ -88,3 +88,18 @@
}
}
}
@media (max-width: 768px) {
.common-right-bottom {
bottom: 20px;
right: auto;
left: 50%;
transform: translateX(-50%);
.common-right-bottom-link {
color: $primary-text-color !important;
background-color: transparent;
border-color: transparent;
}
}
}

View File

@ -861,6 +861,9 @@
width: unset;
overflow: hidden;
text-align: center;
.main-title {
justify-content: center;
}
.sub-title {
line-height: 18px;
}

View File

@ -11,7 +11,7 @@
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 24px;
margin-bottom: 20px;
.project-title {
display: flex;
align-items: center;
@ -142,11 +142,11 @@
float: left;
color: #999999;
line-height: 24px;
padding: 3px 0;
padding: 6px 0;
}
.project-switch {
float: right;
margin-left: 32px;
margin: 3px 0 3px 32px;
display: flex;
align-items: flex-end;
.project-checkbox {

View File

@ -31,6 +31,10 @@
padding: 0 20px;
overflow: auto;
.ivu-collapse {
min-width: 700px;
}
.ivu-collapse-header {
display: flex;
align-items: center;

View File

@ -143,3 +143,64 @@
}
}
}
@media (max-width: 768px) {
.page-login {
.login-body {
padding: 0 0 110px;
.login-logo {
margin-top: 24px;
width: 76px;
height: 76px;
}
.login-box {
margin-top: 0;
width: 100%;
max-width: 460px;
border-radius: 12px;
background-color: transparent;
box-shadow: none;
.login-title {
font-size: 26px;
}
.login-subtitle {
margin-top: 4px;
}
.login-input {
margin: 20px 36px;
.ivu-input-large {
height: 44px;
}
.ivu-input-with-prefix {
padding-left: 40px;
}
.ivu-input-prefix,
.ivu-input-suffix {
width: 44px;
}
.ivu-input-wrapper-large .ivu-input-prefix i,
.ivu-input-wrapper-large .ivu-input-suffix i {
font-size: 20px;
line-height: 44px;
}
}
}
.login-bottom {
margin-top: 8px;
width: 100%;
max-width: 460px;
padding: 0 36px;
}
}
}
}