From 5458819ef5171c77d0ea47eaa6badc4074e04ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 28 Mar 2023 22:23:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.BBS.Vue3/src/apis/accountApi.js | 11 ++- Yi.BBS.Vue3/src/stores/user.js | 19 +++- Yi.BBS.Vue3/src/views/Login.vue | 7 +- Yi.BBS.Vue3/src/views/Register.vue | 36 +++++--- .../Extensions/SqlsugarExtensions.cs | 2 +- .../SqlSugarDbContext.cs | 2 +- .../project/BBS/Yi.BBS.Web/appsettings.json | 6 +- .../project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db | Bin 352256 -> 352256 bytes .../project/bbs/Yi.BBS.Web/appsettings.json | 6 +- .../project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db | Bin 352256 -> 352256 bytes .../Dtos/Account/PhoneCaptchaImageDto.cs | 13 +++ .../Identity/Dtos/Account/RegisterDto.cs | 39 ++++++++ .../Identity/IUserService.cs | 1 - ...i.RBAC.Application.ContractsSwaggerDoc.xml | 25 ++++++ .../Identity/AccountService.cs | 83 +++++++++++++++++- .../Yi.RBAC.ApplicationSwaggerDoc.xml | 13 +++ .../Identity/ConstClasses/UserConst.cs | 4 + .../Yi.RBAC.Domain/DataSeeds/RoleDataSeed.cs | 25 ++++++ .../Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs | 21 +++++ .../Identity/Entities/UserEntity.cs | 14 +++ 20 files changed, 299 insertions(+), 28 deletions(-) create mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/Account/PhoneCaptchaImageDto.cs create mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/Account/RegisterDto.cs diff --git a/Yi.BBS.Vue3/src/apis/accountApi.js b/Yi.BBS.Vue3/src/apis/accountApi.js index 0cd9f8ec..227aacc6 100644 --- a/Yi.BBS.Vue3/src/apis/accountApi.js +++ b/Yi.BBS.Vue3/src/apis/accountApi.js @@ -19,9 +19,16 @@ export function login(username, password, code, uuid) { } // 注册方法 - export function register(data) { + export function register(userName,password,phone,code,uuid) { + const data = { + userName, + password, + phone, + code, + uuid + } return request({ - url: '/register', + url: '/account/register', headers: { isToken: false }, diff --git a/Yi.BBS.Vue3/src/stores/user.js b/Yi.BBS.Vue3/src/stores/user.js index a75f6902..ea55f132 100644 --- a/Yi.BBS.Vue3/src/stores/user.js +++ b/Yi.BBS.Vue3/src/stores/user.js @@ -1,4 +1,4 @@ -import { login, logout, getInfo } from '@/apis/accountApi' +import { login, logout, getInfo,register } from '@/apis/accountApi' import { getToken, setToken, removeToken } from '@/utils/auth' import { defineStore } from 'pinia' const useUserStore = defineStore('user', @@ -75,7 +75,22 @@ const useUserStore = defineStore('user', reject(error) }) }) - } + }, + // 注册 + register(userInfo) { + const userName = userInfo.userName.trim() + const password = userInfo.password.trim() + const phone = userInfo.phone; + const uuid = userInfo.uuid; + const code=userInfo.code; + return new Promise((resolve, reject) => { + register(userName,password,phone,code,uuid).then(response => { + resolve(response); + }).catch(error => { + reject(error) + }) + }) + }, }, }) diff --git a/Yi.BBS.Vue3/src/views/Login.vue b/Yi.BBS.Vue3/src/views/Login.vue index d3784214..36f3a692 100644 --- a/Yi.BBS.Vue3/src/views/Login.vue +++ b/Yi.BBS.Vue3/src/views/Login.vue @@ -3,24 +3,27 @@

{{configStore.name}}-登录

- 使用邮箱或者手机号 + 使用账号或者手机号
密码
+ + 没有账号?前往注册
- 没有账号?前往注册 +
其他方式登录
+
diff --git a/Yi.BBS.Vue3/src/views/Register.vue b/Yi.BBS.Vue3/src/views/Register.vue index d7c8bc79..7d93f1bd 100644 --- a/Yi.BBS.Vue3/src/views/Register.vue +++ b/Yi.BBS.Vue3/src/views/Register.vue @@ -4,17 +4,21 @@
@@ -32,7 +36,7 @@