feat: 代理登录/注册改图形数字验证码(SVG无GD依赖、一次性校验);后台内容区全屏铺满
This commit is contained in:
1 parent
423ac0d3b5
commit
d5a3183895
10 files changed
+272
-71
No files matched your search
@@ -11,12 +11,11 @@ export const useUserStore = defineStore('user', () => {
|
||||
* @param {string} account 用户名或邮箱
|
||||
* @param {string} password 密码
|
||||
* @param {'admin'|'agent'} portal 登录入口
|
||||
* @param {string} turnstileToken Turnstile 人机验证 token
|
||||
* @param {object} extra 附加参数(admin: {turnstile_token} / agent: {captcha_code})
|
||||
*/
|
||||
async function login(account, password, portal = 'admin', turnstileToken = '') {
|
||||
async function login(account, password, portal = 'admin', extra = {}) {
|
||||
const endpoint = portal === 'agent' ? '/auth/agent-login' : '/auth/admin-login'
|
||||
const body = { username: account, password }
|
||||
if (turnstileToken) body.turnstile_token = turnstileToken
|
||||
const body = { username: account, password, ...(extra || {}) }
|
||||
const res = await request.post(endpoint, body)
|
||||
user.value = res.data.user
|
||||
token.value = res.data.token.access_token
|
||||
|
||||
Reference in new issue
Block a user