Browse Source

REPORT-81241【运营产品化二期】插件中心断网后的重新加载无反应

修改一些url编码
给一些常量加注释
feature/x
Link.Zhao 2 years ago
parent
commit
34750dd81b
  1. 31
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
  2. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
  3. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
  4. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java

31
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fr.design.i18n.Toolkit;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
/** /**
@ -52,21 +53,21 @@ public class AlphaFineCloudConstants {
} }
/** /**
* get PluginUrl * 获取插件信息api
*/ */
public static String getPluginUrl() { public static String getPluginUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO); return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO);
} }
/** /**
* get ReuseUrl * 获取组件信息api
*/ */
public static String getReuseUrl() { public static String getReuseUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO);
} }
/** /**
* get DocumentDocUrl * 获取帮助文档url
*/ */
public static String getDocumentDocUrl() { public static String getDocumentDocUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW);
@ -94,28 +95,28 @@ public class AlphaFineCloudConstants {
} }
/** /**
* get CloudServerUrl * 获取云端接口用于上传alphafine搜索记录
*/ */
public static String getCloudServerUrl() { public static String getCloudServerUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD);
} }
/** /**
* get SearchApi * 获取搜索api输入搜索词返回fr的相关功能
*/ */
public static String getSearchApi() { public static String getSearchApi() {
return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH);
} }
/** /**
* get SimilarSearchUrlPrefix * 获取模糊搜索api前缀输入搜索词返回alphaFine相关内容插件文档功能等
*/ */
public static String getSimilarSearchUrlPrefix() { public static String getSimilarSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH);
} }
/** /**
* get ComplementAdviceSearchUrlPrefix * 补全建议搜索结果 api与AF_SIMILAR_SEARCH接口类似但是返回的信息更全
*/ */
public static String getComplementAdviceSearchUrlPrefix() { public static String getComplementAdviceSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH);
@ -136,14 +137,14 @@ public class AlphaFineCloudConstants {
} }
/** /**
* get AlphaGoToWeb * 推荐搜索api输入搜索词返回猜你想搜的内容html格式
*/ */
public static String getAlphaGoToWeb() { public static String getAlphaGoToWeb() {
return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB);
} }
/** /**
* get AlphaPreview * 帆软智能客服页面url
*/ */
public static String getAlphaPreview() { public static String getAlphaPreview() {
return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW);
@ -170,12 +171,12 @@ public class AlphaFineCloudConstants {
String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH);
String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY);
String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT);
return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + return "[{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start") + "\", \"link\":\"" + quickStartUrl + "\"}," +
"{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning") + "\", \"link\":\"" + reportLearningPath + "\"}," +
"{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning") + "\", \"link\":\"" + parameterLearningPath + "\"}," +
"{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning") + "\", \"link\":\"" + fillLearningPath + "\"}," +
"{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary") + "\", \"link\":\"" + apiSummary + "\"}," +
"{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document") + "\", \"link\":\"" + monthlyDocument + "\"} ]";
} }
/** /**

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.cell.model; package com.fr.design.mainframe.alphafine.cell.model;
import com.fr.base.login.ClientHelper;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants; import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.CellType;
@ -46,8 +47,9 @@ public class RobotModel extends AlphaCellModel {
} }
public static String getContent(String titleStr) { public static String getContent(String titleStr) {
String encodedTitleStr = ClientHelper.urlEncode(titleStr, EncodeConstants.ENCODING_UTF_8);
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr);
String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token; String url = AlphaFineCloudConstants.getAlphaGoToWeb() + encodedTitleStr + "&token=" + token;
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java

@ -43,7 +43,7 @@ public class ComplementAdviceManager {
SearchResult searchResult = new SearchResult(); SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java

@ -50,7 +50,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider {
SearchResult allModelList = new SearchResult(); SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) { for (int j = 0; j < searchText.length; j++) {
String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try { try {
String result = HttpToolbox.get(url); String result = HttpToolbox.get(url);

Loading…
Cancel
Save