sunpengfei
10 天以前 465f14d18c1ee52efffd7095bf7535a6bbb2e06f
feat:开发
3个文件已修改
9 ■■■■ 已修改文件
FlexJobApi.Core/Utils/AliyunUtils/AliyunOptions.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.Core/Utils/SmsUtils/SmsUtils.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.Web.Entry/appsettings.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.Core/Utils/AliyunUtils/AliyunOptions.cs
@@ -47,6 +47,8 @@
        /// </summary>
        public bool Enable { get; set; }
        public bool WithoutVerifyCode { get; set; }
        /// <summary>
        /// 版本
        /// </summary>
FlexJobApi.Core/Utils/SmsUtils/SmsUtils.cs
@@ -7,6 +7,7 @@
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -22,13 +23,16 @@
    public class SmsUtils
    {
        private readonly IRepository<SmsLog, LogDbContextLocator> rep;
        private readonly IOptions<AliyunOptions> options;
        private readonly AliyunSmsUtils aliyunSmsUtils;
        public SmsUtils(
            IRepository<SmsLog, LogDbContextLocator> rep,
            IOptions<AliyunOptions> options,
            AliyunSmsUtils aliyunSmsUtils)
        {
            this.rep = rep;
            this.options = options;
            this.aliyunSmsUtils = aliyunSmsUtils;
        }
@@ -41,7 +45,7 @@
            entity.TemplateParam = new { code }.ToJson();
            await aliyunSmsUtils.SendAsync(model.PhoneNumber, model.TemplateCode, entity.TemplateParam, cancellationToken);
            await rep.InsertAsync(entity);
            if (App.HostEnvironment.IsDevelopment())
            if (options.Value.SMS.WithoutVerifyCode)
            {
                UnifyContext.Fill(new
                {
FlexJobApi.Web.Entry/appsettings.json
@@ -76,6 +76,7 @@
    },
    "SMS": {
      "Enable": true,
      "WithoutVerifyCode": true,
      "AccessKeyId": "LTAI5tLzz2jnXrUAAiC2kduH",
      "AccessSecret": "do1XqrgHJ5gOuFHhO5eku0FyYzZvbQ",
      "Version": "2017-05-25",