feat: add web application

This commit is contained in:
richjohnrambo
2026-10-10 20:55:59 +08:00
parent 3eb5d78875
commit 50fcfd2d3d
571 changed files with 73992 additions and 135 deletions
+43
View File
@@ -0,0 +1,43 @@
import { isArray } from "@/utils/is";
interface Account {
/**
* 账号名称
*/
name: string;
/**
* 用户名
*/
username: string;
/**
* 密码
*/
password: string;
}
/**
* 获取配置的账号信息
* @returns {[]Account} 返回账号信息数组
*/
export function getDemoAccounts() {
let envConf = import.meta.env.VITE_APP_DEMO_ACCOUNT || "";
// 帐号密码一样
// [["username"],["username","password"],["username","password","name"]]
try {
let accounts = JSON.parse(envConf);
if (accounts && isArray(accounts)) {
return accounts.map((item: String[]) => {
let [username = "", password = "", name = ""] = item;
username = username;
password = password || username;
name = name || username;
return {
name,
username,
password,
} as Account;
});
}
} catch (error) {}
return [] as Account[];
}