Merge branch 'refs/heads/abp' into digital-collectibles
# Conflicts: # Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
{
|
||||
public string Phone { get; set; }
|
||||
|
||||
public string? Uuid { get; set; }
|
||||
public string Uuid { get; set; }
|
||||
|
||||
public string? Code { get; set; }
|
||||
public string Code { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Lazy.Captcha.Core.Generator;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.BackgroundWorkers;
|
||||
using Volo.Abp.BackgroundWorkers.Quartz;
|
||||
@@ -24,7 +25,11 @@ namespace Yi.Framework.Rbac.Application
|
||||
{
|
||||
var service = context.Services;
|
||||
|
||||
service.AddCaptcha();
|
||||
service.AddCaptcha(options =>
|
||||
{
|
||||
options.CaptchaType = CaptchaType.ARITHMETIC;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
||||
|
||||
@@ -33,7 +33,6 @@ using Yi.Framework.Bbs.Application;
|
||||
using Yi.Framework.Bbs.Application.Extensions;
|
||||
using Yi.Framework.ChatHub.Application;
|
||||
using Yi.Framework.CodeGen.Application;
|
||||
using Yi.Framework.DigitalCollectibles.Application;
|
||||
using Yi.Framework.Rbac.Application;
|
||||
using Yi.Framework.Rbac.Domain.Authorization;
|
||||
using Yi.Framework.Rbac.Domain.Shared.Consts;
|
||||
@@ -67,10 +66,10 @@ namespace Yi.Abp.Web
|
||||
//请求日志
|
||||
Configure<AbpAuditingOptions>(optios =>
|
||||
{
|
||||
//开启后会有大量的审计日志
|
||||
//默认关闭,开启会有大量的审计日志
|
||||
optios.IsEnabled = true;
|
||||
//审计日志过滤器
|
||||
optios.AlwaysLogSelectors.Add(x => Task.FromResult(true));
|
||||
optios.AlwaysLogSelectors.Add(x => Task.FromResult(!x.Url.StartsWith("/api/app/file/")));
|
||||
});
|
||||
|
||||
//采用furion格式的规范化api,默认不开启,使用abp优雅的方式
|
||||
@@ -95,8 +94,7 @@ namespace Yi.Abp.Web
|
||||
options => options.RemoteServiceName = "tenant-management");
|
||||
options.ConventionalControllers.Create(typeof(YiFrameworkCodeGenApplicationModule).Assembly,
|
||||
options => options.RemoteServiceName = "code-gen");
|
||||
options.ConventionalControllers.Create(typeof(YiFrameworkDigitalCollectiblesApplicationModule).Assembly,
|
||||
options => options.RemoteServiceName = "digital-collectibles");
|
||||
|
||||
//统一前缀
|
||||
options.ConventionalControllers.ConventionalControllerSettings.ForEach(x => x.RootPath = "api/app");
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ export function getCodeImg() {
|
||||
});
|
||||
}
|
||||
// 获取短信验证码
|
||||
export function getCodePhone(phone) {
|
||||
export function getCodePhone(phoneForm) {
|
||||
return request({
|
||||
url: "/account/captcha-phone",
|
||||
headers: {
|
||||
@@ -91,11 +91,11 @@ export function getCodePhone(phone) {
|
||||
},
|
||||
method: "post",
|
||||
timeout: 20000,
|
||||
data: { phone },
|
||||
data: phoneForm,
|
||||
});
|
||||
}
|
||||
// 获取短信验证码-为了重置密码
|
||||
export function getCodePhoneForRetrievePassword(phone) {
|
||||
export function getCodePhoneForRetrievePassword(form) {
|
||||
return request({
|
||||
url: "/account/captcha-phone/repassword",
|
||||
headers: {
|
||||
@@ -103,6 +103,6 @@ export function getCodePhoneForRetrievePassword(phone) {
|
||||
},
|
||||
method: "post",
|
||||
timeout: 20000,
|
||||
data: { phone },
|
||||
data: form,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
<script setup>
|
||||
|
||||
// 注册逻辑
|
||||
import {reactive, ref} from "vue";
|
||||
import {computed, reactive, ref} from "vue";
|
||||
import {getCodePhoneForRetrievePassword} from "@/apis/accountApi";
|
||||
import useAuths from "@/hooks/useAuths";
|
||||
import { useRouter} from "vue-router";
|
||||
const { retrievePasswordFun } = useAuths();
|
||||
const router = useRouter();
|
||||
import useUserStore from "@/stores/user";
|
||||
const retrievePasswordFormRef = ref();
|
||||
//验证码弹窗
|
||||
const codeDialogVisible=ref(false);
|
||||
|
||||
|
||||
// 获取图片验证码
|
||||
const codeImageURL = computed(() => useUserStore().codeImageURL);
|
||||
const codeUUid = computed(() => useUserStore().codeUUid);
|
||||
// 确认密码
|
||||
const passwordConfirm = ref("");
|
||||
const registerForm = reactive({
|
||||
@@ -18,6 +23,11 @@ const registerForm = reactive({
|
||||
uuid: "",
|
||||
code: ""
|
||||
});
|
||||
const phoneForm=reactive({
|
||||
code:"",
|
||||
phone:"",
|
||||
uuid:codeUUid
|
||||
});
|
||||
const registerRules = reactive({
|
||||
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入验证码", trigger: "blur" }],
|
||||
@@ -56,14 +66,38 @@ const retrievePassword = async (formEl) => {
|
||||
const codeInfo = ref("发送短信");
|
||||
const isDisabledCode = ref(false);
|
||||
|
||||
//点击验证码
|
||||
const handleGetCodeImage=()=>{
|
||||
useUserStore().updateCodeImage();
|
||||
}
|
||||
|
||||
//点击手机发送短信
|
||||
const clickPhoneCaptcha=()=>{
|
||||
if (registerForm.phone !== "")
|
||||
{
|
||||
handleGetCodeImage();
|
||||
codeDialogVisible.value=true;
|
||||
}
|
||||
else {
|
||||
ElMessage({
|
||||
message: `请先输入手机号`,
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//前往登录
|
||||
const handleSignInNow=()=>{
|
||||
router.push("/login");
|
||||
}
|
||||
const captcha = async () => {
|
||||
if (registerForm.phone !== "") {
|
||||
const { data } = await getCodePhoneForRetrievePassword(registerForm.phone);
|
||||
if (registerForm.phone!==""&&phoneForm.code!=="")
|
||||
{
|
||||
phoneForm.phone=registerForm.phone;
|
||||
const { data } = await getCodePhoneForRetrievePassword(phoneForm);
|
||||
registerForm.uuid = data.uuid;
|
||||
codeDialogVisible.value=false;
|
||||
ElMessage({
|
||||
message: `已向${registerForm.phone}发送验证码,请注意查收`,
|
||||
type: "success",
|
||||
@@ -113,7 +147,7 @@ const captcha = async () => {
|
||||
<el-form-item prop="phone">
|
||||
<div class="phone-code">
|
||||
<input class="phone-code-input" type="text" v-model.trim="registerForm.phone">
|
||||
<button type="button" class="phone-code-btn" @click="captcha()">{{codeInfo}}</button>
|
||||
<button type="button" class="phone-code-btn" @click="clickPhoneCaptcha()">{{codeInfo}}</button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -146,8 +180,41 @@ const captcha = async () => {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="codeDialogVisible"
|
||||
title="发送短信"
|
||||
width="500"
|
||||
center
|
||||
>
|
||||
<div class="dialog-body">
|
||||
<img class="code-img" alt="加载中" @click="handleGetCodeImage" :src="codeImageURL">
|
||||
|
||||
<div class="input">
|
||||
<p>*图片验证码</p>
|
||||
<el-form-item prop="code" >
|
||||
<input type="text" v-model.trim="phoneForm.code">
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<button @click="captcha" style="width:80% " type="button" class="phone-code-btn">确认发送</button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style src="@/assets/styles/login.css" scoped>
|
||||
</style>
|
||||
<style scoped>
|
||||
.dialog-body
|
||||
{
|
||||
display: flex !important;
|
||||
justify-content: center !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.code-img{
|
||||
margin: 25px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +1,21 @@
|
||||
<script setup>
|
||||
|
||||
// 注册逻辑
|
||||
import {reactive, ref} from "vue";
|
||||
import {computed, reactive, ref} from "vue";
|
||||
import {getCodePhone} from "@/apis/accountApi";
|
||||
import useAuths from "@/hooks/useAuths";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import useUserStore from "@/stores/user";
|
||||
const { registerFun } = useAuths();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const registerFormRef = ref();
|
||||
//验证码弹窗
|
||||
const codeDialogVisible=ref(false);
|
||||
|
||||
|
||||
// 获取图片验证码
|
||||
const codeImageURL = computed(() => useUserStore().codeImageURL);
|
||||
const codeUUid = computed(() => useUserStore().codeUUid);
|
||||
// 确认密码
|
||||
const passwordConfirm = ref("");
|
||||
const registerForm = reactive({
|
||||
@@ -21,6 +26,11 @@ const registerForm = reactive({
|
||||
code: "",
|
||||
nick:""
|
||||
});
|
||||
const phoneForm=reactive({
|
||||
code:"",
|
||||
phone:"",
|
||||
uuid:codeUUid
|
||||
});
|
||||
const registerRules = reactive({
|
||||
nick: [
|
||||
{ min: 2, message: "昵称需大于两位", trigger: "blur" },
|
||||
@@ -65,14 +75,37 @@ const register = async (formEl) => {
|
||||
const codeInfo = ref("发送短信");
|
||||
const isDisabledCode = ref(false);
|
||||
|
||||
//点击验证码
|
||||
const handleGetCodeImage=()=>{
|
||||
useUserStore().updateCodeImage();
|
||||
}
|
||||
|
||||
//点击手机发送短信
|
||||
const clickPhoneCaptcha=()=>{
|
||||
if (registerForm.phone !== "")
|
||||
{
|
||||
handleGetCodeImage();
|
||||
codeDialogVisible.value=true;
|
||||
}
|
||||
else {
|
||||
ElMessage({
|
||||
message: `请先输入手机号`,
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//前往登录
|
||||
const handleSignInNow=()=>{
|
||||
router.push("/login");
|
||||
}
|
||||
const captcha = async () => {
|
||||
if (registerForm.phone !== "") {
|
||||
const { data } = await getCodePhone(registerForm.phone);
|
||||
if (registerForm.phone!==""&&phoneForm.code!=="")
|
||||
{
|
||||
phoneForm.phone=registerForm.phone;
|
||||
const { data } = await getCodePhone(phoneForm);
|
||||
registerForm.uuid = data.uuid;
|
||||
codeDialogVisible.value=false;
|
||||
ElMessage({
|
||||
message: `已向${registerForm.phone}发送验证码,请注意查收`,
|
||||
type: "success",
|
||||
@@ -90,12 +123,15 @@ const captcha = async () => {
|
||||
time--;
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ElMessage({
|
||||
message: `请先输入手机号`,
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -138,7 +174,7 @@ const captcha = async () => {
|
||||
<el-form-item prop="phone">
|
||||
<div class="phone-code">
|
||||
<input class="phone-code-input" type="text" v-model.trim="registerForm.phone">
|
||||
<button type="button" class="phone-code-btn" @click="captcha()">{{codeInfo}}</button>
|
||||
<button type="button" class="phone-code-btn" @click="clickPhoneCaptcha()">{{codeInfo}}</button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@@ -171,8 +207,43 @@ const captcha = async () => {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="codeDialogVisible"
|
||||
title="发送短信"
|
||||
width="500"
|
||||
center
|
||||
>
|
||||
<div class="dialog-body">
|
||||
<img class="code-img" alt="加载中" @click="handleGetCodeImage" :src="codeImageURL">
|
||||
|
||||
<div class="input">
|
||||
<p>*图片验证码</p>
|
||||
<el-form-item prop="code" >
|
||||
<input type="text" v-model.trim="phoneForm.code">
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<button @click="captcha" style="width:80% " type="button" class="phone-code-btn">确认发送</button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style src="@/assets/styles/login.css" scoped>
|
||||
|
||||
</style>
|
||||
<style scoped>
|
||||
.dialog-body
|
||||
{
|
||||
display: flex !important;
|
||||
justify-content: center !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.code-img{
|
||||
margin: 25px !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user