/** * Purpose: request supports auth.js by holding or executing the request page or API role. * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. */ const request = require('../utils/request') module.exports = { /** * 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: '/auth/login', method: 'POST', data }) }, /** * Purpose: getLoginShops supports auth.js by holding or executing the get login shops 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. */ getLoginShops(account) { return request({ url: `/auth/login-shops/${encodeURIComponent(account)}` }) }, /** * 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(shopId) { return request({ url: '/auth/switch-shop', method: 'POST', data: { shopId: shopId || undefined } }) }, /** * Purpose: refreshToken supports auth.js by holding or executing the refresh token 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. */ refreshToken(refreshToken) { return request({ url: '/auth/refresh', method: 'POST', data: { refreshToken } }) }, /** * 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: '/auth/logout', method: 'POST' }) } }