This commit is contained in:
LYC 2025-04-24 16:05:37 +08:00
parent c7c1dded83
commit e5e12f2b63
7 changed files with 14 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# backend service base url, prod environment # backend service base url, prod environment
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default VITE_SERVICE_BASE_URL=http://localhost:8080
# other backend service base url, prod environment # other backend service base url, prod environment
VITE_OTHER_SERVICE_BASE_URL= `{ VITE_OTHER_SERVICE_BASE_URL= `{

View File

@ -1,5 +1,5 @@
# backend service base url, test environment # backend service base url, test environment
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default VITE_SERVICE_BASE_URL=http://localhost:8080/api/
# other backend service base url, test environment # other backend service base url, test environment
VITE_OTHER_SERVICE_BASE_URL= `{ VITE_OTHER_SERVICE_BASE_URL= `{

View File

@ -1,4 +1,4 @@
export const REG_USER_NAME = /^[\u4E00-\u9FA5a-zA-Z0-9_-]{4,16}$/; export const REG_USER_NAME = /^[\u4E00-\u9FA5a-zA-Z0-9_-]{2,16}$/;
/** Phone reg */ /** Phone reg */
export const REG_PHONE = export const REG_PHONE =

View File

@ -1,6 +1,6 @@
const local: App.I18n.Schema = { const local: App.I18n.Schema = {
system: { system: {
title: 'Soybean 管理系统', title: '后台管理系统',
updateTitle: '系统版本更新通知', updateTitle: '系统版本更新通知',
updateContent: '检测到系统有新版本发布,是否立即刷新页面?', updateContent: '检测到系统有新版本发布,是否立即刷新页面?',
updateConfirm: '立即刷新', updateConfirm: '立即刷新',

View File

@ -6,12 +6,12 @@ import { request } from '../request';
* @param userName User name * @param userName User name
* @param password Password * @param password Password
*/ */
export function fetchLogin(userName: string, password: string) { export function fetchLogin(username: string, password: string) {
return request<Api.Auth.LoginToken>({ return request<Api.Auth.LoginToken>({
url: '/auth/login', url: '/auth/login',
method: 'post', method: 'post',
data: { data: {
userName, username,
password password
} }
}); });

View File

@ -64,6 +64,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
startLoading(); startLoading();
const { data: loginToken, error } = await fetchLogin(userName, password); const { data: loginToken, error } = await fetchLogin(userName, password);
console.log(loginToken)
if (!error) { if (!error) {
const pass = await loginByToken(loginToken); const pass = await loginByToken(loginToken);

View File

@ -20,8 +20,8 @@ interface FormModel {
} }
const model: FormModel = reactive({ const model: FormModel = reactive({
userName: 'Soybean', userName: 't1',
password: '123456' password: '20030711'
}); });
const rules = computed<Record<keyof FormModel, App.Global.FormRule[]>>(() => { const rules = computed<Record<keyof FormModel, App.Global.FormRule[]>>(() => {
@ -43,7 +43,11 @@ async function handleSubmit() {
<template> <template>
<AForm ref="formRef" :model="model" :rules="rules" @keyup.enter="handleSubmit"> <AForm ref="formRef" :model="model" :rules="rules" @keyup.enter="handleSubmit">
<AFormItem name="userName"> <AFormItem name="userName">
<AInput v-model:value="model.userName" size="large" :placeholder="$t('page.login.common.userNamePlaceholder')" /> <AInput
v-model:value="model.userName"
size="large"
:placeholder="$t('page.login.common.userNamePlaceholder')"
/>
</AFormItem> </AFormItem>
<AFormItem name="password"> <AFormItem name="password">
<AInputPassword <AInputPassword