|
|
@ -95,7 +95,7 @@
|
|
|
|
<tr class="picbox">
|
|
|
|
<tr class="picbox">
|
|
|
|
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>上传原包</td>
|
|
|
|
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>上传原包</td>
|
|
|
|
<td class="r">
|
|
|
|
<td class="r">
|
|
|
|
<span class=" table_btn table_uploads">
|
|
|
|
<span class=" table_btn table_uploads">
|
|
|
|
<div id="uploader" class="wu-example">
|
|
|
|
<div id="uploader" class="wu-example">
|
|
|
|
<div class="btns">
|
|
|
|
<div class="btns">
|
|
|
|
<div id="picker">上传原包</div>
|
|
|
|
<div id="picker">上传原包</div>
|
|
|
@ -104,15 +104,14 @@
|
|
|
|
<div id="thelist" class="uploader-list">
|
|
|
|
<div id="thelist" class="uploader-list">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<input type="hidden" id="data" name="data" value="000"/>
|
|
|
|
<input type="hidden" id="data" name="data" value=""/>
|
|
|
|
<input type="hidden" id="file_id" name="file_id" value="{$data['file_id']}"/>
|
|
|
|
<input type="hidden" id="file_name" name="file_name" value=""/>
|
|
|
|
<input type="hidden" id="file_name" name="file_name" value="{$data['file_name']}"/>
|
|
|
|
<input type="hidden" id="file_url" name="file_url" value=""/>
|
|
|
|
<input type="hidden" id="file_url" name="file_url" value="{$data['file_url']}"/>
|
|
|
|
<input type="hidden" id="file_size" name="file_size" value=""/>
|
|
|
|
<input type="hidden" id="file_size" name="file_size" value="{$data['file_size']}"/>
|
|
|
|
<input type="hidden" id="package_name" name="bao_name" value=""/>
|
|
|
|
<input type="hidden" id="file_name2" name="file_name2" value="{$data['file_name2']}"/>
|
|
|
|
<input type="hidden" id="package_version" name="version" value=""/>
|
|
|
|
<input type="hidden" id="file_url2" name="file_url2" value="{$data['file_url2']}"/>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span class="notice-text">更新原包后会自动进行推广员游戏包更新,打包完成后,对应推广员下的游戏包无需更新,渠道玩家即可下载最新版游戏包(前提:服务器开启定时任务)</span>
|
|
|
|
<span class="notice-text">更新原包后会自动进行推广员游戏包更新,打包完成后,对应推广员下的游戏包无需更新,渠道玩家即可下载最新版游戏包(前提:服务器开启定时任务)</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<!-- <td class="l pack_name_class">原包名称:</td>
|
|
|
|
<!-- <td class="l pack_name_class">原包名称:</td>
|
|
|
|
<td class="r pack_name_class" colspan='1'>
|
|
|
|
<td class="r pack_name_class" colspan='1'>
|
|
|
@ -123,20 +122,20 @@
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td class="l"><i class="mustmark" style="margin-left:-7px;display:none" id="apply_bz">*</i>包名:</td>
|
|
|
|
<td class="l"><i class="mustmark" style="margin-left:-7px;display:none" id="apply_bz">*</i>包名:</td>
|
|
|
|
<td class="r">
|
|
|
|
<td class="r">
|
|
|
|
<input type="text" class="txt" name="bao_name" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
<input type="text" class="txt" id="show_package_name" name="bao_name" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td class="l">原包版本:</td>
|
|
|
|
<td class="l">原包版本:</td>
|
|
|
|
<td class="r">
|
|
|
|
<td class="r">
|
|
|
|
<input type="text" class="txt" name="version" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
<input type="text" class="txt" id="show_package_version" name="version" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<td class="l">原包大小:</td>
|
|
|
|
<td class="l">原包大小:</td>
|
|
|
|
<td class="r">
|
|
|
|
<td class="r">
|
|
|
|
<input type="text" class="txt" name="gsize" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
<input type="text" class="txt" id="show_package_size" name="gsize" style="background:#E7E7E7" value="无需填写,自动生成" disabled="disabled">
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
@ -176,7 +175,7 @@
|
|
|
|
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
|
|
|
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
//导航高亮
|
|
|
|
//导航高亮
|
|
|
|
highlight_subnav('{:U('GameSource/lists')}');
|
|
|
|
highlight_subnav("{:U('GameSource/lists')}");
|
|
|
|
$('#submit').click(function(){
|
|
|
|
$('#submit').click(function(){
|
|
|
|
$('#form').submit();
|
|
|
|
$('#form').submit();
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -201,7 +200,7 @@ $(function(){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var userInfo = {userId:"kazaff", md5:""}; //用户会话信息
|
|
|
|
var userInfo = {userId:"kazaff", md5:""}; //用户会话信息
|
|
|
|
var chunkSize = 5000 * 1024; //分块大小
|
|
|
|
var chunkSize = 2 * 1000 * 1024; //分块大小
|
|
|
|
var uniqueFileName = null; //文件唯一标识符
|
|
|
|
var uniqueFileName = null; //文件唯一标识符
|
|
|
|
var md5Mark = null;
|
|
|
|
var md5Mark = null;
|
|
|
|
var backEndUrl = "{:U('File/shard_upload',array('session_id'=>session_id()))}";
|
|
|
|
var backEndUrl = "{:U('File/shard_upload',array('session_id'=>session_id()))}";
|
|
|
@ -222,32 +221,24 @@ WebUploader.Uploader.register({
|
|
|
|
userInfo.md5 = val;
|
|
|
|
userInfo.md5 = val;
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: "POST"
|
|
|
|
type: "POST"
|
|
|
|
, url: backEndUrl
|
|
|
|
, url: 'http://47.111.118.107:9501/upload/check-md5'
|
|
|
|
, data: {status: "md5Check", md5: val}
|
|
|
|
, data: {fileMd5: val, fileName: file.name}
|
|
|
|
, cache: false
|
|
|
|
, cache: false
|
|
|
|
, timeout: 1000 //todo 超时的话,只能认为该文件不曾上传过
|
|
|
|
, timeout: 1000 //todo 超时的话,只能认为该文件不曾上传过
|
|
|
|
, dataType: "json"
|
|
|
|
, dataType: "json"
|
|
|
|
}).then(function(data, textStatus, jqXHR){
|
|
|
|
}).then(function(response, textStatus, jqXHR) {
|
|
|
|
alert(data.chunk);
|
|
|
|
task.resolve();
|
|
|
|
//console.log(data);
|
|
|
|
uniqueFileName = response.data.chunkFileName
|
|
|
|
if(data.ifExist){ //若存在,这返回失败给WebUploader,表明该文件不需要上传
|
|
|
|
userInfo.chunkFileName = response.data.chunkFileName
|
|
|
|
task.reject();
|
|
|
|
|
|
|
|
uploader.skipFile(file);
|
|
|
|
|
|
|
|
file.path = data.path;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
task.resolve();
|
|
|
|
|
|
|
|
//拿到上传文件的唯一名称,用于断点续传
|
|
|
|
|
|
|
|
uniqueFileName = md5(''+userInfo.userId+file.name+file.type+file.lastModifiedDate+file.size);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, function(jqXHR, textStatus, errorThrown){ //任何形式的验证失败,都触发重新上传
|
|
|
|
}, function(jqXHR, textStatus, errorThrown){ //任何形式的验证失败,都触发重新上传
|
|
|
|
task.resolve();
|
|
|
|
task.resolve();
|
|
|
|
//拿到上传文件的唯一名称,用于断点续传
|
|
|
|
//拿到上传文件的唯一名称,用于断点续传
|
|
|
|
uniqueFileName = md5(''+userInfo.userId+file.name+file.type+file.lastModifiedDate+file.size);
|
|
|
|
// uniqueFileName = md5(''+userInfo.userId+file.name+file.type+file.lastModifiedDate+file.size);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return $.when(task);
|
|
|
|
return $.when(task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
, beforeSend: function(block){
|
|
|
|
/* , beforeSend: function(block){
|
|
|
|
//分片验证是否已传过,用于断点续传
|
|
|
|
//分片验证是否已传过,用于断点续传
|
|
|
|
var task = new $.Deferred();
|
|
|
|
var task = new $.Deferred();
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
@ -273,7 +264,7 @@ WebUploader.Uploader.register({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return $.when(task);
|
|
|
|
return $.when(task);
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
, afterSendFile: function(file){
|
|
|
|
, afterSendFile: function(file){
|
|
|
|
var chunksTotal = 0;
|
|
|
|
var chunksTotal = 0;
|
|
|
|
if((chunksTotal = Math.ceil(file.size/chunkSize)) > 1){
|
|
|
|
if((chunksTotal = Math.ceil(file.size/chunkSize)) > 1){
|
|
|
@ -281,23 +272,28 @@ WebUploader.Uploader.register({
|
|
|
|
var task = new $.Deferred();
|
|
|
|
var task = new $.Deferred();
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: "POST"
|
|
|
|
type: "POST"
|
|
|
|
, url: backEndUrl
|
|
|
|
, url: 'http://47.111.118.107:9501/upload/merge-chunks'
|
|
|
|
, data: {
|
|
|
|
, data: {
|
|
|
|
status: "chunksMerge"
|
|
|
|
chunkFileName: uniqueFileName
|
|
|
|
, name: uniqueFileName
|
|
|
|
|
|
|
|
, chunks: chunksTotal
|
|
|
|
, chunks: chunksTotal
|
|
|
|
, ext: file.ext
|
|
|
|
, extension: file.ext
|
|
|
|
, md5: md5Mark
|
|
|
|
, md5: md5Mark
|
|
|
|
}
|
|
|
|
}
|
|
|
|
, cache: false
|
|
|
|
, cache: false
|
|
|
|
, dataType: "json"
|
|
|
|
, dataType: "json"
|
|
|
|
}).then(function(data, textStatus, jqXHR){
|
|
|
|
}).then(function(response, textStatus, jqXHR){
|
|
|
|
|
|
|
|
console.log(response)
|
|
|
|
//todo 检查响应是否正常
|
|
|
|
//todo 检查响应是否正常
|
|
|
|
task.resolve();
|
|
|
|
task.resolve();
|
|
|
|
file.path = data.path;
|
|
|
|
file.path = data.path;
|
|
|
|
$("#file_name").val(data.name);
|
|
|
|
$("#file_name").val(response.data.fileName);
|
|
|
|
$("#file_url").val(data.path);
|
|
|
|
$("#file_url").val(response.data.filePath);
|
|
|
|
$("#file_size").val(file.size);
|
|
|
|
$("#file_size").val(file.size);
|
|
|
|
|
|
|
|
$("#package_name").val(response.data.packageName);
|
|
|
|
|
|
|
|
$("#package_version").val(response.data.packageVersion);
|
|
|
|
|
|
|
|
$("#show_package_name").val(response.data.packageName);
|
|
|
|
|
|
|
|
$("#show_package_size").val(parseFloat(file.size/(1024*1024)).toFixed(2) + 'M');
|
|
|
|
|
|
|
|
$("#show_package_version").val(response.data.packageVersion);
|
|
|
|
}, function(jqXHR, textStatus, errorThrown){
|
|
|
|
}, function(jqXHR, textStatus, errorThrown){
|
|
|
|
task.reject();
|
|
|
|
task.reject();
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -313,7 +309,7 @@ var uploader = new WebUploader.Uploader({
|
|
|
|
// swf文件路径
|
|
|
|
// swf文件路径
|
|
|
|
swf: '__STATIC__/webuploader/Uploader.swf',
|
|
|
|
swf: '__STATIC__/webuploader/Uploader.swf',
|
|
|
|
// 文件接收服务端。
|
|
|
|
// 文件接收服务端。
|
|
|
|
server: "{:U('File/shard_upload',array('session_id'=>session_id()))}",
|
|
|
|
server: 'http://47.111.118.107:9501/upload/index',
|
|
|
|
// 选择文件的按钮。可选。
|
|
|
|
// 选择文件的按钮。可选。
|
|
|
|
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
|
|
|
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
|
|
|
pick: {id:'#picker'},
|
|
|
|
pick: {id:'#picker'},
|
|
|
@ -334,7 +330,7 @@ var uploader = new WebUploader.Uploader({
|
|
|
|
formData: function(){return $.extend(true, {}, userInfo);},
|
|
|
|
formData: function(){return $.extend(true, {}, userInfo);},
|
|
|
|
duplicate:true,
|
|
|
|
duplicate:true,
|
|
|
|
chunked:true,
|
|
|
|
chunked:true,
|
|
|
|
chunkSize: 5*1000*1024,
|
|
|
|
chunkSize: chunkSize,
|
|
|
|
duplicate: true
|
|
|
|
duplicate: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -367,11 +363,11 @@ uploader.on( 'uploadSuccess', function( file , response) {
|
|
|
|
$( '#'+file.id ).find('p.state').text('已上传');
|
|
|
|
$( '#'+file.id ).find('p.state').text('已上传');
|
|
|
|
// alert(JSON.stringify(response));
|
|
|
|
// alert(JSON.stringify(response));
|
|
|
|
|
|
|
|
|
|
|
|
if(!response.chunk){
|
|
|
|
/* if(!response.chunk){
|
|
|
|
$("#file_name").val(response.name);
|
|
|
|
$("#file_name").val(response.name);
|
|
|
|
$("#file_url").val(response.path);
|
|
|
|
$("#file_url").val(response.path);
|
|
|
|
$("#file_size").val(response.size);
|
|
|
|
$("#file_size").val(response.size);
|
|
|
|
}
|
|
|
|
} */
|
|
|
|
//alert($("#file_name").val()+";"+$("#file_url").val()+";"+$("#file_size").val())
|
|
|
|
//alert($("#file_name").val()+";"+$("#file_url").val()+";"+$("#file_size").val())
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|