Compare commits

...

4 Commits

Author SHA1 Message Date
12480f3706 Merge remote-tracking branch 'origin/dev' into dev 2025-08-10 16:22:31 +08:00
05af3d221c 修复了验证码bug 2025-08-10 16:22:02 +08:00
d17f6f09c5 修复了验证码bug 2025-08-10 11:25:09 +08:00
8a085da7dc 修复了验证码bug 2025-08-09 22:30:47 +08:00
5 changed files with 9 additions and 5 deletions

View File

@ -179,7 +179,7 @@ Page({
const token = res.data.data.token || res.data.data; const token = res.data.data.token || res.data.data;
// ← 新增:将 token 存到本地缓存 // ← 新增:将 token 存到本地缓存
wx.setStorageSync('token', token); wx.setStorageSync('token', token);
wx.setStorageSync('role', role)
wx.showToast({ wx.showToast({
title: '登录成功', title: '登录成功',
icon: 'success', icon: 'success',

View File

@ -54,7 +54,7 @@ Page({
}, },
sendSmsCode() { sendSmsCode() {
const { phone } = this.data; const { phone, role } = this.data;
if (!phone.trim()) { if (!phone.trim()) {
wx.showToast({ title: '请输入手机号', icon: 'none' }); wx.showToast({ title: '请输入手机号', icon: 'none' });
return; return;
@ -68,7 +68,8 @@ Page({
method: 'POST', method: 'POST',
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
data: { data: {
templateString: phone phoneNumber: phone,
userRole: role
}, },
success: res => { success: res => {
// 假设后端返回 { success: true, ... } // 假设后端返回 { success: true, ... }
@ -192,6 +193,7 @@ Page({
}); });
}, 1000); }, 1000);
} else { } else {
console.log(res.data)
wx.showToast({ wx.showToast({
title: res.data.message || '注册失败', title: res.data.message || '注册失败',
icon: 'none', icon: 'none',

View File

@ -35,6 +35,7 @@ Page({
icon: 'success' icon: 'success'
}) })
wx.removeStorageSync('token') wx.removeStorageSync('token')
wx.removeStorageSync('role')
setTimeout(() => { setTimeout(() => {
wx.reLaunch({ wx.reLaunch({
url: '/pages/welcome/homePage/homePage', url: '/pages/welcome/homePage/homePage',

View File

@ -69,7 +69,8 @@ Page({
Authorization: wx.getStorageSync('token') Authorization: wx.getStorageSync('token')
}, },
data: { data: {
templateString: phone phoneNumber: phone,
userRole: wx.getStorageSync('role')
}, },
success: res => { success: res => {
if (res.data.code === 1) { if (res.data.code === 1) {

View File

@ -25,5 +25,5 @@
"tabIndent": "auto", "tabIndent": "auto",
"tabSize": 2 "tabSize": 2
}, },
"appid": "wx3f968a09e31d6bed" "appid": "wx8711c8d4fb04fef9"
} }