添加登录注册业务
This commit is contained in:
Binary file not shown.
@@ -4,5 +4,59 @@
|
||||
<name>Yi.Framework.ApiMicroservice</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1">
|
||||
<summary>
|
||||
6666
|
||||
</summary>
|
||||
<typeparam name="T"></typeparam>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.#ctor(Microsoft.Extensions.Logging.ILogger{`0},Yi.Framework.Repository.IRepository{`0})">
|
||||
<summary>
|
||||
jb
|
||||
</summary>
|
||||
<param name="logger"></param>
|
||||
<param name="iRepository"></param>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Get(System.Object)">
|
||||
<summary>
|
||||
主键查询
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.GetList">
|
||||
<summary>
|
||||
列表查询
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Page(Yi.Framework.Model.Query.QueryCondition)">
|
||||
<summary>
|
||||
条件分页查询
|
||||
</summary>
|
||||
<param name="queryCondition"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Add(`0)">
|
||||
<summary>
|
||||
添加
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.Update(`0)">
|
||||
<summary>
|
||||
修改
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Framework.ApiMicroservice.Controllers.BaseCrudController`1.DeleteList(System.Object[])">
|
||||
<summary>
|
||||
列表删除
|
||||
</summary>
|
||||
<param name="ids"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.DTOModel;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.WebCore;
|
||||
using Yi.Framework.WebCore.AttributeExtend;
|
||||
using Yi.Framework.WebCore.AuthorizationPolicy;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class AccountController :ControllerBase
|
||||
{
|
||||
private IUserService _iUserService;
|
||||
public AccountController(ILogger<UserEntity> logger, IUserService iUserService)
|
||||
{
|
||||
_iUserService = iUserService;
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public async Task<Result> Login(LoginDto loginDto)
|
||||
{
|
||||
UserEntity user=new();
|
||||
if (await _iUserService.Login(loginDto.UserName, loginDto.Password,o=> user=o))
|
||||
{
|
||||
return Result.Success("登录成功!").SetData(user);
|
||||
}
|
||||
return Result.SuccessError("登录失败!用户名或者密码错误!");
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost]
|
||||
public async Task<Result> Register(RegisterDto registerDto)
|
||||
{
|
||||
UserEntity user = new();
|
||||
if (await _iUserService.Register(WebCore.Mapper.MapperHelper.Map<UserEntity, RegisterDto>(registerDto), o => user = o))
|
||||
{
|
||||
return Result.Success("注册成功!").SetData(user);
|
||||
}
|
||||
return Result.SuccessError("注册失败!用户名已存在!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,48 +6,92 @@ using Yi.Framework.WebCore.AttributeExtend;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 6666
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class BaseCrudController<T> : ControllerBase where T : class,new()
|
||||
{
|
||||
private readonly ILogger<T> _logger;
|
||||
public IRepository<T> _iRepository;
|
||||
/// <summary>
|
||||
/// jb
|
||||
/// </summary>
|
||||
/// <param name="logger"></param>
|
||||
/// <param name="iRepository"></param>
|
||||
public BaseCrudController(ILogger<T> logger, IRepository<T> iRepository)
|
||||
{
|
||||
_logger = logger;
|
||||
_iRepository = iRepository;
|
||||
}
|
||||
[Permission($"{nameof(T)}:Get:One")]
|
||||
|
||||
/// <summary>
|
||||
/// 主键查询
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:get:one")]
|
||||
[HttpGet]
|
||||
public async Task<Result> Get(object id)
|
||||
{
|
||||
return Result.Success().SetData(await _iRepository.GetByIdAsync(id));
|
||||
}
|
||||
[Permission($"{nameof(T)}:Get:List")]
|
||||
|
||||
/// <summary>
|
||||
/// 列表查询
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:get:list")]
|
||||
[HttpGet]
|
||||
public async Task<Result> GetList()
|
||||
{
|
||||
return Result.Success().SetData(await _iRepository.GetListAsync());
|
||||
}
|
||||
[Permission($"{nameof(T)}:Get:Page")]
|
||||
|
||||
/// <summary>
|
||||
/// 条件分页查询
|
||||
/// </summary>
|
||||
/// <param name="queryCondition"></param>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:get:page")]
|
||||
[HttpPost]
|
||||
public async Task<Result> Page(QueryCondition queryCondition)
|
||||
{
|
||||
return Result.Success().SetData(await _iRepository.CommonPage(queryCondition));
|
||||
}
|
||||
[Permission($"{nameof(T)}:Add")]
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:add")]
|
||||
[HttpPost]
|
||||
public async Task<Result> Add(T entity)
|
||||
{
|
||||
return Result.Success().SetData(await _iRepository.InsertReturnEntityAsync(entity));
|
||||
}
|
||||
[Permission($"{nameof(T)}:Update")]
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:update")]
|
||||
[HttpPut]
|
||||
public async Task<Result> Update(T entity)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iRepository.UpdateAsync(entity));
|
||||
}
|
||||
[Permission($"{nameof(T)}:Delete:List")]
|
||||
|
||||
/// <summary>
|
||||
/// 列表删除
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[Permission($"{nameof(T)}:delete:list")]
|
||||
[HttpDelete]
|
||||
public async Task<Result> DeleteList(object[] ids)
|
||||
{
|
||||
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.WebCore;
|
||||
using Yi.Framework.WebCore.AttributeExtend;
|
||||
using Yi.Framework.WebCore.AuthorizationPolicy;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class TenantController : BaseCrudController<TenantEntity>
|
||||
{
|
||||
public TenantController(ILogger<TenantEntity> logger, ITenantService iTenantService) : base(logger, iTenantService)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,12 +22,5 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
public UserController(ILogger<UserEntity> logger, IUserService iUserService) : base(logger, iUserService)
|
||||
{
|
||||
}
|
||||
[HttpGet]
|
||||
[Permission("user:query:list")]
|
||||
public async Task<Result> PermissionTest()
|
||||
{
|
||||
return Result.Success().SetData( await _iRepository.GetListAsync());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"StartUrl": "http://localohost:19001",
|
||||
"StartUrl": "http://*:19001",
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"apollo": {
|
||||
"AppId": "ApiMicroservice",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://119.91.207.67:18080",
|
||||
"ConfigServer": [ "http://119.91.207.67:18080" ]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
@@ -7,63 +8,68 @@ namespace Yi.Framework.Common.Helper
|
||||
public class MD5Helper
|
||||
{
|
||||
/// <summary>
|
||||
/// 16位MD5加密
|
||||
/// 生成PasswordSalt
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
public static string MD5Encrypt16(string password)
|
||||
/// <returns>返回string</returns>
|
||||
public static string GenerateSalt()
|
||||
{
|
||||
byte[] buf = new byte[16];
|
||||
#pragma warning disable SYSLIB0023 // 类型或成员已过时
|
||||
(new RNGCryptoServiceProvider()).GetBytes(buf);
|
||||
#pragma warning restore SYSLIB0023 // 类型或成员已过时
|
||||
return Convert.ToBase64String(buf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加密密码
|
||||
/// </summary>
|
||||
/// <param name="pass">密码</param>
|
||||
/// <param name="passwordFormat">加密类型</param>
|
||||
/// <param name="salt">PasswordSalt</param>
|
||||
/// <returns>加密后的密码</returns>
|
||||
public static string SHA2Encode(string pass, string salt, int passwordFormat = 1)
|
||||
{
|
||||
if (passwordFormat == 0) // MembershipPasswordFormat.Clear
|
||||
return pass;
|
||||
|
||||
byte[] bIn = Encoding.Unicode.GetBytes(pass);
|
||||
byte[] bSalt = Convert.FromBase64String(salt);
|
||||
byte[] bAll = new byte[bSalt.Length + bIn.Length];
|
||||
byte[] bRet = null;
|
||||
|
||||
Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length);
|
||||
Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length);
|
||||
|
||||
#pragma warning disable SYSLIB0021 // 类型或成员已过时
|
||||
var md5 = new MD5CryptoServiceProvider();
|
||||
var s = SHA512Managed.Create();
|
||||
#pragma warning restore SYSLIB0021 // 类型或成员已过时
|
||||
string t2 = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(password)), 4, 8);
|
||||
t2 = t2.Replace("-", string.Empty);
|
||||
return t2;
|
||||
}
|
||||
bRet = s.ComputeHash(bAll);
|
||||
|
||||
/// <summary>
|
||||
/// 32位MD5加密
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
public static string MD5Encrypt32(string password = "")
|
||||
return ConvertEx.ToUrlBase64String(bRet);
|
||||
}
|
||||
}
|
||||
public class ConvertEx
|
||||
{
|
||||
static readonly char[] padding = { '=' };
|
||||
public static string ToUrlBase64String(byte[] inArray)
|
||||
{
|
||||
string pwd = string.Empty;
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(password) && !string.IsNullOrWhiteSpace(password))
|
||||
{
|
||||
MD5 md5 = MD5.Create(); //实例化一个md5对像
|
||||
// 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择
|
||||
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(password));
|
||||
// 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得
|
||||
foreach (var item in s)
|
||||
{
|
||||
// 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母,如果使用大写(X)则格式后的字符是大写字符
|
||||
pwd = string.Concat(pwd, item.ToString("X2"));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new Exception($"错误的 password 字符串:【{password}】");
|
||||
}
|
||||
return pwd;
|
||||
var str = Convert.ToBase64String(inArray);
|
||||
str = str.TrimEnd(padding).Replace('+', '-').Replace('/', '_');
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 64位MD5加密
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
public static string MD5Encrypt64(string password)
|
||||
public static byte[] FromUrlBase64String(string s)
|
||||
{
|
||||
// 实例化一个md5对像
|
||||
// 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择
|
||||
MD5 md5 = MD5.Create();
|
||||
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(password));
|
||||
return Convert.ToBase64String(s);
|
||||
}
|
||||
string incoming = s.Replace('_', '/').Replace('-', '+');
|
||||
switch (s.Length % 4)
|
||||
{
|
||||
case 2: incoming += "=="; break;
|
||||
case 3: incoming += "="; break;
|
||||
}
|
||||
byte[] bytes = Convert.FromBase64String(incoming);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Common.Models
|
||||
{
|
||||
public class AxiosUrlsModel
|
||||
{
|
||||
public string get { get; set; }
|
||||
public string update { get; set; }
|
||||
public string del { get; set; }
|
||||
public string add { get; set; }
|
||||
}
|
||||
}
|
||||
14
Yi.Framework.Net6/Yi.Framework.DTOModel/LoginDto.cs
Normal file
14
Yi.Framework.Net6/Yi.Framework.DTOModel/LoginDto.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DTOModel
|
||||
{
|
||||
public class LoginDto
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
16
Yi.Framework.Net6/Yi.Framework.DTOModel/RegisterDto.cs
Normal file
16
Yi.Framework.Net6/Yi.Framework.DTOModel/RegisterDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.DTOModel
|
||||
{
|
||||
public class RegisterDto
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"Consul_Enabled": false,
|
||||
"DbSeed_Enabled": true,
|
||||
"Apollo_Enabled": false,
|
||||
"HealthCheck_Enabled": false,
|
||||
"Cors_Enabled": true,
|
||||
"RabbitMQ_Enabled": true,
|
||||
"Redis_Enabled": true,
|
||||
"RedisSeed_Enabled": true,
|
||||
"Kafka_Enabled": false,
|
||||
"ElasticSeach_Enabled": false,
|
||||
"MutiDB_Enabled": false,
|
||||
"SMS_Enabled": true,
|
||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||
"DbSelect": "Mysql",
|
||||
|
||||
"DbConn": {
|
||||
"WriteUrl": "server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.",
|
||||
"ReadUrl": [
|
||||
"server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.",
|
||||
"server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020.",
|
||||
"server=118.195.191.41;port=3306;database=YIDB;user id=root;password=Qz52013142020."
|
||||
]
|
||||
},
|
||||
"JWTTokenOptions": {
|
||||
"Audience": "http://localhost:7000",
|
||||
"Issuer": "http://localhost:7000",
|
||||
"SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB"
|
||||
},
|
||||
"RedisConnOptions": {
|
||||
"Host": "118.195.191.41",
|
||||
"Prot": 6379,
|
||||
"DB": 1,
|
||||
"Password": "Qz52013142020."
|
||||
},
|
||||
"RabbitConn": {
|
||||
"HostName": "118.195.191.41",
|
||||
"UserName": "cc",
|
||||
"Password": "cc",
|
||||
"Port": 5672
|
||||
},
|
||||
"ElasticSeachConn": {
|
||||
"Url": "",
|
||||
"IndexName": ""
|
||||
},
|
||||
"KafkaOptions": {
|
||||
"BrokerList": "192.168.3.230:9092",
|
||||
"TopicName": "kafkalog"
|
||||
},
|
||||
"ConsulClientOption": {
|
||||
"IP": "118.195.191.41",
|
||||
"Port": "8500",
|
||||
"Datacenter": "dc1"
|
||||
},
|
||||
"ConsulRegisterOption": {
|
||||
"IP": "183.216.18.15",
|
||||
"Port": "44329",
|
||||
"GroupName": "ApiMicroservice",
|
||||
"HealthCheckUrl": "/Health",
|
||||
"Interval": 10,
|
||||
"Timeout": 5,
|
||||
"DeregisterCriticalServiceAfter": 60,
|
||||
"Tag": "13"
|
||||
},
|
||||
"SMS": {
|
||||
"ID": "LTAI5tJvjPaXCyyPMfXLNbVA",
|
||||
"Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn",
|
||||
"Sign": "JiftCC",
|
||||
"Template": "SMS_221640732"
|
||||
},
|
||||
"IPLibraryServiceUrl": "http://gRPCIPLibraryService"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Apollo": {
|
||||
"AppId": "Yi.Framework.ApiMicroservice",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://192.168.2.168:8080",
|
||||
"ConfigServer": [ "http://192.168.2.168:8080" ]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface ITenantService: IRepository<TenantEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
using Yi.Framework.Model.Models;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public partial interface IUserService
|
||||
{
|
||||
{
|
||||
public Task<bool> Login(string userName, string password, Action<UserEntity> userAction = null);
|
||||
public Task<bool> Register(UserEntity userEntity, Action<UserEntity> userAction = null);
|
||||
}
|
||||
}
|
||||
|
||||
45
Yi.Framework.Net6/Yi.Framework.Model/Models/TenantEntity.cs
Normal file
45
Yi.Framework.Net6/Yi.Framework.Model/Models/TenantEntity.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户表
|
||||
///</summary>
|
||||
[SugarTable("Tenant")]
|
||||
public partial class TenantEntity
|
||||
{
|
||||
public TenantEntity()
|
||||
{
|
||||
this.Id=Guid.NewGuid();
|
||||
this.IsDeleted=false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
/// <summary>
|
||||
/// 1
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Id" ,IsPrimaryKey = true )]
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateUser" )]
|
||||
public Guid? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="CreateTime" )]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyTime" )]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="IsDeleted" )]
|
||||
public bool? IsDeleted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ namespace Yi.Framework.Model.Models
|
||||
public partial class UserEntity
|
||||
{
|
||||
public UserEntity()
|
||||
{
|
||||
this.Id = Guid.NewGuid();
|
||||
{
|
||||
this.Id=Guid.NewGuid();
|
||||
this.IsDeleted=false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
@@ -61,5 +61,20 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public Guid? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 账户
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="UserName" )]
|
||||
public string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// 密码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Password" )]
|
||||
public string Password { get; set; }
|
||||
/// <summary>
|
||||
/// 加密盐值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Salt" )]
|
||||
public string Salt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Apollo": {
|
||||
"AppId": "Yi.Framework.OcelotGateway",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://192.168.2.168:8080",
|
||||
"ConfigServer": [ "http://192.168.2.168:8080" ]
|
||||
},
|
||||
"JWTTokenOptions": {
|
||||
"Audience": "http://localhost:7000",
|
||||
"Issuer": "http://localhost:7000",
|
||||
"SecurityKey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI2a2EJ7m872v0afyoSDJT2o1+SitIeJSWtLJU8/Wz2m7gStexajkeD+Lka6DSTy8gt9UwfgVQo6uKjVLG5Ex7PiGOODVqAEghBuS7JzIYU5RvI543nNDAPfnJsas96mSA7L/mD7RTE2drj6hf3oZjJpMPZUQI/B1Qjb5H3K3PNwIDAQAB"
|
||||
}
|
||||
}
|
||||
432
Yi.Framework.Net6/Yi.Framework.OcelotGateway/configuration.json
Normal file
432
Yi.Framework.Net6/Yi.Framework.OcelotGateway/configuration.json
Normal file
@@ -0,0 +1,432 @@
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>+Consul********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "UpstreamPathTemplate": "/T/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "UseServiceDiscovery": true,
|
||||
// "ServiceName": "ZhaoxiService", //consul<75><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "LoadBalancerOptions": {
|
||||
// "Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// "GlobalConfiguration": {
|
||||
// "BaseUrl": "http://127.0.0.1:6299", //<2F><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
// "ServiceDiscoveryProvider": {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 8089,
|
||||
// "Type": "Consul" //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥconsul
|
||||
// } //Ocelotû<74><C3BB>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>Consul
|
||||
|
||||
// //,"ServiceDiscoveryProvider": {
|
||||
// // "Host": "localhost",
|
||||
// // "Port": 8500,
|
||||
// // "Type": "PollConsul", //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
// // "PollingInterval": 1000 //<2F><>ѯconsul,Ƶ<>ʺ<EFBFBD><CABA><EFBFBD>--down<77><6E><EFBFBD>Dz<EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>
|
||||
// // //"Token": "footoken"//<2F><>ҪACL<43>Ļ<EFBFBD>
|
||||
// //}
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
//*****************************Ocelot+Consul********************************
|
||||
{
|
||||
"Routes": [
|
||||
{
|
||||
"UpstreamPathTemplate": "api/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--<2D><><EFBFBD><EFBFBD>
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "PATCH", "Delete", "Options" ],
|
||||
"UseServiceDiscovery": true,
|
||||
"ServiceName": "ApiMicroservice",
|
||||
"LoadBalancerOptions": {
|
||||
"Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
},
|
||||
"DownstreamPathTemplate": "api/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
"DownstreamScheme": "https",
|
||||
"DownstreamHeaderTransform": {
|
||||
"Access-Control-Allow-Origin": "*", //<2F><><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD>
|
||||
"Access-Control-Allow-Methods": "*",
|
||||
"Access-Control-Allow-Headers": "*"
|
||||
}
|
||||
},
|
||||
{
|
||||
"UpstreamPathTemplate": "api/item/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--<2D><><EFBFBD><EFBFBD>
|
||||
"UpstreamHttpMethod": [ "Get", "Post", "Put", "PATCH", "Delete", "Options" ],
|
||||
"UseServiceDiscovery": true,
|
||||
"ServiceName": "PageDetail",
|
||||
"LoadBalancerOptions": {
|
||||
"Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
},
|
||||
"DownstreamPathTemplate": "api/item/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
"DownstreamScheme": "https",
|
||||
"DownstreamHeaderTransform": {
|
||||
"Access-Control-Allow-Origin": "*", //<2F><><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD>
|
||||
"Access-Control-Allow-Methods": "*",
|
||||
"Access-Control-Allow-Headers": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"GlobalConfiguration": {
|
||||
"BaseUrl": "http://127.0.0.1:7200", //<2F><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
"ServiceDiscoveryProvider": {
|
||||
"Host": "192.168.2.128",
|
||||
"Port": 8500,
|
||||
"Type": "Consul" //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥconsul
|
||||
},
|
||||
"RateLimitOptions": {
|
||||
"QuotaExceededMessage": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD>ԣ<EFBFBD>", // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>ض<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
||||
"HttpStatusCode": 666 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>ض<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ص<EFBFBD>http status
|
||||
//"ClientIdHeader": "client_id" // <20><><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>ͻ<EFBFBD><CDBB>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD> ClientId
|
||||
}
|
||||
|
||||
//,"ServiceDiscoveryProvider": {
|
||||
// "Host": "localhost",
|
||||
// "Port": 8500,
|
||||
// "Type": "PollConsul", //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
// "PollingInterval": 1000 //<2F><>ѯconsul,Ƶ<>ʺ<EFBFBD><CABA><EFBFBD>--down<77><6E><EFBFBD>Dz<EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>
|
||||
// //"Token": "footoken"//<2F><>ҪACL<43>Ļ<EFBFBD>
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַ--<2D><>Consul********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "UpstreamPathTemplate": "/api/auth/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--<2D><><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post", "Put", "PATCH", "Delete", "Options" ],
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 7200 //<2F><><EFBFBD><EFBFBD>api <20>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHeaderTransform": {
|
||||
// "Access-Control-Allow-Origin": "*", //<2F><><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "Access-Control-Allow-Methods": "*",
|
||||
// "Access-Control-Allow-Headers": "*"
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַȫƥ<C8AB><C6A5>********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5726 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD> //<2F><>ͻ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>Լ<EFBFBD>Ȩ<EFBFBD><C8A8>Priority
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ]
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʵ<EFBFBD><CAB5>********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5726 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5726/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ]
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5727 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5727/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ]
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5728 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5728/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ]
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
//////MVC<56><43>·<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>ǽ<EFBFBD>ˮ¥̨<C2A5>ȵ<EFBFBD><C8B5><EFBFBD>--
|
||||
////*****************************·<>ɳ<EFBFBD>ͻ+<2B><>Ȩƥ<C8A8><C6A5>********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5726 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD> //<2F><>ͻ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>Լ<EFBFBD>Ȩ<EFBFBD><C8A8>Priority
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "Priority": 0 //Ĭ<><C4AC><EFBFBD><EFBFBD>0 <20>Ӹ<EFBFBD>1
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/users/get?id={id}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5727 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/api/users/get/{id}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD> //<2F><>ͻ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>Լ<EFBFBD>Ȩ<EFBFBD><C8A8>Priority
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "Priority": 1 //Ĭ<><C4AC><EFBFBD><EFBFBD>0 <20>Ӹ<EFBFBD>1
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/users/{url}?id={id}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5728 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/api/users/{url}/{id}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD> //<2F><>ͻ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>Լ<EFBFBD>Ȩ<EFBFBD><C8A8>Priority
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "Priority": 2 //Ĭ<><C4AC><EFBFBD><EFBFBD>0 <20>Ӹ<EFBFBD>1
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 5726
|
||||
// }, //Ocelot<6F><74><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 5727
|
||||
// },
|
||||
// {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 5728
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD> //<2F><>ͻ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>Լ<EFBFBD>Ȩ<EFBFBD><C8A8>Priority
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "LoadBalancerOptions": {
|
||||
// "Type": "RoundRobin" //<2F><>ѯ //"LeastConnection" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> "NoLoadBalance" //<2F><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD> //"CookieStickySessions" //<2F>Ựճ<E1BBB0><D5B3> //
|
||||
// }
|
||||
// //"LoadBalancerOptions": {
|
||||
// // "Type": "CookieStickySessions",
|
||||
// // "Key": "ASP.NET_SessionId",
|
||||
// // "Expiry": 1800000
|
||||
// //}
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>+Consul********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "UpstreamPathTemplate": "/T/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "UseServiceDiscovery": true,
|
||||
// "ServiceName": "ZhaoxiService", //consul<75><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "LoadBalancerOptions": {
|
||||
// "Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// "GlobalConfiguration": {
|
||||
// "BaseUrl": "http://127.0.0.1:6299", //<2F><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
// "ServiceDiscoveryProvider": {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 8089,
|
||||
// "Type": "Consul" //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥconsul
|
||||
// } //Ocelotû<74><C3BB>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>Consul
|
||||
|
||||
// //,"ServiceDiscoveryProvider": {
|
||||
// // "Host": "localhost",
|
||||
// // "Port": 8500,
|
||||
// // "Type": "PollConsul", //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
// // "PollingInterval": 1000 //<2F><>ѯconsul,Ƶ<>ʺ<EFBFBD><CABA><EFBFBD>--down<77><6E><EFBFBD>Dz<EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>
|
||||
// // //"Token": "footoken"//<2F><>ҪACL<43>Ļ<EFBFBD>
|
||||
// //}
|
||||
// }
|
||||
//}
|
||||
|
||||
////*****************************Consul+<2B><><EFBFBD><EFBFBD>Cache********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "UpstreamPathTemplate": "/T/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "UseServiceDiscovery": true,
|
||||
// "ServiceName": "ZhaoxiService", //consul<75><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "LoadBalancerOptions": {
|
||||
// "Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// },
|
||||
// "FileCacheOptions": {
|
||||
// "TtlSeconds": 15, //Second
|
||||
// "Region": "UserCache" //<2F><><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD>Api<70><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// "GlobalConfiguration": {
|
||||
// "BaseUrl": "http://127.0.0.1:6299", //<2F><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
// "ServiceDiscoveryProvider": {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 8089,
|
||||
// "Type": "Consul" //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥconsul
|
||||
// }
|
||||
// //"ServiceDiscoveryProvider": {
|
||||
// // "Host": "localhost",
|
||||
// // "Port": 8500,
|
||||
// // "Type": "PollConsul", //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
// // "PollingInterval": 1000 //<2F><>ѯconsul,Ƶ<>ʺ<EFBFBD><CABA><EFBFBD>--down<77><6E><EFBFBD>Dz<EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>
|
||||
// // //"Token": "footoken"//<2F><>ҪACL<43>Ļ<EFBFBD>
|
||||
// //}
|
||||
// }
|
||||
//}
|
||||
|
||||
////*****************************<2A><>ʱ+<2B><><EFBFBD><EFBFBD>+<2B>۶<EFBFBD>+<2B><><EFBFBD><EFBFBD>+Consul+Polly********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/{url}", //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "DownstreamScheme": "http",
|
||||
// "UpstreamPathTemplate": "/T/{url}", //<2F><><EFBFBD>ص<EFBFBD>ַ--url<72><6C><EFBFBD><EFBFBD>
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "UseServiceDiscovery": true,
|
||||
// "ServiceName": "ZhaoxiService", //consul<75><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "LoadBalancerOptions": {
|
||||
// "Type": "RoundRobin" //<2F><>ѯ LeastConnection-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD> NoLoadBalance<63><65><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// },
|
||||
// "RateLimitOptions": {
|
||||
// "ClientWhitelist": [ "eleven", "seven" ], //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ClientId <20><><EFBFBD>ִ<EFBFBD>Сд
|
||||
// "EnableRateLimiting": true,
|
||||
// "Period": "5m", //1s, 5m, 1h, 1d
|
||||
// "PeriodTimespan": 30, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>ͻ<EFBFBD><CDBB>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// "Limit": 5 //ͳ<><CDB3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// },
|
||||
// "AuthenticationOptions": {
|
||||
// "AuthenticationProviderKey": "UserGatewayKey",
|
||||
// "AllowedScopes": []
|
||||
// },
|
||||
// "QoSOptions": {
|
||||
// "ExceptionsAllowedBeforeBreaking": 3, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD><D9B8>쳣<EFBFBD><ECB3A3><EFBFBD><EFBFBD>
|
||||
// "DurationOfBreak": 10000, // <20>۶ϵ<DBB6>ʱ<EFBFBD>䣬<EFBFBD><E4A3AC>λΪms
|
||||
// "TimeoutValue": 2000 //<2F><>λms <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>ʱ<EFBFBD>䳬<EFBFBD><E4B3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>罫<EFBFBD><E7BDAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ʱ Ĭ<><C4AC>90<39><30>
|
||||
// }
|
||||
// //"FileCacheOptions": {
|
||||
// // "TtlSeconds": 15,
|
||||
// // "Region": "UserCache" //<2F><><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD>Api<70><69><EFBFBD><EFBFBD>
|
||||
// //}
|
||||
// }
|
||||
// ],
|
||||
// "GlobalConfiguration": {
|
||||
// "BaseUrl": "http://127.0.0.1:6299", //<2F><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>ַ
|
||||
// "ServiceDiscoveryProvider": {
|
||||
// "Host": "47.95.2.2",
|
||||
// "Port": 8089,
|
||||
// "Type": "Consul" //<2F><>Consul<75>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// },
|
||||
// "RateLimitOptions": {
|
||||
// "QuotaExceededMessage": "Too many requests, maybe later? 11", // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>ض<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
||||
// "HttpStatusCode": 666, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>ض<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ص<EFBFBD>http status
|
||||
// //"ClientIdHeader": "client_id" // <20><><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>ͻ<EFBFBD><CDBB>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD> ClientId
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
////*****************************<2A><><EFBFBD><EFBFBD><EFBFBD>ۺ<EFBFBD>Aggregator********************************
|
||||
//{
|
||||
// "Routes": [
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/users/all",
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5726 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// } //<2F><><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><D0B8>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5726/users/all",
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "key": "T5726"
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/users/all",
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5727 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5727/users/all",
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "key": "T5727"
|
||||
// },
|
||||
// {
|
||||
// "DownstreamPathTemplate": "/api/users/all",
|
||||
// "DownstreamScheme": "http",
|
||||
// "DownstreamHostAndPorts": [
|
||||
// {
|
||||
// "Host": "localhost",
|
||||
// "Port": 5728 //<2F><><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
|
||||
// }
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/T5728/users/all",
|
||||
// "UpstreamHttpMethod": [ "Get", "Post" ],
|
||||
// "key": "T5728"
|
||||
// }
|
||||
// ],
|
||||
// "Aggregates": [
|
||||
// {
|
||||
// "RouteKeys": [
|
||||
// "T5726",
|
||||
// "T5727",
|
||||
// "T5728"
|
||||
// ],
|
||||
// "UpstreamPathTemplate": "/UserAggregator", //<2F><><EFBFBD><EFBFBD>ij<EFBFBD><C4B3>404 <20>Dz<EFBFBD>Ӱ<EFBFBD>췵<EFBFBD>أ<EFBFBD><D8A3><EFBFBD><EFBFBD><EFBFBD>null
|
||||
// "Aggregator": "CustomUserAggregator" //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ۺ<EFBFBD><DBBA><EFBFBD>
|
||||
// }
|
||||
// ]
|
||||
//}
|
||||
|
||||
45
Yi.Framework.Net6/Yi.Framework.SMSProcessor/appsettings.json
Normal file
45
Yi.Framework.Net6/Yi.Framework.SMSProcessor/appsettings.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"RabbitMQ_Enabled": true,
|
||||
"SMS_Enabled": true,
|
||||
"RedisConn": {
|
||||
"Host": "192.168.2.128",
|
||||
"Prot": 6379,
|
||||
"DB": 0,
|
||||
"Password": "123456"
|
||||
},
|
||||
"RabbitConn": {
|
||||
"HostName": "118.195.191.41",
|
||||
"UserName": "cc",
|
||||
"Password": "cc",
|
||||
"Port": 5672
|
||||
},
|
||||
//"DetailPageUrl": "http://localhost:5728/item/",
|
||||
"DetailPageUrl": "http://PageDetail/item/",
|
||||
"ConsulClientOption": {
|
||||
"IP": "192.168.2.128",
|
||||
"Port": "8500",
|
||||
"Datacenter": "dc1"
|
||||
},
|
||||
"MysqlConn": {
|
||||
"Url": "server=192.168.2.128;port=3306;database=ECDB;user id=root;password=123456"
|
||||
},
|
||||
"Apollo": {
|
||||
"AppId": "Yi.Framework.StaticPageProcessor",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://192.168.2.168:8080",
|
||||
"ConfigServer": [ "http://192.168.2.168:8080" ]
|
||||
},
|
||||
"SMS": {
|
||||
"ID": "LTAI5tJvjPaXCyyPMfXLNbVA",
|
||||
"Secret": "fLQv7jjj57fUKLFK8REeAQPFVDjUYn",
|
||||
"Sign": "JiftCC",
|
||||
"Template": "SMS_221640732"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"apollo": {
|
||||
"AppId": "SMSProcessor",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://119.91.207.67:18080",
|
||||
"ConfigServer": [ "http://119.91.207.67:18080" ]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
namespace Yi.Framework.Service
|
||||
{
|
||||
public partial class TenantService : Repository<TenantEntity>, ITenantService
|
||||
{
|
||||
public TenantService(ISqlSugarClient context) : base(context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Yi.Framework.Interface;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
|
||||
@@ -6,6 +7,8 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
public partial class UserService : Repository<UserEntity>, IUserService
|
||||
{
|
||||
|
||||
public UserService(ISqlSugarClient context) : base(context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model.Models;
|
||||
using Yi.Framework.Repository;
|
||||
@@ -7,8 +10,55 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
public partial class UserService
|
||||
{
|
||||
public UserService(ISqlSugarClient context) : base(context)
|
||||
public async Task<bool> Exist(Guid id, Action<UserEntity> userAction = null)
|
||||
{
|
||||
var user = await GetByIdAsync(id);
|
||||
userAction.Invoke(user);
|
||||
if (user == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public async Task<bool> Exist(string userName, Action<UserEntity> userAction = null)
|
||||
{
|
||||
var user = await GetFirstAsync(u=>u.UserName== userName);
|
||||
if (userAction != null)
|
||||
{
|
||||
userAction.Invoke(user);
|
||||
}
|
||||
if (user == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public async Task<bool> Login(string userName, string password,Action<UserEntity> userAction = null)
|
||||
{
|
||||
var user=new UserEntity();
|
||||
if (await Exist(userName, o => user = o))
|
||||
{
|
||||
userAction.Invoke(user);
|
||||
if (user.Password== Common.Helper.MD5Helper.SHA2Encode(password, user.Salt))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<bool> Register(UserEntity userEntity, Action<UserEntity> userAction = null)
|
||||
{
|
||||
var user = new UserEntity();
|
||||
if (!await Exist(user.Name))
|
||||
{
|
||||
user.UserName= userEntity.UserName;
|
||||
user.Salt = Common.Helper.MD5Helper.GenerateSalt();
|
||||
user.Password = Common.Helper.MD5Helper.SHA2Encode(userEntity.Password,user.Salt);
|
||||
userAction.Invoke(await InsertReturnEntityAsync(user));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10192
Yi.Vue2.x/package-lock.json
generated
Normal file
10192
Yi.Vue2.x/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
27
Yi.Vue2.x/package.json
Normal file
27
Yi.Vue2.x/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "vuetify-test",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.22.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-chartist": "^2.3.1",
|
||||
"vue-router": "^3.2.0",
|
||||
"vuetify": "^2.4.0",
|
||||
"vuetify-dialog": "^2.0.17",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"sass": "~1.32.0",
|
||||
"sass-loader": "^10.0.0",
|
||||
"vue-cli-plugin-vuetify": "~2.4.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vuetify-loader": "^1.7.0"
|
||||
}
|
||||
}
|
||||
13283
Yi.Vue3.x/package-lock.json
generated
Normal file
13283
Yi.Vue3.x/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
36
Yi.Vue3.x/package.json
Normal file
36
Yi.Vue3.x/package.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "my-app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^0.2.4",
|
||||
"core-js": "^3.6.5",
|
||||
"element-plus": "^1.3.0-beta.5",
|
||||
"vue": "^3.0.0",
|
||||
"vue-class-component": "^8.0.0-0",
|
||||
"vue-router": "^4.0.0-0",
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-plugin-typescript": "~4.5.0",
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0",
|
||||
"sass": "^1.26.5",
|
||||
"sass-loader": "^8.0.2",
|
||||
"typescript": "~4.1.5"
|
||||
}
|
||||
}
|
||||
40
Yi.Vue3.x/tsconfig.json
Normal file
40
Yi.Vue3.x/tsconfig.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"importHelpers": true,
|
||||
"moduleResolution": "node",
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.vue",
|
||||
"tests/**/*.ts",
|
||||
"tests/**/*.tsx"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user