feat:完善角色授权用户功能
This commit is contained in:
@@ -34,11 +34,5 @@ public class Startup : AppStartup
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
||||||
{
|
|
||||||
app.UseSqlsugarCodeFirstServer();
|
|
||||||
await app.UseDataSeedServer();
|
|
||||||
app.UseDataFiterServer();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
using Furion;
|
using Furion;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Newtonsoft.Json.Schema;
|
using Newtonsoft.Json.Schema;
|
||||||
|
using Yi.Framework.Infrastructure.Data;
|
||||||
|
using Yi.Framework.Infrastructure.Data.DataSeeds;
|
||||||
using Yi.Framework.Infrastructure.Sqlsugar;
|
using Yi.Framework.Infrastructure.Sqlsugar;
|
||||||
|
|
||||||
namespace Yi.Furion.Sqlsugar.Core;
|
namespace Yi.Furion.Sqlsugar.Core;
|
||||||
@@ -11,4 +15,11 @@ public class Startup : AppStartup
|
|||||||
{
|
{
|
||||||
services.AddDbSqlsugarContextServer<YiDbContext>();
|
services.AddDbSqlsugarContextServer<YiDbContext>();
|
||||||
}
|
}
|
||||||
|
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
app.UseDataFiterServer();
|
||||||
|
app.UseSqlsugarCodeFirstServer();
|
||||||
|
await app.UseDataSeedServer();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,10 +69,19 @@ public class Startup : AppStartup
|
|||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.UseInject(string.Empty);
|
app.UseInject(string.Empty);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[AppStartup(-1)]
|
||||||
|
public class EndStartup : AppStartup
|
||||||
|
{
|
||||||
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
endpoints.MapHub<OnlineUserHub>("/api/hub/main");
|
endpoints.MapHub<OnlineUserHub>("/api/hub/main");
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ function resetQuery() {
|
|||||||
}
|
}
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
userIds.value = selection.map(item => item.userId);
|
userIds.value = selection.map(item => item.id);
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
/** 打开授权用户表弹窗 */
|
/** 打开授权用户表弹窗 */
|
||||||
@@ -164,7 +164,7 @@ function cancelAuthUser(row) {
|
|||||||
/** 批量取消授权按钮操作 */
|
/** 批量取消授权按钮操作 */
|
||||||
function cancelAuthUserAll(row) {
|
function cancelAuthUserAll(row) {
|
||||||
const roleId = queryParams.roleId;
|
const roleId = queryParams.roleId;
|
||||||
const uIds = userIds.value.join(",");
|
const uIds = userIds.value;
|
||||||
proxy.$modal.confirm("是否取消选中用户授权数据项?").then(function () {
|
proxy.$modal.confirm("是否取消选中用户授权数据项?").then(function () {
|
||||||
return authUserCancelAll({ roleId: roleId, userIds: uIds });
|
return authUserCancelAll({ roleId: roleId, userIds: uIds });
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|||||||
@@ -118,14 +118,16 @@ const emit = defineEmits(["ok"]);
|
|||||||
/** 选择授权用户操作 */
|
/** 选择授权用户操作 */
|
||||||
function handleSelectUser() {
|
function handleSelectUser() {
|
||||||
const roleId = queryParams.roleId;
|
const roleId = queryParams.roleId;
|
||||||
const uIds = userIds.value.join(",");
|
|
||||||
if (uIds == "") {
|
const uIds = userIds.value;
|
||||||
|
if (uIds == []) {
|
||||||
proxy.$modal.msgError("请选择要分配的用户");
|
proxy.$modal.msgError("请选择要分配的用户");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
authUserSelectAll({ roleId: roleId, userIds: [uIds] }).then(res => {
|
|
||||||
proxy.$modal.msgSuccess("成功");
|
authUserSelectAll({ roleId: roleId, userIds:uIds }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.statusCode == 200) {
|
||||||
|
proxy.$modal.msgSuccess("成功");
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit("ok");
|
emit("ok");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user