提交修改
This commit is contained in:
@@ -2,9 +2,10 @@ const api = require('../../../services/api')
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: { user: null },
|
||||
data: { user: null, themeMode: 'light' },
|
||||
onShow() {
|
||||
if (!app.globalData.token) { wx.reLaunch({ url: '/pages/login/index' }); return }
|
||||
this.setData({ themeMode: app.globalData.themeMode })
|
||||
this.loadProfile()
|
||||
},
|
||||
async loadProfile() {
|
||||
@@ -16,6 +17,10 @@ Page({
|
||||
},
|
||||
goEdit() { wx.navigateTo({ url: '/pages/profile/edit/index' }) },
|
||||
goAchievements() { wx.navigateTo({ url: '/pages/achievements/index' }) },
|
||||
onThemeToggle(e) {
|
||||
app.toggleTheme()
|
||||
this.setData({ themeMode: app.globalData.themeMode })
|
||||
},
|
||||
onLogout() {
|
||||
wx.showModal({ title: '确认退出', content: '确定要退出登录吗?', success: (res) => {
|
||||
if (res.confirm) {
|
||||
|
||||
Reference in New Issue
Block a user