Files
ks/ruoyi-bussiness/src/main/java/com/ruoyi/cms/util/AliyunNlsUtils.java

44 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}