feat: support user management

- sign up and delete account with email or phone
- sign in and sign out
- update nickname and avatar
- update account phone or email
This commit is contained in:
2025-11-18 20:53:08 +08:00
parent 83f8091e15
commit c923244a68
17 changed files with 982 additions and 40 deletions

View File

@@ -1,10 +1,33 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import fs from 'node:fs'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
// Vite 默认支持环境变量,无需额外配置
// 环境变量加载优先级:
// .env.local > .env.[mode] > .env
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const keyPath = env.VITE_HTTPS_KEY_PATH
const certPath = env.VITE_HTTPS_CERT_PATH
return {
plugins: [react()],
// Vite 默认支持环境变量,无需额外配置
// 环境变量加载优先级:
// .env.local > .env.[mode] > .env
server: {
https: keyPath && certPath
? {
key: fs.readFileSync(keyPath),
cert: fs.readFileSync(certPath),
}
: undefined,
host: 'localhost',
proxy: {
'/api': {
target: 'http://localhost:8099',
changeOrigin: true,
secure: false,
},
},
},
}
})