文件
jw-beauty/miniprogram/pages/login/login.js
T
Guoguo 8427d35fb3 chore: remove debug code and restore phone authorization as required
- Remove debug register page entry and console.log from login
- Remove phone skip option, phone authorization is mandatory
- Restore incomplete registration check (no phone → redirect to register)
2026-05-07 05:54:37 -07:00

34 行
872 B
JavaScript

var app = getApp()
Page({
data: {
statusBarHeight: 44,
loading: false
},
onLoad: function () {
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
},
onLogin: function () {
var self = this
self.setData({ loading: true })
app.doLogin().then(function (data) {
self.setData({ loading: false })
if (data && (data.is_new_user || !data.user_info || !data.user_info.phone)) {
wx.redirectTo({ url: '/pages/register/register' })
} else {
wx.switchTab({ url: '/pages/index/index' })
}
}).catch(function (err) {
self.setData({ loading: false })
wx.showToast({ title: err.message || '登录失败', icon: 'none' })
})
},
onAgreement: function () {
wx.showModal({ title: '提示', content: '用户协议和隐私政策内容建设中', showCancel: false })
}
})