后端: Go(Gin+GORM+MySQL+Redis) - 17张业务表(yz_pw_前缀), 自动迁移 - JWT认证(3小时) + 盐+MD5密码 + 图形验证码 - 班级CRUD/加入(8人姓名验证/邀请码)/审核/30天自动清理 - 系统配置(16项)/菜单管理(动态路由)/数据统计 - 文件MD5去重/数据隔离/账号封禁/敏感词DFA检测 前端: Vue3+Vite+Element Plus+Less+ECharts+FontAwesome - 动态路由(数据库菜单驱动) - 蓝白配色, H5响应式 - 登录/注册/忘记密码/个人中心 - 班级创建向导/详情/加入/列表 - 管理后台: 审核/配置/菜单/统计/用户/敏感词 数据库: MySQL 10.31.100.3:3306/photowall 管理员: hero920103 / 920103
39 lines
933 B
Vue
39 lines
933 B
Vue
<template>
|
|
<div class="card">
|
|
<div class="card-title">用户设置 - 编辑资料</div>
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label>昵称</label>
|
|
<input v-model="form.nickname" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>个人简介</label>
|
|
<textarea v-model="form.bio" rows="3"></textarea>
|
|
</div>
|
|
<button class="btn btn-primary" @click="save">保存</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, onMounted } from 'vue'
|
|
import { userApi } from '../../../../api'
|
|
|
|
const form = ref({ nickname: '', bio: '' })
|
|
|
|
onMounted(async () => {
|
|
const profile = await userApi.profile()
|
|
form.value.nickname = profile.user.nickname
|
|
form.value.bio = profile.user.bio
|
|
})
|
|
|
|
async function save() {
|
|
try {
|
|
await userApi.updateProfile(form.value)
|
|
alert('保存成功')
|
|
} catch (e) {
|
|
alert('保存失败:' + e.message)
|
|
}
|
|
}
|
|
</script>
|