fix(profile): 替换默认头像链接并优化用户名修改提示
将默认头像链接更改为公司CDN地址,提升加载速度。使用`showToast`替换`alert`,优化用户体验。
Showing
2 changed files
with
9 additions
and
9 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-24 13:04:21 | 2 | * @Date: 2025-03-24 13:04:21 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-03-26 00:46:59 | 4 | + * @LastEditTime: 2025-03-26 13:27:45 |
| 5 | * @FilePath: /mlaj/src/views/profile/settings/AvatarSettingPage.vue | 5 | * @FilePath: /mlaj/src/views/profile/settings/AvatarSettingPage.vue |
| 6 | * @Description: 修改头像页面 | 6 | * @Description: 修改头像页面 |
| 7 | --> | 7 | --> |
| ... | @@ -18,7 +18,7 @@ | ... | @@ -18,7 +18,7 @@ |
| 18 | <van-image | 18 | <van-image |
| 19 | round | 19 | round |
| 20 | :src=" | 20 | :src=" |
| 21 | - userAvatar || 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg' | 21 | + userAvatar || 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg' |
| 22 | " | 22 | " |
| 23 | alt="用户头像" | 23 | alt="用户头像" |
| 24 | class="rounded-full border-4 border-white shadow-lg" | 24 | class="rounded-full border-4 border-white shadow-lg" | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-24 13:04:21 | 2 | * @Date: 2025-03-24 13:04:21 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-03-26 13:03:27 | 4 | + * @LastEditTime: 2025-03-26 13:42:45 |
| 5 | * @FilePath: /mlaj/src/views/profile/settings/UsernameSettingPage.vue | 5 | * @FilePath: /mlaj/src/views/profile/settings/UsernameSettingPage.vue |
| 6 | * @Description: 修改用户名页面 | 6 | * @Description: 修改用户名页面 |
| 7 | --> | 7 | --> |
| ... | @@ -43,7 +43,7 @@ import { ref, onMounted } from 'vue'; | ... | @@ -43,7 +43,7 @@ import { ref, onMounted } from 'vue'; |
| 43 | import AppLayout from '@/components/layout/AppLayout.vue'; | 43 | import AppLayout from '@/components/layout/AppLayout.vue'; |
| 44 | import FrostedGlass from '@/components/ui/FrostedGlass.vue'; | 44 | import FrostedGlass from '@/components/ui/FrostedGlass.vue'; |
| 45 | import { getUserInfoAPI, updateUserInfoAPI } from '@/api/users'; | 45 | import { getUserInfoAPI, updateUserInfoAPI } from '@/api/users'; |
| 46 | - | 46 | +import { showToast } from 'vant'; |
| 47 | import { useTitle } from '@vueuse/core'; | 47 | import { useTitle } from '@vueuse/core'; |
| 48 | 48 | ||
| 49 | const $route = useRoute(); | 49 | const $route = useRoute(); |
| ... | @@ -67,18 +67,18 @@ onMounted(async () => { | ... | @@ -67,18 +67,18 @@ onMounted(async () => { |
| 67 | // 处理用户名修改 | 67 | // 处理用户名修改 |
| 68 | const handleUsernameChange = async () => { | 68 | const handleUsernameChange = async () => { |
| 69 | if (!username.value) { | 69 | if (!username.value) { |
| 70 | - alert('请输入新的用户名'); | 70 | + showToast('请输入新的用户名'); |
| 71 | return; | 71 | return; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | try { | 74 | try { |
| 75 | - const response = await updateUserInfoAPI({ name: username.value }); | 75 | + const { code } = await updateUserInfoAPI({ name: username.value }); |
| 76 | - if (response.data) { | 76 | + if (code) { |
| 77 | - alert('用户名修改成功'); | 77 | + showToast('用户名修改成功'); |
| 78 | } | 78 | } |
| 79 | } catch (error) { | 79 | } catch (error) { |
| 80 | console.error('用户名修改失败:', error); | 80 | console.error('用户名修改失败:', error); |
| 81 | - alert('用户名修改失败,请重试'); | 81 | + showToast('用户名修改失败,请重试'); |
| 82 | } | 82 | } |
| 83 | }; | 83 | }; |
| 84 | </script> | 84 | </script> | ... | ... |
-
Please register or login to post a comment