Files
JayuCloud/WeChatProgram/api/auth.js
T

138 lines
4.4 KiB
JavaScript

/**
* Mini program API wrapper for this module.
* Call guide: require this module in a page, then invoke the matching method from page event handlers or lifecycle hooks.
*/
const request = require('../utils/request')
module.exports = {
/**
* Purpose: sendVerificationCode supports auth.js by holding or executing the send verification code page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
sendVerificationCode(data) {
return request({
url: '/user/send-verification-code',
method: 'POST',
data
})
},
/**
* Purpose: login supports auth.js by holding or executing the login page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
login(data) {
return request({
url: '/user/login',
method: 'POST',
data
})
},
/**
* Purpose: phoneLogin supports auth.js by holding or executing the phone login page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
phoneLogin(data) {
return request({
url: '/user/phone-login',
method: 'POST',
data
})
},
/**
* Purpose: wechatMiniAutoLogin supports auth.js by holding or executing the wechat mini auto login page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
wechatMiniAutoLogin(data) {
return request({
url: '/user/wechat-mini/auto-login',
method: 'POST',
data
})
},
/**
* Purpose: wechatMiniPhoneLogin supports auth.js by holding or executing the wechat mini phone login page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
wechatMiniPhoneLogin(data) {
return request({
url: '/user/wechat-mini/phone-login',
method: 'POST',
data
})
},
/**
* Purpose: confirmWechatMiniLogin supports auth.js by holding or executing the confirm wechat mini login page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
confirmWechatMiniLogin(data) {
return request({
url: '/user/wechat-mini/confirm-login',
method: 'POST',
data
})
},
/**
* Purpose: register supports auth.js by holding or executing the register page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
register(data) {
return request({
url: '/user/register',
method: 'POST',
data
})
},
/**
* Purpose: logout supports auth.js by holding or executing the logout page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
logout() {
return request({
url: '/user/logout',
method: 'POST'
})
},
/**
* Purpose: switchShop supports auth.js by holding or executing the switch shop page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
switchShop(data) {
return request({
url: '/user/switch-shop',
method: 'POST',
data
})
},
/**
* Purpose: resetPasswordByPhone supports auth.js by holding or executing the reset password by phone page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
resetPasswordByPhone(data) {
return request({
url: '/user/reset-password-by-phone',
method: 'POST',
data
})
},
/**
* Purpose: getCurrentAgreements supports auth.js by holding or executing the get current agreements page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
getCurrentAgreements() {
return request({
url: '/legal-agreement/current',
method: 'GET'
})
}
}