|
|
|
@ -21,11 +21,13 @@ import com.dreamchaser.depository_manage.utils.Md5; |
|
|
|
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; |
|
|
|
import com.dreamchaser.depository_manage.utils.QyWxXMLUtils; |
|
|
|
import org.apache.commons.codec.digest.DigestUtils; |
|
|
|
import org.apache.xmlbeans.impl.store.Public2; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpSession; |
|
|
|
@ -39,7 +41,6 @@ import java.util.concurrent.TimeUnit; |
|
|
|
/** |
|
|
|
* 用于企业微信相关操作的控制器 |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@Controller |
|
|
|
public class QyWxOperationController { |
|
|
|
|
|
|
|
@ -262,6 +263,7 @@ public class QyWxOperationController { |
|
|
|
String header = request.getHeader("user-agent"); |
|
|
|
String crypt = Md5.crypt(header); |
|
|
|
JSONObject jsonObject = QyWxConfig.GetQYWXUserId(crypt); |
|
|
|
|
|
|
|
Integer errCode = jsonObject.getInteger("errcode"); |
|
|
|
String userId = jsonObject.getString("userid"); |
|
|
|
if (errCode == 0) { |
|
|
|
@ -274,6 +276,9 @@ public class QyWxOperationController { |
|
|
|
String key = userKeyAndUserToken.get("key"); |
|
|
|
String token = userKeyAndUserToken.get("token"); |
|
|
|
if (userByPort != null) { |
|
|
|
|
|
|
|
PublicConfig.findUserByQyWxUserId(userId); |
|
|
|
|
|
|
|
// 如果数据库中存在该用户
|
|
|
|
// 设置放入时间
|
|
|
|
userByPort.setInstant(Instant.now()); |
|
|
|
|