Merge branch 'main' into ec
This commit is contained in:
@@ -28,12 +28,16 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
private IUserService _userService;
|
private IUserService _userService;
|
||||||
private IMenuService _menuService;
|
private IMenuService _menuService;
|
||||||
private RabbitMQInvoker _rabbitMQInvoker;
|
private RabbitMQInvoker _rabbitMQInvoker;
|
||||||
public AccountController(ILogger<UserController> logger, IUserService userService, IMenuService menuService,RabbitMQInvoker rabbitMQInvoker)
|
private CacheClientDB _cacheClientDB;
|
||||||
|
private IRoleService _roleService;
|
||||||
|
public AccountController(ILogger<UserController> logger, IUserService userService, IMenuService menuService,RabbitMQInvoker rabbitMQInvoker,CacheClientDB cacheClientDB, IRoleService roleService)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_userService = userService;
|
_userService = userService;
|
||||||
_menuService = menuService;
|
_menuService = menuService;
|
||||||
_rabbitMQInvoker = rabbitMQInvoker;
|
_rabbitMQInvoker = rabbitMQInvoker;
|
||||||
|
_cacheClientDB = cacheClientDB;
|
||||||
|
_roleService = roleService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +76,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// code为验证码,判断一下,假装验证码都是对的
|
/// code为验证码,从redis中判断一下code是否正确
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="_user"></param>
|
/// <param name="_user"></param>
|
||||||
/// <param name="code"></param>
|
/// <param name="code"></param>
|
||||||
@@ -80,23 +84,57 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<Result> Register(user _user, string code)
|
public async Task<Result> Register(user _user, string code)
|
||||||
{
|
{
|
||||||
if (code != null)
|
_user.username=_user.username.Trim();
|
||||||
|
if(string.IsNullOrEmpty(_user.username))
|
||||||
|
code = code.Trim();
|
||||||
|
|
||||||
|
string trueCode= _cacheClientDB.Get<string>(RedisConst.keyCode + _user.phone);
|
||||||
|
if (code == trueCode)
|
||||||
{
|
{
|
||||||
|
//设置默认头像
|
||||||
|
var setting = JsonHelper.StrToObj<SettingDto>(_cacheClientDB.Get<string>(RedisConst.key));
|
||||||
|
_user.icon = setting.InitIcon;
|
||||||
|
//设置默认角色
|
||||||
|
if (string.IsNullOrEmpty(setting.InitRole))
|
||||||
|
{
|
||||||
|
return Result.Error("无默认角色,请初始化数据库");
|
||||||
|
}
|
||||||
|
_user.roles = new List<role>();
|
||||||
|
_user.roles.Add(await _roleService.GetEntity(u => u.role_name == setting.InitRole));
|
||||||
await _userService.Register(_user);
|
await _userService.Register(_user);
|
||||||
|
|
||||||
|
return Result.Success("恭喜,你已加入我们!");
|
||||||
}
|
}
|
||||||
return Result.Error();
|
return Result.Error("验证码有误,请重新输入!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送短信,需要将生成的sms+code存入redis
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SMSAddress"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public Result SendSMS(SMSQueueModel test)
|
public async Task<Result> SendSMS(string SMSAddress)
|
||||||
{
|
{
|
||||||
_rabbitMQInvoker.Send(new Common.IOCOptions.RabbitMQConsumerModel() { ExchangeName=RabbitConst.SMS_Exchange,QueueName=RabbitConst.SMS_Queue_Send} ,JsonHelper.ObjToStr(test));
|
SMSAddress = SMSAddress.Trim();
|
||||||
return Result.Success();
|
if (!await _userService.PhoneIsExsit(SMSAddress))
|
||||||
|
{
|
||||||
|
SMSQueueModel sMSQueueModel = new SMSQueueModel();
|
||||||
|
sMSQueueModel.phone = SMSAddress;
|
||||||
|
sMSQueueModel.code =RandomHelper.GenerateCheckCodeNum(6);
|
||||||
|
|
||||||
|
//10分钟过期
|
||||||
|
_cacheClientDB.Set(RedisConst.keyCode+sMSQueueModel.phone, sMSQueueModel.code, TimeSpan.FromMinutes(10));
|
||||||
|
|
||||||
|
_rabbitMQInvoker.Send(new Common.IOCOptions.RabbitMQConsumerModel() { ExchangeName = RabbitConst.SMS_Exchange, QueueName = RabbitConst.SMS_Queue_Send }, JsonHelper.ObjToStr(sMSQueueModel));
|
||||||
|
return Result.Success("发送短信成功,10分钟后过期,请留意短信接收");
|
||||||
|
}
|
||||||
|
return Result.Error("该号码已被注册");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。这个接口不需要洞,只需要完成userservice写mail_exist与接口即可
|
/// 发送邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="emailAddress"></param>
|
/// <param name="emailAddress"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
[HttpPut]
|
[HttpPut]
|
||||||
public Result UpdateSetting(SettingDto settingDto)
|
public Result UpdateSetting(SettingDto settingDto)
|
||||||
{
|
{
|
||||||
var setDto = Common.Helper.JsonHelper.ObjToStr<SettingDto>(settingDto);
|
var setDto = Common.Helper.JsonHelper.ObjToStr(settingDto);
|
||||||
|
|
||||||
_cacheClientDB.Set(RedisConst.key, setDto);
|
_cacheClientDB.Set(RedisConst.key, setDto);
|
||||||
return Result.Success();
|
return Result.Success();
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ namespace Yi.Framework.ApiMicroservice
|
|||||||
//redis<69><73><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
//redis<69><73><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||||
#endregion
|
#endregion
|
||||||
app.UseRedisSeedInitService(_cacheClientDB);
|
app.UseRedisSeedInitService(_cacheClientDB);
|
||||||
|
|
||||||
#region
|
#region
|
||||||
//Endpointsע<73><D7A2>
|
//Endpointsע<73><D7A2>
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -19,15 +19,22 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Register(Yi.Framework.Model.Models.user,System.String)">
|
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Register(Yi.Framework.Model.Models.user,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
code为验证码,判断一下,假装验证码都是对的
|
code为验证码,从redis中判断一下code是否正确
|
||||||
</summary>
|
</summary>
|
||||||
<param name="_user"></param>
|
<param name="_user"></param>
|
||||||
<param name="code"></param>
|
<param name="code"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.SendSMS(System.String)">
|
||||||
|
<summary>
|
||||||
|
发送短信,需要将生成的sms+code存入redis
|
||||||
|
</summary>
|
||||||
|
<param name="SMSAddress"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Email(System.String)">
|
<member name="M:Yi.Framework.ApiMicroservice.Controllers.AccountController.Email(System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
传入邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。这个接口不需要洞,只需要完成userservice写mail_exist与接口即可
|
发送邮箱,需要先到数据库判断该邮箱是否被人注册过,到userservice写mail_exist方法,还有接口别忘了。
|
||||||
</summary>
|
</summary>
|
||||||
<param name="emailAddress"></param>
|
<param name="emailAddress"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
|||||||
Binary file not shown.
@@ -13,6 +13,7 @@ namespace Yi.Framework.Common.Const
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string key = "YiFramework:data";
|
public const string key = "YiFramework:data";
|
||||||
|
|
||||||
|
public const string keyCode = "YiFramework:code";
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 初始化角色名
|
///// 初始化角色名
|
||||||
///// </summary>
|
///// </summary>
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ namespace Yi.Framework.DTOModel
|
|||||||
{
|
{
|
||||||
public class SettingDto
|
public class SettingDto
|
||||||
{
|
{
|
||||||
public string InitIcon_key { get; set; }
|
public string InitIcon { get; set; }
|
||||||
public string InitRole_key { get; set; }
|
public string InitRole { get; set; }
|
||||||
public string Title_key { get; set; }
|
public string Title { get; set; }
|
||||||
public List<string> ImageList_key { get; set; }
|
public List<string> ImageList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,13 @@ namespace Yi.Framework.Interface
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<bool> EmailIsExsit(string emailAddress);
|
Task<bool> EmailIsExsit(string emailAddress);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sms验证
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="smsAddress"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> PhoneIsExsit(string smsAddress);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通过用户id,得到该用户的所有信息,关联角色
|
/// 通过用户id,得到该用户的所有信息,关联角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,199 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Yi.Framework.Model;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(DataContext))]
|
|
||||||
[Migration("20211029124310_yi-2")]
|
|
||||||
partial class yi2
|
|
||||||
{
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
|
||||||
.HasAnnotation("ProductVersion", "5.0.11");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_show")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_top")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("menu_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("menuid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("mouldid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("roleid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("router")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("sort")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("menuid");
|
|
||||||
|
|
||||||
b.HasIndex("mouldid");
|
|
||||||
|
|
||||||
b.HasIndex("roleid");
|
|
||||||
|
|
||||||
b.ToTable("menu");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("mould_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("url")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("introduce")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("role_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("userid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("userid");
|
|
||||||
|
|
||||||
b.ToTable("role");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("address")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("age")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("email")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("introduction")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("ip")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("nick")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("password")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("phone")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("username")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("user");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.menu", null)
|
|
||||||
.WithMany("children")
|
|
||||||
.HasForeignKey("menuid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("mouldid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.role", null)
|
|
||||||
.WithMany("menus")
|
|
||||||
.HasForeignKey("roleid");
|
|
||||||
|
|
||||||
b.Navigation("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.user", null)
|
|
||||||
.WithMany("roles")
|
|
||||||
.HasForeignKey("userid");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("children");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("menus");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("roles");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
public partial class yi2 : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "menurole");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "roleuser");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "userid",
|
|
||||||
table: "role",
|
|
||||||
type: "int",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "roleid",
|
|
||||||
table: "menu",
|
|
||||||
type: "int",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_role_userid",
|
|
||||||
table: "role",
|
|
||||||
column: "userid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_menu_roleid",
|
|
||||||
table: "menu",
|
|
||||||
column: "roleid");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_menu_role_roleid",
|
|
||||||
table: "menu",
|
|
||||||
column: "roleid",
|
|
||||||
principalTable: "role",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_role_user_userid",
|
|
||||||
table: "role",
|
|
||||||
column: "userid",
|
|
||||||
principalTable: "user",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_menu_role_roleid",
|
|
||||||
table: "menu");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_role_user_userid",
|
|
||||||
table: "role");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_role_userid",
|
|
||||||
table: "role");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_menu_roleid",
|
|
||||||
table: "menu");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "userid",
|
|
||||||
table: "role");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "roleid",
|
|
||||||
table: "menu");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "menurole",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
menusid = table.Column<int>(type: "int", nullable: false),
|
|
||||||
rolesid = table.Column<int>(type: "int", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_menurole", x => new { x.menusid, x.rolesid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_menurole_menu_menusid",
|
|
||||||
column: x => x.menusid,
|
|
||||||
principalTable: "menu",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_menurole_role_rolesid",
|
|
||||||
column: x => x.rolesid,
|
|
||||||
principalTable: "role",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
})
|
|
||||||
.Annotation("MySql:CharSet", "utf8mb4");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "roleuser",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
rolesid = table.Column<int>(type: "int", nullable: false),
|
|
||||||
usersid = table.Column<int>(type: "int", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_roleuser", x => new { x.rolesid, x.usersid });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_roleuser_role_rolesid",
|
|
||||||
column: x => x.rolesid,
|
|
||||||
principalTable: "role",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_roleuser_user_usersid",
|
|
||||||
column: x => x.usersid,
|
|
||||||
principalTable: "user",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
})
|
|
||||||
.Annotation("MySql:CharSet", "utf8mb4");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_menurole_rolesid",
|
|
||||||
table: "menurole",
|
|
||||||
column: "rolesid");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_roleuser_usersid",
|
|
||||||
table: "roleuser",
|
|
||||||
column: "usersid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Yi.Framework.Model;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(DataContext))]
|
|
||||||
[Migration("20211030074708_yi-3")]
|
|
||||||
partial class yi3
|
|
||||||
{
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
|
||||||
.HasAnnotation("ProductVersion", "5.0.11");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_show")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_top")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("menu_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("menuid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("mouldid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("roleid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("router")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("sort")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("menuid");
|
|
||||||
|
|
||||||
b.HasIndex("mouldid");
|
|
||||||
|
|
||||||
b.HasIndex("roleid");
|
|
||||||
|
|
||||||
b.ToTable("menu");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("mould_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("url")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("introduce")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("role_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("userid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("userid");
|
|
||||||
|
|
||||||
b.ToTable("role");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("address")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("age")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("email")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("introduction")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("ip")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("nick")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("password")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("phone")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("username")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("user");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.menu", null)
|
|
||||||
.WithMany("children")
|
|
||||||
.HasForeignKey("menuid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("mouldid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.role", null)
|
|
||||||
.WithMany("menus")
|
|
||||||
.HasForeignKey("roleid");
|
|
||||||
|
|
||||||
b.Navigation("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.user", null)
|
|
||||||
.WithMany("roles")
|
|
||||||
.HasForeignKey("userid");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("children");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("menus");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("roles");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
public partial class yi3 : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Yi.Framework.Model;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(DataContext))]
|
|
||||||
[Migration("20211030074922_yi-5")]
|
|
||||||
partial class yi5
|
|
||||||
{
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
|
||||||
.HasAnnotation("ProductVersion", "5.0.11");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_show")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_top")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("menu_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("menuid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("mouldid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int?>("roleid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("router")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("sort")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("menuid");
|
|
||||||
|
|
||||||
b.HasIndex("mouldid");
|
|
||||||
|
|
||||||
b.HasIndex("roleid");
|
|
||||||
|
|
||||||
b.ToTable("menu");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("mould_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("url")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("introduce")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("role_name")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("userid")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("userid");
|
|
||||||
|
|
||||||
b.ToTable("role");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("address")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("age")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("email")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("icon")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("introduction")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("ip")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("nick")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("password")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<int?>("phone")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("username")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("user");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("is_delete")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<int>("num")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<DateTime>("time")
|
|
||||||
.HasColumnType("datetime(6)");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("visit");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.menu", null)
|
|
||||||
.WithMany("children")
|
|
||||||
.HasForeignKey("menuid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("mouldid");
|
|
||||||
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.role", null)
|
|
||||||
.WithMany("menus")
|
|
||||||
.HasForeignKey("roleid");
|
|
||||||
|
|
||||||
b.Navigation("mould");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Yi.Framework.Model.Models.user", null)
|
|
||||||
.WithMany("roles")
|
|
||||||
.HasForeignKey("userid");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("children");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("menus");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("roles");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
|
||||||
{
|
|
||||||
public partial class yi5 : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "visit",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
||||||
time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
||||||
num = table.Column<int>(type: "int", nullable: false),
|
|
||||||
is_delete = table.Column<int>(type: "int", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_visit", x => x.id);
|
|
||||||
})
|
|
||||||
.Annotation("MySql:CharSet", "utf8mb4");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "visit");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,7 @@ using Yi.Framework.Model;
|
|||||||
namespace Yi.Framework.Model.Migrations
|
namespace Yi.Framework.Model.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DataContext))]
|
[DbContext(typeof(DataContext))]
|
||||||
[Migration("20211022181627_yi-1")]
|
[Migration("20211106082100_yi-1")]
|
||||||
partial class yi1
|
partial class yi1
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -134,8 +134,8 @@ namespace Yi.Framework.Model.Migrations
|
|||||||
b.Property<string>("password")
|
b.Property<string>("password")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
b.Property<int?>("phone")
|
b.Property<string>("phone")
|
||||||
.HasColumnType("int");
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
b.Property<string>("username")
|
b.Property<string>("username")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
@@ -145,6 +145,26 @@ namespace Yi.Framework.Model.Migrations
|
|||||||
b.ToTable("user");
|
b.ToTable("user");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("is_delete")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("num")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("time")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.HasKey("id");
|
||||||
|
|
||||||
|
b.ToTable("visit");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("menurole", b =>
|
modelBuilder.Entity("menurole", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("menusid")
|
b.Property<int>("menusid")
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
namespace Yi.Framework.Model.Migrations
|
namespace Yi.Framework.Model.Migrations
|
||||||
@@ -69,7 +70,8 @@ namespace Yi.Framework.Model.Migrations
|
|||||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
address = table.Column<string>(type: "longtext", nullable: true)
|
address = table.Column<string>(type: "longtext", nullable: true)
|
||||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
phone = table.Column<int>(type: "int", nullable: true),
|
phone = table.Column<string>(type: "longtext", nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
is_delete = table.Column<int>(type: "int", nullable: false)
|
is_delete = table.Column<int>(type: "int", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
@@ -78,6 +80,22 @@ namespace Yi.Framework.Model.Migrations
|
|||||||
})
|
})
|
||||||
.Annotation("MySql:CharSet", "utf8mb4");
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "visit",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||||
|
num = table.Column<int>(type: "int", nullable: false),
|
||||||
|
is_delete = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_visit", x => x.id);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "menu",
|
name: "menu",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -194,6 +212,9 @@ namespace Yi.Framework.Model.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "roleuser");
|
name: "roleuser");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "visit");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "menu");
|
name: "menu");
|
||||||
|
|
||||||
@@ -15,6 +15,9 @@ namespace Yi.Framework.Model.Models
|
|||||||
|
|
||||||
|
|
||||||
public List<menu> children { get; set; }
|
public List<menu> children { get; set; }
|
||||||
|
|
||||||
|
public List<role> roles { get; set; }
|
||||||
|
|
||||||
public mould mould { get; set; }
|
public mould mould { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ namespace Yi.Framework.Model.Models
|
|||||||
|
|
||||||
|
|
||||||
public List<menu> menus { get; set; }
|
public List<menu> menus { get; set; }
|
||||||
|
public List<user> users { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Yi.Framework.Model.Models
|
|||||||
public int? age { get; set; }
|
public int? age { get; set; }
|
||||||
public string introduction { get; set; }
|
public string introduction { get; set; }
|
||||||
public string address { get; set; }
|
public string address { get; set; }
|
||||||
public int? phone { get; set; }
|
public string phone { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public List<role> roles { get; set; }
|
public List<role> roles { get; set; }
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Yi.Framework.SMSProcessor
|
|||||||
{
|
{
|
||||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||||
_logger.LogInformation($"Worker appsetting ConsulClientOption:Ip={this._IConfiguration["ConsulClientOption:Ip"]}");
|
_logger.LogInformation($"Worker appsetting ConsulClientOption:Ip={this._IConfiguration["ConsulClientOption:Ip"]}");
|
||||||
await Task.Delay(1000, stoppingToken);
|
await Task.Delay(100000, stoppingToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ namespace Yi.Framework.Service
|
|||||||
{
|
{
|
||||||
var role_data = await _Db.Set<role>().Include(u=>u.menus).Where(u => u.id == roleId).FirstOrDefaultAsync();
|
var role_data = await _Db.Set<role>().Include(u=>u.menus).Where(u => u.id == roleId).FirstOrDefaultAsync();
|
||||||
var menuList = role_data.menus.Where(u => u.is_delete == Normal).ToList();
|
var menuList = role_data.menus.Where(u => u.is_delete == Normal).ToList();
|
||||||
|
|
||||||
|
menuList.ForEach(u => u.roles = null);
|
||||||
|
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,22 +15,25 @@ namespace Yi.Framework.Service
|
|||||||
{
|
{
|
||||||
public partial class UserService : BaseService<user>, IUserService
|
public partial class UserService : BaseService<user>, IUserService
|
||||||
{
|
{
|
||||||
private IRoleService _roleService;
|
|
||||||
short Normal = (short)Common.Enum.DelFlagEnum.Normal;
|
short Normal = (short)Common.Enum.DelFlagEnum.Normal;
|
||||||
public UserService(IDbContextFactory DbFactory, IRoleService roleService) : base(DbFactory)
|
public async Task<bool> PhoneIsExsit(string smsAddress)
|
||||||
{
|
{
|
||||||
_roleService = roleService;
|
var userList = await GetEntity(u => u.phone == smsAddress);
|
||||||
|
if (userList == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> EmailIsExsit(string emailAddress)
|
public async Task<bool> EmailIsExsit(string emailAddress)
|
||||||
{
|
{
|
||||||
var userList = await GetAllEntitiesTrueAsync();
|
var userList = await GetEntity(u => u.email == emailAddress);
|
||||||
var is_email = userList.Where(u => u.email == emailAddress).FirstOrDefault();
|
if (userList == null)
|
||||||
if (is_email == null)
|
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@@ -48,9 +51,10 @@ namespace Yi.Framework.Service
|
|||||||
List<menu> menuList = new();
|
List<menu> menuList = new();
|
||||||
foreach(var item in user_data.roles)
|
foreach(var item in user_data.roles)
|
||||||
{
|
{
|
||||||
var m=item.menus.Where(u => u.router.ToUpper() == router.ToUpper()).FirstOrDefault();
|
var m=item.menus.Where(u =>u?.router?.ToUpper() == router.ToUpper()).FirstOrDefault();
|
||||||
menuList= m.children.Where(u => menuIds.Contains(u.id)&&u.is_delete==Normal).ToList();
|
if (m == null) { break; }
|
||||||
if (m != null) { break; }
|
menuList = m.children?.Where(u => menuIds.Contains(u.id)&&u.is_delete==Normal).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
@@ -63,7 +67,12 @@ namespace Yi.Framework.Service
|
|||||||
}
|
}
|
||||||
public async Task<user> GetUserInRolesByHttpUser(int userId)
|
public async Task<user> GetUserInRolesByHttpUser(int userId)
|
||||||
{
|
{
|
||||||
return await GetUserById(userId);
|
var data = await GetUserById(userId);
|
||||||
|
data.roles?.ForEach(u=> {
|
||||||
|
u.users = null;
|
||||||
|
u.menus = null;
|
||||||
|
});
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<user> Login(user _user)
|
public async Task<user> Login(user _user)
|
||||||
@@ -79,7 +88,7 @@ namespace Yi.Framework.Service
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return await AddAsync(_user);
|
return await UpdateAsync(_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> SetRoleByUser(List<int> roleIds, List<int> userIds)
|
public async Task<bool> SetRoleByUser(List<int> roleIds, List<int> userIds)
|
||||||
@@ -89,5 +98,7 @@ namespace Yi.Framework.Service
|
|||||||
user_data.ForEach(u => u.roles = roleList);
|
user_data.ForEach(u => u.roles = roleList);
|
||||||
return await UpdateListAsync(user_data);
|
return await UpdateListAsync(user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
{
|
{
|
||||||
public async static Task SeedAsync(IDbContextFactory _DbFactory)
|
public async static Task SeedAsync(IDbContextFactory _DbFactory)
|
||||||
{
|
{
|
||||||
var _Db= _DbFactory.ConnWriteOrRead(Common.Enum.WriteAndReadEnum.Write);
|
var _Db = _DbFactory.ConnWriteOrRead(Common.Enum.WriteAndReadEnum.Write);
|
||||||
if (!_Db.Set<user>().Any())
|
if (!_Db.Set<user>().Any())
|
||||||
{
|
{
|
||||||
await _Db.Set<user>().AddAsync(new user
|
await _Db.Set<user>().AddAsync(new user
|
||||||
@@ -22,18 +22,28 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
password = "123",
|
password = "123",
|
||||||
roles = new List<role>()
|
roles = new List<role>()
|
||||||
{
|
{
|
||||||
|
new role(){ role_name="普通用户"},
|
||||||
|
|
||||||
new role()
|
new role()
|
||||||
{
|
{
|
||||||
role_name="管理员",
|
role_name="管理员",
|
||||||
menus = new List<menu>()
|
menus = new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="用户角色管理",is_show=1,is_top=1, children=new List<menu>()
|
menu_name="根",is_show=1,is_top=1, children=new List<menu>(){
|
||||||
|
new menu()
|
||||||
|
{
|
||||||
|
menu_name="首页",is_show=1,router="/"
|
||||||
|
},
|
||||||
|
|
||||||
|
new menu()
|
||||||
|
{
|
||||||
|
menu_name="用户角色管理",is_show=1, children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="用户管理",router="/AdmUser", is_show=1,children=new List<menu>()
|
menu_name="用户管理",router="/AdmUser/", is_show=1,children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
@@ -64,14 +74,14 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
menu_name="add",is_show=0,
|
menu_name="add",is_show=0,
|
||||||
mould=new mould()
|
mould=new mould()
|
||||||
{
|
{
|
||||||
mould_name="del",url="/user/adduser"
|
mould_name="add",url="/user/adduser"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="角色管理",router="/admrole", is_show=1,children=new List<menu>()
|
menu_name="角色管理",router="/admrole/", is_show=1,children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
@@ -102,21 +112,21 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
menu_name="add",is_show=0,
|
menu_name="add",is_show=0,
|
||||||
mould=new mould()
|
mould=new mould()
|
||||||
{
|
{
|
||||||
mould_name="del",url="/role/addroler"
|
mould_name="add",url="/role/addrole"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="角色接口管理",is_show=1, is_top=1,children=new List<menu>()
|
menu_name="角色接口管理",is_show=1, children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="菜单管理",router="/AdmMenu", is_show=1,children=new List<menu>()
|
menu_name="菜单管理",router="/AdmMenu/", is_show=1,children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
@@ -147,14 +157,14 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
menu_name="add",is_show=0,
|
menu_name="add",is_show=0,
|
||||||
mould=new mould()
|
mould=new mould()
|
||||||
{
|
{
|
||||||
mould_name="del",url="/Menu/addMenu"
|
mould_name="add",url="/Menu/addMenu"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="接口管理",router="/admMould", is_show=1,children=new List<menu>()
|
menu_name="接口管理",router="/admMould/", is_show=1,children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
@@ -192,23 +202,49 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
},
|
},
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="角色菜单分配管理",router="/admRoleMenu", is_show=1, children=null
|
menu_name="角色菜单分配管理",router="/admRoleMenu/", is_show=1, children=null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="路由管理",is_show=1,is_top=1,children=new List<menu>()
|
menu_name="路由管理",is_show=1,children=new List<menu>()
|
||||||
{
|
{
|
||||||
new menu()
|
new menu()
|
||||||
{
|
{
|
||||||
menu_name="用户信息",router="/userinfo", is_show=1,children=null
|
menu_name="用户信息",router="/userinfo/", is_show=1,children=null
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ namespace Yi.Framework.WebCore.Init
|
|||||||
{
|
{
|
||||||
var setDto = Common.Helper.JsonHelper.ObjToStr(new SettingDto()
|
var setDto = Common.Helper.JsonHelper.ObjToStr(new SettingDto()
|
||||||
{
|
{
|
||||||
ImageList_key =new List<string> { "默认图片", "默认图片" },
|
ImageList =new List<string> { "默认图片", "默认图片" },
|
||||||
InitRole_key = "普通用户",
|
InitRole = "普通用户",
|
||||||
Title_key = "YiFramework",
|
Title = "YiFramework",
|
||||||
InitIcon_key = "默认头像"
|
InitIcon = "默认头像"
|
||||||
});
|
});
|
||||||
if (_cacheClientDB.Get<SettingDto>(RedisConst.key)==null)
|
if (_cacheClientDB.Get<SettingDto>(RedisConst.key)==null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
register(username, password, email, code) {
|
register(username, password, phone, code) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: `/Account/register?code=${code}`,
|
url: `/Account/register?code=${code}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: { username, password, email }
|
data: { username, password, phone }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
email(emailAddress) {
|
email(emailAddress) {
|
||||||
@@ -29,6 +29,12 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
SendSMS(smsAddress) {
|
||||||
|
return myaxios({
|
||||||
|
url: `/Account/SendSMS?SMSAddress=${smsAddress}`,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
},
|
||||||
changePassword(user, newPassword) {
|
changePassword(user, newPassword) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: `/Account/changePassword`,
|
url: `/Account/changePassword`,
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
<!-- title -->
|
<!-- title -->
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<p class="text-2xl font-weight-semibold text--primary mb-2">
|
<p class="text-2xl font-weight-semibold text--primary mb-1">
|
||||||
注册-从这里开始 🚀
|
注册-从这里开始 🚀
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-2">加入我们,获得一个有趣的灵魂!</p>
|
<p class="mb-1">加入我们,获得一个有趣的灵魂!</p>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<!-- login form -->
|
<!-- login form -->
|
||||||
@@ -31,30 +31,42 @@
|
|||||||
v-model="form.username"
|
v-model="form.username"
|
||||||
outlined
|
outlined
|
||||||
label="用户名"
|
label="用户名"
|
||||||
placeholder="JohnDoe"
|
placeholder="cc"
|
||||||
|
class="mb-1"
|
||||||
class="mb-3"
|
|
||||||
counter="20"
|
counter="20"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.email"
|
v-model="form.phone"
|
||||||
outlined
|
outlined
|
||||||
label="邮箱"
|
label="电话"
|
||||||
placeholder="john@example.com"
|
placeholder="12345678901"
|
||||||
|
class="mb-1"
|
||||||
class="mb-3"
|
>
|
||||||
></v-text-field>
|
</v-text-field>
|
||||||
|
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="9">
|
||||||
|
<v-text-field
|
||||||
|
v-model="code"
|
||||||
|
outlined
|
||||||
|
label="验证码"
|
||||||
|
placeholder="123456"
|
||||||
|
class="mb-1"
|
||||||
|
>
|
||||||
|
</v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="3">
|
||||||
|
<app-btn @click="sendSMS" class="mb-1 mt-1">验证码</app-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
outlined
|
outlined
|
||||||
:type="isPasswordVisible ? 'text' : 'password'"
|
:type="isPasswordVisible ? 'text' : 'password'"
|
||||||
label="密码"
|
label="密码"
|
||||||
placeholder="············"
|
placeholder="············"
|
||||||
:append-icon="
|
:append-icon="isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'"
|
||||||
isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'
|
|
||||||
"
|
|
||||||
@click:append="isPasswordVisible = !isPasswordVisible"
|
@click:append="isPasswordVisible = !isPasswordVisible"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
|
||||||
@@ -67,7 +79,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-checkbox>
|
</v-checkbox>
|
||||||
|
|
||||||
<v-btn block color="primary" class="mt-6"> 注册 </v-btn>
|
<v-btn block color="primary" class="mt-6" @click="register">
|
||||||
|
注册
|
||||||
|
</v-btn>
|
||||||
</v-form>
|
</v-form>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
@@ -86,53 +100,79 @@
|
|||||||
|
|
||||||
<!-- social link -->
|
<!-- social link -->
|
||||||
<v-card-actions class="d-flex justify-center">
|
<v-card-actions class="d-flex justify-center">
|
||||||
<v-btn
|
<v-btn v-for="link in socialLink" :key="link.icon" icon class="ms-1">
|
||||||
v-for="link in socialLink"
|
<v-icon :color="$vuetify.theme.dark ? link.colorInDark : link.color">
|
||||||
:key="link.icon"
|
{{ link.icon }}
|
||||||
icon
|
</v-icon>
|
||||||
class="ms-1"
|
</v-btn>
|
||||||
>
|
</v-card-actions>
|
||||||
<v-icon :color="$vuetify.theme.dark ? link.colorInDark:link.color">
|
|
||||||
{{ link.icon }}
|
|
||||||
</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import accoutAPI from "../api/accountApi";
|
||||||
export default {
|
export default {
|
||||||
|
methods: {
|
||||||
|
sendSMS() {
|
||||||
|
accoutAPI.SendSMS(this.form.phone).then(resp=>{
|
||||||
|
if (resp.status) {
|
||||||
|
this.$dialog.notify.success(resp.msg, {
|
||||||
|
position: "top-right",
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
register() {
|
||||||
|
accoutAPI
|
||||||
|
.register(
|
||||||
|
this.form.username,
|
||||||
|
this.form.password,
|
||||||
|
this.form.phone,
|
||||||
|
this.code
|
||||||
|
)
|
||||||
|
.then((resp) => {
|
||||||
|
if (resp.status) {
|
||||||
|
this.$dialog.notify.success(resp.msg, {
|
||||||
|
position: "top-right",
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
this.$router.push("/login/");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
socialLink:[
|
socialLink: [
|
||||||
{
|
{
|
||||||
icon: 'mdi-qqchat',
|
icon: "mdi-qqchat",
|
||||||
color: '#8D5EE0',
|
color: "#8D5EE0",
|
||||||
colorInDark: '#8D5EE0',
|
colorInDark: "#8D5EE0",
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'mdi-facebook',
|
|
||||||
color: '#4267b2',
|
|
||||||
colorInDark: '#4267b2',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'mdi-twitter',
|
icon: "mdi-facebook",
|
||||||
color: '#1da1f2',
|
color: "#4267b2",
|
||||||
colorInDark: '#1da1f2',
|
colorInDark: "#4267b2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'mdi-github',
|
icon: "mdi-twitter",
|
||||||
color: '#272727',
|
color: "#1da1f2",
|
||||||
colorInDark: '#fff',
|
colorInDark: "#1da1f2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: 'mdi-google',
|
icon: "mdi-github",
|
||||||
color: '#db4437',
|
color: "#272727",
|
||||||
colorInDark: '#db4437',
|
colorInDark: "#fff",
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
|
icon: "mdi-google",
|
||||||
|
color: "#db4437",
|
||||||
|
colorInDark: "#db4437",
|
||||||
|
},
|
||||||
|
],
|
||||||
isPasswordVisible: false,
|
isPasswordVisible: false,
|
||||||
|
code: "",
|
||||||
form: {
|
form: {
|
||||||
email: "",
|
phone: "",
|
||||||
username: "",
|
username: "",
|
||||||
password: "",
|
password: "",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user