mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-29 04:51:58 +08:00
小程序接口迁移到ry
This commit is contained in:
@@ -121,10 +121,133 @@ public class Constants
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
*/
|
||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" };
|
||||
|
||||
|
||||
/**
|
||||
* 用户ID key
|
||||
*/
|
||||
public static final String JWT_USER_ID="user_id";
|
||||
/**
|
||||
* 用户ID key
|
||||
*/
|
||||
public static final String JWT_USER_NAME="user_name";
|
||||
/**
|
||||
* 用户ID key
|
||||
*/
|
||||
public static final String JWT_LOGIN_NAME="login_name";
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
public static final String JWT_REAL_NAME="real_name";
|
||||
|
||||
/**
|
||||
* 微信多平台唯一ID key
|
||||
*/
|
||||
public static final String JWT_UNIONID="unionid";
|
||||
/**
|
||||
* 登录微信后的session_key
|
||||
*/
|
||||
public static final String JWT_SESSION_KEY = "session_key";
|
||||
|
||||
/**
|
||||
* 登录微信后的open_id
|
||||
*/
|
||||
public static final String JWT_OPEN_ID = "open_id";
|
||||
/**
|
||||
* 小程序ACCESS_TOKEN缓存key
|
||||
*/
|
||||
public static final String WX_APPLETS_REDIS_ACCESS_TOKEN_KEY="wx.applets.access.token.key";
|
||||
/**
|
||||
* 微信小程序--服务器验证专用token
|
||||
*/
|
||||
public static final String WX_APPLETS_TOKEN="oHDqn56DWSxUHyiOnqLAyawfUj0k";
|
||||
/**
|
||||
* 微信小程序--开发者账号的appid
|
||||
*/
|
||||
public static final String WX_APPLETS_APP_ID="wxd4300820f84a6d6b";
|
||||
/**
|
||||
* 微信小程序--开发者账号的AppSecret
|
||||
*/
|
||||
public static final String WX_APPLETS_APP_SERCERT="16daf686025b3d9755976d79615b254f";
|
||||
|
||||
/**
|
||||
* 公众号ACCESS_TOKEN缓存key
|
||||
*/
|
||||
public static final String WX_OFFICIAL_ACCOUNT_REDIS_ACCESS_TOKEN_KEY="wx.officialAccount.access.token.key";
|
||||
/**
|
||||
* 微信公众号--服务器验证专用token
|
||||
*/
|
||||
public static final String WX_OFFICIAL_ACCOUNT_TOKEN="oHDqn56DWSxUHyiOnqLAyawfUj0k";
|
||||
/**
|
||||
* 微信公众号--开发者账号的appid
|
||||
*/
|
||||
public static final String WX_OFFICIAL_ACCOUNT_APPID ="wx42f8776ad330e623";
|
||||
/**
|
||||
* 微信公众号--开发者账号的AppSecret
|
||||
*/
|
||||
public static final String WX_OFFICIAL_ACCOUNT_APPSECRET="6dd7ea55e17ec30df20164f1de1e9e5f";
|
||||
|
||||
/**
|
||||
* 赛会: 赛会创建-防重提交缓存key
|
||||
*/
|
||||
public static final String COMPETITION_CREATE_KEY = "competition:create:code:";
|
||||
/**
|
||||
* 赛会: 赛会创建时保存的短信验证码缓存key
|
||||
*/
|
||||
public static final String ESTABLISH_COMPETITION_SMS_CAPTCHA = "competition:verifyCode:";
|
||||
|
||||
/**
|
||||
* 赛会: 球队申请加入赛会-短信验证码缓存key
|
||||
*/
|
||||
public static final String COMPETITION_TEAM_CAPTCHA = "competition:team:verifyCode:";
|
||||
/**
|
||||
* 赛会:球队-球员申请加入球队-短信验证码缓存key
|
||||
*/
|
||||
public static final String COMPETITION_TEAM_MEMBER_CAPTCHA = "competition:team:member:verifyCode:";
|
||||
/**
|
||||
* 球队加入验证码过期时间-有效期 (秒)
|
||||
*/
|
||||
public static final Long COMPETITION_TEAM_MEMBER_CAPTCHA_EXPIRES = 300L;
|
||||
/**
|
||||
* 泡泡短信平台-url前缀
|
||||
*/
|
||||
public static final String SMS_PAOPAO_URL = "http://47.94.229.220:7862/sms";
|
||||
/**
|
||||
* 泡泡短信平台-account
|
||||
*/
|
||||
public static final String SMS_PAOPAO_ACCOUNT = "911136";
|
||||
/**
|
||||
* 泡泡短信平台-密码 password
|
||||
*/
|
||||
public static final String SMS_PAOPAO_PASSWORD = "MMfZ3p";
|
||||
/**
|
||||
* 泡泡短信平台-接入号 extno
|
||||
*/
|
||||
public static final String SMS_PAOPAO_EXTNO = "106901911136";
|
||||
/**
|
||||
* 泡泡短信平台-有效期 (秒)
|
||||
*/
|
||||
public static final Long SMS_PAOPAO_EXPIRES = 900L;
|
||||
/**
|
||||
* 短信签名
|
||||
*/
|
||||
public static final String SMS_PAOPAO_SIGN="【篮球Zone】";
|
||||
/**
|
||||
* 存放赛程循环赛的锁的key
|
||||
*/
|
||||
public static final String ARRANGE_TEAM_GROUP_SCHEDULE="arrange:team:group:schedule:";
|
||||
/**
|
||||
* Redis 存放乐橙云 管理员token
|
||||
*/
|
||||
public static final String LECHANGE_ACCESSTOKEN = "lechange:accesstoken";
|
||||
/**
|
||||
* Redis 存放乐橙云 轻应用播放token
|
||||
*/
|
||||
public static final String LECHANGE_LIVE_KITTOKEN = "lechange:live:kittoken";
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import com.ruoyi.common.core.utils.ServletUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.annotation.InnerAuth;
|
||||
|
||||
import static com.ruoyi.common.core.constant.SecurityConstants.FROM_SOURCE;
|
||||
|
||||
/**
|
||||
* 内部服务调用验证处理
|
||||
*
|
||||
@@ -23,7 +25,7 @@ public class InnerAuthAspect implements Ordered
|
||||
@Around("@annotation(innerAuth)")
|
||||
public Object innerAround(ProceedingJoinPoint point, InnerAuth innerAuth) throws Throwable
|
||||
{
|
||||
String source = ServletUtils.getRequest().getHeader(SecurityConstants.FROM_SOURCE);
|
||||
String source = ServletUtils.getRequest().getHeader(FROM_SOURCE);
|
||||
// 内部请求验证
|
||||
if (!StringUtils.equals(SecurityConstants.INNER, source))
|
||||
{
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.ruoyi.system.api.model.WxLoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.core.constant.CacheConstants;
|
||||
@@ -44,8 +46,8 @@ public class TokenService
|
||||
public Map<String, Object> createToken(LoginUser loginUser)
|
||||
{
|
||||
String token = IdUtils.fastUUID();
|
||||
Long userId = loginUser.getSysUser().getUserId();
|
||||
String userName = loginUser.getSysUser().getUserName();
|
||||
Long userId = loginUser.getUserid();
|
||||
String userName = loginUser.getUsername();
|
||||
loginUser.setToken(token);
|
||||
loginUser.setUserid(userId);
|
||||
loginUser.setUsername(userName);
|
||||
@@ -62,9 +64,9 @@ public class TokenService
|
||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
||||
rspMap.put("expires_in", expireTime);
|
||||
rspMap.put("user",loginUser);
|
||||
return rspMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户身份信息
|
||||
*
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.ruoyi.common.swagger.apiConstants;
|
||||
/**
|
||||
* @description API 接口使用终端
|
||||
* @author 吴一博
|
||||
* @date 2023/7/4 10:18
|
||||
*/
|
||||
public class ApiTerminal {
|
||||
public static final String wxMiniProgram="微信小程序-";
|
||||
public static final String pc="PC端-";
|
||||
}
|
||||
Reference in New Issue
Block a user