Conflicts:
	base-webapp/pom.xml
	pom.xml
This commit is contained in:
lvleigang 2024-09-24 15:24:30 +08:00
commit 93727f30b0
3 changed files with 52 additions and 1 deletions

View File

@ -215,6 +215,35 @@ public class LoginServiceImpl implements ILoginService {
}
break;
case "weChat":
String authCode = entity.getString("code");//授权码
JSONObject params = new JSONObject();
params.put("code",authCode);
params.put("corpid",entity.getString("corpid"));
params.put("corpsecret",entity.getString("corpsecret"));
params.put("access_token",entity.getString("access_token"));
String res = HttpRequest.post(url).
header("appId",appId).
header("apiCode",userApiCode).
header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj").
header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
body(params.toJSONString()).
execute().
body();
JSONObject resJsonObject = JSONObject.parseObject(res);
JSONObject attribute = resJsonObject.getJSONObject("attribute");
String errcode = attribute.getString("errcode");
String errmsg = attribute.getString("errmsg");
if(!"0".equals(errcode)){
return BaseResult.getFailureMessageEntity("请求错误:"+errmsg);
}
String weComUserid = attribute.getString("userid");
userEntity.setWxUserId(weComUserid);
userEntity = sysUserDao.queryOne(userEntity);
if(null == userEntity ){
JSONObject object = new JSONObject();
object.put("userid",weComUserid);
return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定企业微信","1005",object);
}
break;
default:
return BaseResult.getFailureMessageEntity("错误的App类型:"+appType+" 支持的app类型有DD,weChat");

View File

@ -76,7 +76,11 @@
<artifactId>fw-u9c</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-weixin</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>

18
pom.xml
View File

@ -464,6 +464,24 @@
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<filtering>false</filtering>
<includes>
<!-- 匹配所有jar包 -->
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<filtering>false</filtering>
<includes>
<!-- 匹配所有jar包 -->
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>