mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-12 20:57:26 +08:00
version 2.1.0 (#482)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
"primeicons": "^7.0.0",
|
||||
"primevue": "^4.2.1",
|
||||
"tailwindcss-primeui": "^0.3.4",
|
||||
"ts-md5": "^1.3.1",
|
||||
"uuid": "^11.0.2",
|
||||
"vue": "^3.5.12",
|
||||
"vue-i18n": "^10.0.4"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import axios, { AxiosError, AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
||||
import { Md5 } from 'ts-md5'
|
||||
|
||||
export interface ValidateConfigResponse {
|
||||
toml_config: string;
|
||||
@@ -79,6 +80,7 @@ export class ApiClient {
|
||||
// 注册
|
||||
public async register(data: RegisterData): Promise<RegisterResponse> {
|
||||
try {
|
||||
data.credentials.password = Md5.hashStr(data.credentials.password);
|
||||
const response = await this.client.post<RegisterResponse>('/auth/register', data);
|
||||
console.log("register response:", response);
|
||||
return { success: true, message: 'Register success', };
|
||||
@@ -93,6 +95,7 @@ export class ApiClient {
|
||||
// 登录
|
||||
public async login(data: Credential): Promise<LoginResponse> {
|
||||
try {
|
||||
data.password = Md5.hashStr(data.password);
|
||||
const response = await this.client.post<any>('/auth/login', data);
|
||||
console.log("login response:", response);
|
||||
return { success: true, message: 'Login success', };
|
||||
@@ -116,7 +119,7 @@ export class ApiClient {
|
||||
}
|
||||
|
||||
public async change_password(new_password: string) {
|
||||
await this.client.put('/auth/password', { new_password: new_password });
|
||||
await this.client.put('/auth/password', { new_password: Md5.hashStr(new_password) });
|
||||
}
|
||||
|
||||
public async check_login_status() {
|
||||
|
||||
@@ -47,7 +47,7 @@ const onRegister = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const defaultApiHost = 'http://10.147.223.128:11211'
|
||||
const defaultApiHost = 'http://47.115.208.211:11211'
|
||||
const apiHost = ref<string>(defaultApiHost)
|
||||
const apiHostSuggestions = ref<Array<string>>([])
|
||||
const apiHostSearch = async (event: { query: string }) => {
|
||||
|
||||
@@ -4,5 +4,6 @@ import { viteSingleFile } from "vite-plugin-singlefile"
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: '',
|
||||
plugins: [vue(), viteSingleFile()],
|
||||
})
|
||||
|
||||
@@ -230,7 +230,7 @@ impl MigrationTrait for Migration {
|
||||
.columns(vec![Users::Username, Users::Password])
|
||||
.values_panic(vec![
|
||||
"user".into(),
|
||||
"$argon2i$v=19$m=16,t=2,p=1$dHJ5dXZkYmZkYXM$UkrNqWz0BbSVBq4ykLSuJw".into(),
|
||||
"$argon2i$v=19$m=16,t=2,p=1$aGVyRDBrcnRycnlaMDhkbw$449SEcv/qXf+0fnI9+fYVQ".into(), // user (md5summed)
|
||||
])
|
||||
.to_owned();
|
||||
manager.exec_stmt(user).await?;
|
||||
@@ -240,7 +240,7 @@ impl MigrationTrait for Migration {
|
||||
.columns(vec![Users::Username, Users::Password])
|
||||
.values_panic(vec![
|
||||
"admin".into(),
|
||||
"$argon2i$v=19$m=16,t=2,p=1$Ymd1Y2FlcnQ$x0q4oZinW9S1ZB9BcaHEpQ".into(),
|
||||
"$argon2i$v=19$m=16,t=2,p=1$bW5idXl0cmY$61n+JxL4r3dwLPAEDlDdtg".into(), // admin (md5summed)
|
||||
])
|
||||
.to_owned();
|
||||
manager.exec_stmt(admin).await?;
|
||||
|
||||
Reference in New Issue
Block a user