@@ -35,7 +35,7 @@ namespace Learun.Application.WebApi.Modules | |||||
{ | { | ||||
string ver = this.GetReqData();// 获取模板请求数据 | string ver = this.GetReqData();// 获取模板请求数据 | ||||
var targetData = functionIBLL.GetDesktopList("1").OrderBy(m => m.F_Sort); | var targetData = functionIBLL.GetDesktopList("1").OrderBy(m => m.F_Sort); | ||||
var listData = functionIBLL.GetDesktopList("2").OrderBy(m=>m.F_Sort); | |||||
var listData = functionIBLL.GetDesktopList("2").OrderBy(m => m.F_Sort); | |||||
var chartData = functionIBLL.GetDesktopList("3").OrderBy(m => m.F_Sort); | var chartData = functionIBLL.GetDesktopList("3").OrderBy(m => m.F_Sort); | ||||
var data = new { target = targetData, list = listData, chart = chartData }; | var data = new { target = targetData, list = listData, chart = chartData }; | ||||
string md5 = Md5Helper.Encrypt(data.ToJson(), 32); | string md5 = Md5Helper.Encrypt(data.ToJson(), 32); | ||||
@@ -78,7 +78,7 @@ namespace Learun.Application.WebApi.Modules | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
// 添加委托信息 | // 添加委托信息 | ||||
List<UserInfo> delegateList = nWFProcessIBLL.GetDelegateProcess(userId); | List<UserInfo> delegateList = nWFProcessIBLL.GetDelegateProcess(userId); | ||||
strSql.Append(" AND 1=1"); | |||||
strSql.Append(" AND 1=1"); | |||||
strSql.Append($" AND r1.F_UserId ='{userId}' "); | strSql.Append($" AND r1.F_UserId ='{userId}' "); | ||||
foreach (var item in delegateList) | foreach (var item in delegateList) | ||||
{ | { | ||||
@@ -188,8 +188,31 @@ namespace Learun.Application.WebApi.Modules | |||||
public Response GetImgIds(dynamic _) | public Response GetImgIds(dynamic _) | ||||
{ | { | ||||
var data = dTImgIBLL.GetList().Where(m => m.F_EnabledMark == 1).Select(m => m.F_Id); | |||||
return Success(data); | |||||
//分布式部署 | |||||
if (string.IsNullOrEmpty(Request.Query["isDistributed"])) | |||||
{ | |||||
var data = dTImgIBLL.GetList().Where(m => m.F_EnabledMark == 1).Select(m => m.F_Id); | |||||
return Success(data); | |||||
} | |||||
else | |||||
{ | |||||
var data = dTImgIBLL.GetList().Where(m => m.F_EnabledMark == 1); | |||||
//分布式部署 | |||||
if (!string.IsNullOrEmpty(Request.Query["isDistributed"])) | |||||
{ | |||||
//主站地址 | |||||
string webrootpath = Config.GetValue("webrootpath"); | |||||
string fileAppDTImg = Config.GetValue("fileAppDTImg"); | |||||
foreach (var imgitem in data) | |||||
{ | |||||
if (fileAppDTImg.Contains("Resource")) | |||||
{ | |||||
imgitem.DistributedUrl = string.Format("{0}/{1}/{2}{3}", webrootpath, fileAppDTImg.Substring(fileAppDTImg.LastIndexOf("Resource")), imgitem.F_Id, imgitem.F_FileName); | |||||
} | |||||
} | |||||
} | |||||
return Success(data.Select(m=>m.DistributedUrl)); | |||||
} | |||||
} | } | ||||
public Response GetImg(dynamic _) | public Response GetImg(dynamic _) | ||||
@@ -11,7 +11,7 @@ namespace Learun.Application.AppMagager | |||||
/// 日 期:2018-07-02 15:31 | /// 日 期:2018-07-02 15:31 | ||||
/// 描 述:App首页图片管理 | /// 描 述:App首页图片管理 | ||||
/// </summary> | /// </summary> | ||||
public class DTImgBLL: DTImgIBLL | |||||
public class DTImgBLL : DTImgIBLL | |||||
{ | { | ||||
private DTImgService dTImgService = new DTImgService(); | private DTImgService dTImgService = new DTImgService(); | ||||
@@ -170,9 +170,9 @@ namespace Learun.Application.AppMagager | |||||
#region 扩展方法 | #region 扩展方法 | ||||
/// <summary> | /// <summary> | ||||
/// 获取图片 | |||||
/// 获取图片 当webapi与web不在同一台服务器上时,isDistributed应为true | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="keyValue"></param> | |||||
public void GetImg(string keyValue) | public void GetImg(string keyValue) | ||||
{ | { | ||||
DTImgEntity entity = GetEntity(keyValue); | DTImgEntity entity = GetEntity(keyValue); | ||||
@@ -182,6 +182,7 @@ namespace Learun.Application.AppMagager | |||||
if (!string.IsNullOrEmpty(entity.F_FileName)) | if (!string.IsNullOrEmpty(entity.F_FileName)) | ||||
{ | { | ||||
string fileHeadImg = Config.GetValue("fileAppDTImg"); | string fileHeadImg = Config.GetValue("fileAppDTImg"); | ||||
string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, entity.F_Id, entity.F_FileName); | string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, entity.F_Id, entity.F_FileName); | ||||
if (DirFileHelper.IsExistFile(fileImg)) | if (DirFileHelper.IsExistFile(fileImg)) | ||||
{ | { | ||||
@@ -43,6 +43,10 @@ namespace Learun.Application.AppMagager | |||||
/// <returns></returns> | /// <returns></returns> | ||||
[Column("F_SORTCODE")] | [Column("F_SORTCODE")] | ||||
public int? F_SortCode { get; set; } | public int? F_SortCode { get; set; } | ||||
[NotMapped] | |||||
public string DistributedUrl { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -10,12 +10,14 @@ export default { | |||||
"https://wx.qjkjedu.com/learun/adms" | "https://wx.qjkjedu.com/learun/adms" | ||||
], | ], | ||||
// "apiHost": [ | // "apiHost": [ | ||||
// "http://192.168.2.202:31173/learun/adms" | |||||
// "http://192.168.2.202:8083/learun/adms" | |||||
// ], | // ], | ||||
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | ||||
"devAccount": [ | "devAccount": [ | ||||
{ username: "System", password: "0000" } | { username: "System", password: "0000" } | ||||
], | ], | ||||
//是否分布式部署 指WebApi与Web不在一台服务器 | |||||
"isDistributed":true, | |||||
// 开发环境使用的接口地址(数组索引) | // 开发环境使用的接口地址(数组索引) | ||||
"devApiHostIndex": 0, | "devApiHostIndex": 0, | ||||
// 生产环境使用的接口地址(数组索引) | // 生产环境使用的接口地址(数组索引) | ||||