登录时返回图片和后端接口地址
							parent
							
								
									c2b835ebfa
								
							
						
					
					
						commit
						2856aa0626
					
				|  | @ -71,6 +71,9 @@ public class LoginController extends BaseController { | |||
|     @Autowired | ||||
|     private PhotoService photoService; | ||||
| 
 | ||||
|     @Autowired | ||||
|     private CorpPathService corpPathService; | ||||
| 
 | ||||
|     /** | ||||
|      * 请求登录验证用户接口 | ||||
|      * | ||||
|  | @ -253,6 +256,17 @@ public class LoginController extends BaseController { | |||
|                                     session.setAttribute(Const.ISSUPERVISE, dpd.getString("ISSUPERVISE"));        //把当前用户放入session
 | ||||
| 
 | ||||
|                                     FHLOG.save(USERNAME, "成功登录系统", ip);                //记录日志
 | ||||
| 
 | ||||
|                                     //查询该用户或企业的图片和后端地址
 | ||||
|                                     if (!Tools.isEmpty(pd.getString("CORPINFO_ID")) && !pd.getString("CORPINFO_ID").equals("1")) { | ||||
|                                         PageData pathData = corpPathService.getCorpPathByCorpId(pd); | ||||
|                                         map.put("picPath",pathData.getString("PIC_PATH")); | ||||
|                                         map.put("backEndPath", pathData.getString("BACK_END_PATH")); | ||||
|                                     } else { | ||||
|                                         PageData pathData = corpPathService.getCorpPathByPersonInfo(pd); | ||||
|                                         map.put("picPath", pathData.getString("PIC_PATH")); | ||||
|                                         map.put("backEndPath", pathData.getString("BACK_END_PATH")); | ||||
|                                     } | ||||
|                                 } | ||||
|                             } else { | ||||
|                                 token.clear(); | ||||
|  |  | |||
|  | @ -0,0 +1,13 @@ | |||
| package com.zcloud.mapper.datasource.system; | ||||
| 
 | ||||
| import com.zcloud.entity.PageData; | ||||
| 
 | ||||
| /** | ||||
|  * 企业图片地址、后端地址访问表 | ||||
|  */ | ||||
| public interface CorpPathMapper { | ||||
| 
 | ||||
|     PageData getCorpPathByCorpId(PageData pd); | ||||
| 
 | ||||
|     PageData getCorpPathByPersonInfo(PageData pd); | ||||
| } | ||||
|  | @ -0,0 +1,25 @@ | |||
| package com.zcloud.service.system; | ||||
| 
 | ||||
| import com.zcloud.entity.PageData; | ||||
| 
 | ||||
| /** | ||||
|  * 企业图片地址、后端地址访问表 | ||||
|  */ | ||||
| public interface CorpPathService { | ||||
| 
 | ||||
|     /** | ||||
|      * 根据企业id获取企业图片、后端路径访问地址 | ||||
|      * @param pd | ||||
|      * @return | ||||
|      * @throws Exception | ||||
|      */ | ||||
|     PageData getCorpPathByCorpId(PageData pd) throws Exception; | ||||
| 
 | ||||
|     /** | ||||
|      * 根据人员信息获取对应企业图片、后端路径访问地址 | ||||
|      * @param pd | ||||
|      * @return | ||||
|      * @throws Exception | ||||
|      */ | ||||
|     PageData getCorpPathByPersonInfo(PageData pd) throws Exception; | ||||
| } | ||||
|  | @ -0,0 +1,60 @@ | |||
| package com.zcloud.service.system.impl; | ||||
| 
 | ||||
| import com.zcloud.entity.PageData; | ||||
| import com.zcloud.mapper.datasource.system.CorpPathMapper; | ||||
| import com.zcloud.service.system.CorpPathService; | ||||
| import com.zcloud.util.Tools; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| /** | ||||
|  * 企业图片地址、后端地址访问表 | ||||
|  */ | ||||
| @Service | ||||
| public class CorpPathServiceImpl implements CorpPathService { | ||||
|     @Autowired | ||||
|     private CorpPathMapper corpPathMapper; | ||||
| 
 | ||||
|     @Value("${corp.default.pic-path}") | ||||
|     private String defaultPicPath; | ||||
| 
 | ||||
|     @Value("${corp.default.back-end-path}") | ||||
|     private String defaultBackEndPath; | ||||
| 
 | ||||
|     /** | ||||
|      * 根据企业id获取企业图片、后端路径访问地址 | ||||
|      * @param pd | ||||
|      * @return | ||||
|      * @throws Exception | ||||
|      */ | ||||
|     @Override | ||||
|     public PageData getCorpPathByCorpId(PageData pd) throws Exception { | ||||
|         PageData data = corpPathMapper.getCorpPathByCorpId(pd); | ||||
|         if (Tools.isEmpty(data)) { | ||||
|             PageData result = new PageData(); | ||||
|             result.put("PIC_PATH",defaultPicPath); | ||||
|             result.put("BACK_END_PATH", defaultBackEndPath); | ||||
|             return result; | ||||
|         } | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 根据人员信息获取企业图片、后端路径访问地址 | ||||
|      * @param pd | ||||
|      * @return | ||||
|      * @throws Exception | ||||
|      */ | ||||
|     @Override | ||||
|     public PageData getCorpPathByPersonInfo(PageData pd) throws Exception { | ||||
|         PageData data = corpPathMapper.getCorpPathByPersonInfo(pd); | ||||
|         if ("1".equals(pd.getString("USER_ID")) || Tools.isEmpty(data)) { | ||||
|             PageData result = new PageData(); | ||||
|             result.put("PIC_PATH",defaultPicPath); | ||||
|             result.put("BACK_END_PATH", defaultBackEndPath); | ||||
|             return result; | ||||
|         } | ||||
|         return data; | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,53 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.zcloud.mapper.datasource.system.CorpPathMapper"> | ||||
| 
 | ||||
| 	<!--表名 --> | ||||
| 	<sql id="tableName"> | ||||
| 		SYS_CORP_PATH | ||||
| 	</sql> | ||||
| 
 | ||||
| 	<!-- 字段 --> | ||||
| 	<sql id="Field"> | ||||
| 		CORP_PATH_ID, | ||||
| 		CORPINFO_ID, | ||||
| 		PIC_PATH, | ||||
| 		BACK_END_PATH | ||||
| 	</sql> | ||||
| 
 | ||||
| 	<!-- 字段 --> | ||||
| 	<sql id="Field2"> | ||||
| 		f.CORP_PATH_ID, | ||||
| 		f.CORPINFO_ID, | ||||
| 		f.PIC_PATH, | ||||
| 		f.BACK_END_PATH | ||||
| 	</sql> | ||||
| 
 | ||||
| 	<!-- 字段值 --> | ||||
| 	<sql id="FieldValue"> | ||||
| 		#{CORP_PATH_ID}, | ||||
| 		#{CORPINFO_ID}, | ||||
| 		#{PIC_PATH}, | ||||
| 		#{BACK_END_PATH} | ||||
| 	</sql> | ||||
| 
 | ||||
| 	<select id="getCorpPathByCorpId" resultType="pd"> | ||||
| 		select | ||||
| 		<include refid="Field"/> | ||||
| 		from | ||||
| 		<include refid="tableName"/> | ||||
| 		where | ||||
| 		CORPINFO_ID = #{corpId} | ||||
| 	</select> | ||||
| 
 | ||||
| 	<select id="getCorpPathByPersonInfo" resultType="pd"> | ||||
| 		select | ||||
| 		<include refid="Field2"/> | ||||
| 		from | ||||
| 		<include refid="tableName"/> f | ||||
| 		left join `qa-gwj-prevention`.vi_user_all vua on vua.USER_ID = #{USER_ID} | ||||
| 		where f.CORPINFO_ID = vua.CORPINFO_ID | ||||
| 	</select> | ||||
| 
 | ||||
| 
 | ||||
| </mapper> | ||||
		Loading…
	
		Reference in New Issue