Files
JayuCloud/FD-WeChat-Fronted/api/auth.js
T

138 lines
4.4 KiB
JavaScript
Raw Normal View History

/**
* 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.
*/
2026-04-01 15:18:35 +08:00
const request = require('../utils/request')
module.exports = {
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
sendVerificationCode(data) {
return request({
url: '/user/send-verification-code',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
login(data) {
return request({
url: '/user/login',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
phoneLogin(data) {
return request({
url: '/user/phone-login',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-02 13:20:28 +08:00
wechatMiniAutoLogin(data) {
return request({
url: '/user/wechat-mini/auto-login',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-02 13:20:28 +08:00
wechatMiniPhoneLogin(data) {
return request({
url: '/user/wechat-mini/phone-login',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-02 13:20:28 +08:00
confirmWechatMiniLogin(data) {
return request({
url: '/user/wechat-mini/confirm-login',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
register(data) {
return request({
url: '/user/register',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
logout() {
return request({
url: '/user/logout',
method: 'POST'
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
switchShop(data) {
return request({
url: '/user/switch-shop',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
resetPasswordByPhone(data) {
return request({
url: '/user/reset-password-by-phone',
method: 'POST',
data
})
},
2026-05-23 18:45:41 +08:00
/**
* 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'
})
2026-04-01 15:18:35 +08:00
}
}