描述:登录

This commit is contained in:
SelfRidicule 2024-04-25 13:46:43 +08:00
parent f8a9f51f4e
commit 7d8f971852
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,7 @@
App({
// 郑州小程序配置信息
APPID: 'wx5582a07c1fbbcf06',
APPSECRET: 'ad24130a8919c613efd9538f69abafd3',
// 本地测试时不用加/api
DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名
IMG_NAME: 'http://192.168.0.11:9227',

View File

@ -30,6 +30,8 @@ Page({
wx.login({
success(wxRes) {
loginRq({
"appId": app.APPID,
"appSecret": app.APPSECRET,
"jsCode": wxRes.code
}).then(res => {
console.log('loginRq', res);
@ -51,6 +53,8 @@ Page({
let _this = this;
console.log('getPhoneNumber', e)
registerPhone({
"appId": app.APPID,
"appSecret": app.APPSECRET,
"code": e.detail.code,
"openid": _this.data.openid
}).then(res => {
@ -59,7 +63,7 @@ Page({
// 跳转首页
_this.jumpIndex(res.openid, res.user, res.token.token)
} else {
app.selfShowMsg(res.msg)
app.selfShowMsg(res.msg)
}
})
},