This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const userApi = require('../../api/user')
|
||||
const auth = require('../../utils/auth')
|
||||
const profileCache = require('../../utils/profile-cache')
|
||||
const { showErrorToast } = require('../../utils/toast')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -46,7 +47,7 @@ Page({
|
||||
this.setData({ closureRequest })
|
||||
wx.showToast({ title: '注销申请已提交' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '申请提交失败', icon: 'none' })
|
||||
showErrorToast(error, '申请提交失败')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -58,7 +59,7 @@ Page({
|
||||
await this.loadClosureRequest()
|
||||
wx.showToast({ title: '申请已撤回' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '撤回失败', icon: 'none' })
|
||||
showErrorToast(error, '撤回失败')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -71,7 +72,7 @@ Page({
|
||||
const session = auth.getSession()
|
||||
app.setSession({ ...session, userInfo: { ...(session.userInfo || {}), ...profile } })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '账号信息加载失败', icon: 'none' })
|
||||
showErrorToast(error, '账号信息加载失败')
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
@@ -103,7 +104,7 @@ Page({
|
||||
await this.loadProfile({ force: true })
|
||||
wx.showToast({ title: '手机号已绑定' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '绑定失败', icon: 'none' })
|
||||
showErrorToast(error, '绑定失败')
|
||||
} finally {
|
||||
this.setData({ binding: false })
|
||||
}
|
||||
@@ -122,7 +123,7 @@ Page({
|
||||
this.startCountdown()
|
||||
wx.showToast({ title: '验证码已发送' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '验证码发送失败', icon: 'none' })
|
||||
showErrorToast(error, '验证码发送失败')
|
||||
} finally {
|
||||
this.setData({ codeLoading: false })
|
||||
}
|
||||
@@ -151,7 +152,7 @@ Page({
|
||||
await this.loadProfile({ force: true })
|
||||
wx.showToast({ title: '手机号已绑定' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '绑定失败', icon: 'none' })
|
||||
showErrorToast(error, '绑定失败')
|
||||
} finally {
|
||||
this.setData({ binding: false })
|
||||
}
|
||||
@@ -178,7 +179,7 @@ Page({
|
||||
await this.loadProfile({ force: true })
|
||||
wx.showToast({ title: '手机号已解绑' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '解绑失败', icon: 'none' })
|
||||
showErrorToast(error, '解绑失败')
|
||||
} finally {
|
||||
this.setData({ binding: false })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user