|
|
@@ -19,7 +19,7 @@ import { creditBalanceClient } from '@/api'
|
|
|
import './index.css'
|
|
|
|
|
|
const ProfilePage: React.FC = () => {
|
|
|
- const { user: userProfile, logout, isLoading: loading, updateUser, refreshUser } = useAuth()
|
|
|
+ const { user: userProfile, isLoading: loading, updateUser, refreshUser } = useAuth()
|
|
|
const [showCustomerService, setShowCustomerService] = useState(false)
|
|
|
const [showEditProfile, setShowEditProfile] = useState(false)
|
|
|
// const [editingAvatar, setEditingAvatar] = useState<string | undefined>(undefined)
|
|
|
@@ -81,35 +81,35 @@ const ProfilePage: React.FC = () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- const handleLogout = async () => {
|
|
|
- try {
|
|
|
- Taro.showModal({
|
|
|
- title: '退出登录',
|
|
|
- content: '确定要退出登录吗?',
|
|
|
- success: async (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- Taro.showLoading({ title: '退出中...' })
|
|
|
- await logout()
|
|
|
- Taro.hideLoading()
|
|
|
- Taro.showToast({
|
|
|
- title: '已退出登录',
|
|
|
- icon: 'success',
|
|
|
- duration: 1500
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- Taro.reLaunch({ url: '/pages/index/index' })
|
|
|
- }, 1500)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } catch (error) {
|
|
|
- Taro.hideLoading()
|
|
|
- Taro.showToast({
|
|
|
- title: '退出失败,请重试',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // const handleLogout = async () => {
|
|
|
+ // try {
|
|
|
+ // Taro.showModal({
|
|
|
+ // title: '退出登录',
|
|
|
+ // content: '确定要退出登录吗?',
|
|
|
+ // success: async (res) => {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // Taro.showLoading({ title: '退出中...' })
|
|
|
+ // await logout()
|
|
|
+ // Taro.hideLoading()
|
|
|
+ // Taro.showToast({
|
|
|
+ // title: '已退出登录',
|
|
|
+ // icon: 'success',
|
|
|
+ // duration: 1500
|
|
|
+ // })
|
|
|
+ // setTimeout(() => {
|
|
|
+ // Taro.reLaunch({ url: '/pages/index/index' })
|
|
|
+ // }, 1500)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } catch (error) {
|
|
|
+ // Taro.hideLoading()
|
|
|
+ // Taro.showToast({
|
|
|
+ // title: '退出失败,请重试',
|
|
|
+ // icon: 'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
const handleEditProfile = () => {
|