提交 dc92c877 编写于 作者: F fancy

中文logo名问题处理

上级 1757be26
......@@ -21,6 +21,7 @@ import java.io.InputStream;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
......@@ -135,7 +136,7 @@ public class ActionAndroidPack extends BaseAction {
// file
ds.writeBytes(twoHyphens + boundary + end);
ds.writeBytes("Content-Disposition: form-data; " + "name=\"file\";filename=\"" + fileName + "\"" + end);
ds.writeBytes("Content-Disposition: form-data; " + "name=\"file\";filename=\"" + URLEncoder.encode(fileName, DefaultCharset.name) + "\"" + end);
ds.writeBytes(end);
ds.write(bytes, 0, bytes.length);
ds.writeBytes(end);
......
......@@ -38,23 +38,31 @@ public class ActionConnectPackServer extends BaseAction {
Wo wo = new Wo();
if (BooleanUtils.isNotTrue(connect())) {
wo.setStatus(1); // o2云未连接
result.setData(wo);
return result;
}
if (BooleanUtils.isFalse(Config.collect().getEnable())) {
wo.setStatus(1); // o2云未启用
result.setData(wo);
return result;
}
if (BooleanUtils.isNotTrue(validate(Config.collect().getName(), Config.collect().getPassword()))) {
wo.setStatus(2); // o2云未登录
result.setData(wo);
return result;
}
String token = login2AppPackServer(Config.collect().getName(), Config.collect().getPassword());
if (StringUtils.isEmpty(token)) {
wo.setStatus(3); // 未认证
result.setData(wo);
return result;
}else {
wo.setStatus(1001);
wo.setToken(token);
wo.setPackServerUrl(Config.collect().appPackServerUrl());
result.setData(wo);
return result;
}
result.setData(wo);
return result;
}
......
......@@ -2,7 +2,7 @@
overflow: hidden;padding-bottom: 80px;padding-top: 20px;padding-left: 20px;
}
.pack-error-msg {
color: #fb4747; font-size:16px; display: none;
color: #fb4747; font-size:16px;
}
.pack-form-group {
margin-top: 30px;
......
......@@ -2,8 +2,9 @@
<p>{{$.lp.mobile_apppack_tips1}}</p>
<p>{{$.lp.mobile_apppack_tips2}}</p>
<p>{{$.lp.mobile_apppack_tips3}}</p>
<p data-o2-element="apppackErrorMsgNode" class="pack-error-msg"></p>
<p data-o2-element="apppackErrorMsgNode" class="pack-error-msg" style="display: none;"></p>
<!-- 输入表单 -->
<div class="form" data-o2-element="apppackFormBodyNode" style="display: none;">
......
......@@ -146,13 +146,19 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
loadAppPackInfo: function () {
this.showLoading();
o2.Actions.load("x_program_center").AppPackAction.packInfo(this.token, function(json){
this.hiddenLoading();
if (json && json.type === "success") {
this.hiddenLoading();
this.packInfo = json.data;
this.showPackInfoDetail();
} else {
console.log("查询打包信息失败。。。")
this.loadConfigProxy();
}
}.bind(this), function(err){
console.log("错误拉,没有找到打包信息!");
console.log(err);
this.hiddenLoading();
this.loadConfigProxy();
}.bind(this));
},
showLoading: function() {
......@@ -200,7 +206,7 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
this.apppackLogoShowImgNode.set("src", this.packServerUrl + this.packInfo.appLogoPath + "?token=" + this.token);
var status = ""
if (this.packInfo.packStatus === "0") {
status = "排队中..."
status = this.lp.mobile_apppack_status_order_inline
this.apppackStatusRefreshNode.setStyles({
"display": ""
});
......@@ -213,7 +219,7 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
"display": "none"
});
} else if (this.packInfo.packStatus === "1") {
status = "打包中..."
status = this.lp.mobile_apppack_status_packing
this.apppackStatusRefreshNode.setStyles({
"display": ""
});
......@@ -226,7 +232,7 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
"display": "none"
});
} else if (this.packInfo.packStatus === "2") {
status = "打包完成"
status = this.lp.mobile_apppack_status_pack_end
this.apppackStatusRefreshNode.setStyles({
"display": "none"
});
......@@ -302,7 +308,6 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({
},
// 提交打包
submitPack: function () {
console.log("开始提交。。。。");
var appName = this.apppackAppNameInputNode.get("value");
console.log(appName);
if (!appName || appName === "") {
......
......@@ -222,6 +222,7 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_tips1": "⚠️ Currently, the online packaging function of mobile app only supports Android.",
"mobile_apppack_tips2": "⚠️ If you need to package online, you must register and log in to [云服务配置] .",
"mobile_apppack_tips3": "⚠️ After submitting the information, the current packing status will be displayed. The packing process takes a long time. You can leave the current page first, wait for the packing to complete, and then download the APK file from this page.",
"mobile_apppack_status_label": "current state",
"mobile_apppack_form_appName": "App Name",
"mobile_apppack_form_appName_tip": "App Desktop display name, no more than 6 words",
......@@ -241,7 +242,9 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_message_o2cloud_not_login": "Please log in to O2 cloud first!",
"mobile_apppack_message_apppack_server_login_fail": "App package server login failed!",
"mobile_apppack_message_check_connect_fail": "App packaging service check connection failed!",
"mobile_apppack_status_order_inline": "In line ......",
"mobile_apppack_status_packing": "Packing......",
"mobile_apppack_status_pack_end": "Package complete",
"mobile_apppack_message_appname_not_empty": "App name cannot be empty!",
"mobile_apppack_message_appname_len_max_6": "App name cannot exceed 6 words!",
"mobile_apppack_message_app_logo_not_empty": "Logo image cannot be empty!",
......
......@@ -220,6 +220,7 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_tips1": "⚠️ 当前移动App在线打包功能只支持Android端。",
"mobile_apppack_tips2": "⚠️ 需要在线打包,必须先到[云服务配置]中进行注册、登录。",
"mobile_apppack_tips3": "⚠️ 提交信息后,会显示当前打包状态,打包过程耗时较长,你可以先离开当前页面,等待打包完成后来本页面下载APK文件。",
"mobile_apppack_status_label": "当前状态",
"mobile_apppack_form_appName": "App名称",
"mobile_apppack_form_appName_tip": "app桌面显示名称,字数不超过6个",
......@@ -240,6 +241,9 @@ MWF.xApplication.Setting.LP = {
"mobile_apppack_message_apppack_server_login_fail": "App打包服务器登录失败!",
"mobile_apppack_message_check_connect_fail": "App打包服务检查连接失败!",
"mobile_apppack_status_order_inline": "排队中......",
"mobile_apppack_status_packing": "打包中......",
"mobile_apppack_status_pack_end": "打包完成",
"mobile_apppack_message_appname_not_empty": "App名称不能为空!",
"mobile_apppack_message_appname_len_max_6": "App名称不能超过6个字!",
"mobile_apppack_message_app_logo_not_empty": "Logo图片不能为空!",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册