优化移动客户端登录逻辑

This commit is contained in:
kuaifan 2022-05-17 11:52:34 +08:00
parent 8522b4610d
commit a9c10a3e0b
2 changed files with 11 additions and 29 deletions

28
electron/build.js vendored
View File

@ -181,28 +181,12 @@ if (["dev"].includes(argv[2])) {
console.log("mobile directory does not exist!");
process.exit()
}
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)
});
startBuild({
name: 'App',
id: 'app',
platform: '',
url: 'http://public/',
}, 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

@ -159,11 +159,7 @@ export default {
welcomeTitle() {
let title = window.systemInfo.title || "DooTask";
if (title == "PublicDooTask") {
return "Public DooTask"
} else {
return "Welcome " + title
}
return "Welcome " + title
},
loginText() {
@ -249,13 +245,15 @@ export default {
},
inputServerUrl() {
let value = $A.rightDelete(this.cacheServerUrl, "/api/");
value = $A.leftDelete(value, "http://");
$A.modalInput({
title: "使用 SSO 登录",
value: this.cacheServerUrl,
value,
placeholder: "请输入服务器地址",
onOk: (value, cb) => {
if (value) {
this.inputServerChack(value).then(cb)
this.inputServerChack($A.trim(value)).then(cb)
} else {
this.clearServerUrl();
}