fix:修复bug
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
VITE_APP_BASEAPI="/api-dev"
|
VITE_APP_BASEAPI="/api-dev"
|
||||||
VITE_APP_URL="http://localhost:19003/api"
|
VITE_APP_URL="http://localhost:19001/api"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VITE_APP_BASEAPI="/prod-api"
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<title>意社区</title>
|
<title>意社区</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ const router = createRouter({
|
|||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('../views/Login.vue')
|
component: () => import('../views/Login.vue')
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// name:'register',
|
name:'register',
|
||||||
// path: '/register',
|
path: '/register',
|
||||||
// component: () => import('../views/Register.vue')
|
component: () => import('../views/Register.vue')
|
||||||
// },
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
<button class="login-btn" @click="login">登 录</button>
|
<button class="login-btn" @click="login">登 录</button>
|
||||||
<button class="login-btn" @click="guestlogin">游客临时登录</button>
|
<button class="login-btn" @click="guestlogin">游客临时登录</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<RouterLink to="/register"> 没有账号?前往注册</RouterLink>
|
||||||
|
|
||||||
<div class="divider">
|
<div class="divider">
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="divider-text">其他方式登录</span>
|
<span class="divider-text">其他方式登录</span>
|
||||||
|
|||||||
67
Yi.BBS.Vue3/src/views/Register.vue
Normal file
67
Yi.BBS.Vue3/src/views/Register.vue
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div class="login-wrapper">
|
||||||
|
<h1>{{configStore.name}}-注册</h1>
|
||||||
|
<div class="login-form">
|
||||||
|
<div class="username form-item">
|
||||||
|
<span>登录账号</span>
|
||||||
|
<input type="text" class="input-item" v-model="loginForm.userName">
|
||||||
|
</div>
|
||||||
|
<div class="username form-item">
|
||||||
|
<span>手机号</span>
|
||||||
|
<input type="text" class="input-item" v-model="loginForm.userName">
|
||||||
|
</div>
|
||||||
|
<div class="password form-item">
|
||||||
|
<span>密码</span>
|
||||||
|
<input type="password" class="input-item" v-model="loginForm.password">
|
||||||
|
</div>
|
||||||
|
<button class="login-btn" @click="login">注册</button>
|
||||||
|
</div>
|
||||||
|
<div class="divider">
|
||||||
|
<span class="line"></span>
|
||||||
|
<span class="divider-text">其他方式注册</span>
|
||||||
|
<span class="line"></span>
|
||||||
|
</div>
|
||||||
|
<div class="other-login-wrapper">
|
||||||
|
<div class="other-login-item">
|
||||||
|
<img src="@/assets/login_images/QQ.png" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="other-login-item">
|
||||||
|
<img src="@/assets/login_images/WeChat.png" alt="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { reactive } from 'vue';
|
||||||
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
|
import useUserStore from '@/stores/user.js'
|
||||||
|
import useConfigStore from "@/stores/config";
|
||||||
|
const configStore= useConfigStore();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
const loginForm = reactive({
|
||||||
|
userName: "",
|
||||||
|
password: "",
|
||||||
|
uuid: "",
|
||||||
|
code: ""
|
||||||
|
})
|
||||||
|
|
||||||
|
const login = async () => {
|
||||||
|
const response = await userStore.login(loginForm).catch((e) => {
|
||||||
|
loginForm.password = "";
|
||||||
|
});
|
||||||
|
if (response!=undefined) {
|
||||||
|
ElMessage({
|
||||||
|
message: `您好${loginForm.userName},登录成功!`,
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
|
||||||
|
const redirect = route.query?.redirect ?? '/index'
|
||||||
|
router.push(redirect)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style src="@/assets/styles/login.scss" scoped></style>
|
||||||
@@ -27,7 +27,7 @@ namespace Yi.Framework.Core.Sqlsugar.Extensions
|
|||||||
//使用上下文对象
|
//使用上下文对象
|
||||||
public static void AddDbSqlsugarContextServer(this IServiceCollection services)
|
public static void AddDbSqlsugarContextServer(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton<ISqlSugarClient>(x => x.GetRequiredService<SqlSugarDbContext>().SqlSugarClient);
|
services.AddTransient<ISqlSugarClient>(x => x.GetRequiredService<SqlSugarDbContext>().SqlSugarClient);
|
||||||
services.AddSingleton<SqlSugarDbContext>();
|
services.AddSingleton<SqlSugarDbContext>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,11 +131,11 @@ namespace Yi.Framework.Core.Sqlsugar
|
|||||||
db.Aop.OnLogExecuting = (s, p) =>
|
db.Aop.OnLogExecuting = (s, p) =>
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.Append("执行SQL:" + s.ToString());
|
//sb.Append("执行SQL:" + s.ToString());
|
||||||
foreach (var i in p)
|
//foreach (var i in p)
|
||||||
{
|
//{
|
||||||
sb.Append($"\r\n参数:{i.ParameterName},参数值:{i.Value}");
|
// sb.Append($"\r\n参数:{i.ParameterName},参数值:{i.Value}");
|
||||||
}
|
//}
|
||||||
sb.Append($"\r\n 完整SQL:{UtilMethods.GetSqlString(DbType.MySql, s, p)}");
|
sb.Append($"\r\n 完整SQL:{UtilMethods.GetSqlString(DbType.MySql, s, p)}");
|
||||||
logger?.LogDebug(sb.ToString());
|
logger?.LogDebug(sb.ToString());
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Yi.BBS.Domain.DataSeed
|
|||||||
|
|
||||||
public override async Task<bool> IsInvoker()
|
public override async Task<bool> IsInvoker()
|
||||||
{
|
{
|
||||||
return !await _repository.IsAnyAsync(x => x.ConfigKey == "ConfigEntity");
|
return !await _repository.IsAnyAsync(x => x.ConfigKey == "bbs.site.name");
|
||||||
}
|
}
|
||||||
public override List<ConfigEntity> GetSeedData()
|
public override List<ConfigEntity> GetSeedData()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Yi.BBS.Domain
|
|||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||||
{
|
{
|
||||||
//services.AddTransient<StudentManager>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"applicationUrl": "http://localhost:19003",
|
"applicationUrl": "http://localhost:19001",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Update="appsettings.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Update="nlog.config">
|
<Content Update="nlog.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
|
|
||||||
//程序启动地址,*代表全部网口
|
//程序启动地址,*代表全部网口
|
||||||
"StartUrl": "http://*:19003",
|
"StartUrl": "http://*:19001",
|
||||||
|
|
||||||
//数据库类型列表
|
//数据库类型列表
|
||||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||||
|
|
||||||
"DbConnOptions": {
|
"DbConnOptions": {
|
||||||
//"Url": "DataSource=yi-sqlsugar-dev.db",
|
"Url": "DataSource=yi-sqlsugar-dev.db",
|
||||||
"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.",
|
//"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.",
|
||||||
"DbType": "Mysql",
|
"DbType": "Sqlite",
|
||||||
"EnabledDbSeed": true,
|
"EnabledDbSeed": true,
|
||||||
"EnabledReadWrite": false,
|
"EnabledReadWrite": false,
|
||||||
"EnabledCodeFirst": true,
|
"EnabledCodeFirst": true,
|
||||||
|
|||||||
Binary file not shown.
@@ -19,7 +19,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos.Discuss
|
|||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
public string? Color { get; set; }
|
public string? Color { get; set; }
|
||||||
|
|
||||||
public long plateId { get; set; }
|
public long PlateId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 默认公开
|
/// 默认公开
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Yi.BBS.Application.Forum
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override async Task<DiscussGetOutputDto> CreateAsync(DiscussCreateInputVo input)
|
public override async Task<DiscussGetOutputDto> CreateAsync(DiscussCreateInputVo input)
|
||||||
{
|
{
|
||||||
if (!await _plateEntityRepository.IsAnyAsync(x => x.Id == input.plateId))
|
if (!await _plateEntityRepository.IsAnyAsync(x => x.Id == input.PlateId))
|
||||||
{
|
{
|
||||||
throw new UserFriendlyException(PlateConst.板块不存在);
|
throw new UserFriendlyException(PlateConst.板块不存在);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace Yi.BBS.Domain.DataSeed
|
|||||||
|
|
||||||
public override async Task<bool> IsInvoker()
|
public override async Task<bool> IsInvoker()
|
||||||
{
|
{
|
||||||
return !await _repository.IsAnyAsync(x => x.ConfigKey == "ConfigEntity");
|
return !await _repository.IsAnyAsync(x => x.ConfigKey == "bbs.site.name");
|
||||||
}
|
}
|
||||||
public override List<ConfigEntity> GetSeedData()
|
public override List<ConfigEntity> GetSeedData()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,6 +60,6 @@ namespace Yi.BBS.Domain.Forum.Entities
|
|||||||
/// 当PermissionType为部分用户时候,以下列表中的用户+创建者 代表拥有权限
|
/// 当PermissionType为部分用户时候,以下列表中的用户+创建者 代表拥有权限
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsJson = true)]//使用json处理
|
[SugarColumn(IsJson = true)]//使用json处理
|
||||||
public List<long> PermissionUserIds { get; set; }
|
public List<long>? PermissionUserIds { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Yi.BBS.Domain
|
|||||||
|
|
||||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||||
{
|
{
|
||||||
//services.AddTransient<StudentManager>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"applicationUrl": "http://localhost:19003",
|
"applicationUrl": "http://localhost:19001",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Update="appsettings.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Update="nlog.config">
|
<Content Update="nlog.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
|
|
||||||
//程序启动地址,*代表全部网口
|
//程序启动地址,*代表全部网口
|
||||||
"StartUrl": "http://*:19003",
|
"StartUrl": "http://*:19001",
|
||||||
|
|
||||||
//数据库类型列表
|
//数据库类型列表
|
||||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||||
|
|
||||||
"DbConnOptions": {
|
"DbConnOptions": {
|
||||||
//"Url": "DataSource=yi-sqlsugar-dev.db",
|
"Url": "DataSource=yi-sqlsugar-dev.db",
|
||||||
"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.",
|
//"Url": "server=106.52.94.217;port=3306;database=yi-bbs-dev;user id=root;password=Qz52013142020.",
|
||||||
"DbType": "Mysql",
|
"DbType": "Sqlite",
|
||||||
"EnabledDbSeed": true,
|
"EnabledDbSeed": true,
|
||||||
"EnabledReadWrite": false,
|
"EnabledReadWrite": false,
|
||||||
"EnabledCodeFirst": true,
|
"EnabledCodeFirst": true,
|
||||||
|
|||||||
Binary file not shown.
@@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
|
|||||||
VITE_APP_BASE_WS = '/dev-ws'
|
VITE_APP_BASE_WS = '/dev-ws'
|
||||||
|
|
||||||
#BBS
|
#BBS
|
||||||
VITE_APP_BASE_URL='http://localhost:19003/api'
|
VITE_APP_BASE_URL='http://localhost:19001/api'
|
||||||
|
|
||||||
#RBAC
|
#RBAC
|
||||||
# VITE_APP_BASE_URL='http://localhost:19001/api'
|
# VITE_APP_BASE_URL='http://localhost:19001/api'
|
||||||
|
|||||||
Reference in New Issue
Block a user