修改nls、微信授权地址,通过修改状态来控制测试和正式
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.cms.util;
|
||||
|
||||
/**
|
||||
* 阿里云配置
|
||||
*/
|
||||
public class AliyunNlsUtils {
|
||||
|
||||
/**
|
||||
* 标志
|
||||
*/
|
||||
public static final boolean USE_TEST_ENV=true;
|
||||
/**
|
||||
* 测试nls
|
||||
*/
|
||||
public static final String NLS_TEST_URL="wss://nls-gateway-cn-shanghai.aliyuncs.com";
|
||||
/**
|
||||
* 测试微信获取oppenid链接
|
||||
*/
|
||||
public static final String WX_TEST_URL="https://api.weixin.qq.com/sns/jscode2session";
|
||||
/**
|
||||
* 正式nls
|
||||
*/
|
||||
public static final String NLS_FORMAL_URL="http://192.168.2.102:10044";
|
||||
|
||||
/**
|
||||
* 根据环境判断正式还是测试
|
||||
* @return
|
||||
*/
|
||||
public static String getNlsUrl(){
|
||||
String url = USE_TEST_ENV ? NLS_TEST_URL : NLS_FORMAL_URL;
|
||||
System.out.println("nls当前环境:" + (USE_TEST_ENV ? "测试" : "正式") + ",WebSocket地址:" + url);
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信授权登录
|
||||
* @return
|
||||
*/
|
||||
public static String getWXoppenidUrl(){
|
||||
String url = USE_TEST_ENV ? WX_TEST_URL : NLS_FORMAL_URL+"/weixin";
|
||||
System.out.println("微信授权登录当前环境:" + (USE_TEST_ENV ? "测试" : "正式") + ",获取oppenid地址:" + url);
|
||||
return url;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user