├── .gitignore ├── .idea ├── Ttel-Server-Koa.iml ├── dbnavigator.xml ├── misc.xml ├── modules.xml ├── vcs.xml ├── watcherTasks.xml └── workspace.xml ├── README.md ├── app.js ├── app ├── controllers │ └── appInfo_controller.js ├── db │ └── dbHelper.js ├── error │ ├── api_error.js │ ├── appInfo_error.js │ └── index.js ├── middleWares │ ├── log_util.js │ └── response_formatter.js ├── model │ └── appInfo_model.js ├── routes │ ├── appInfo_router.js │ ├── index.js │ └── plist_router.js ├── service │ ├── appInfo_service.js │ ├── email_service.js │ └── pushNoti_service.js └── supportingFiles │ ├── pngdefry-linux │ ├── pngdefry-osx │ └── template.plist ├── bin ├── init │ ├── cer │ │ └── generate-certificate.sh │ ├── prepareCerNDir.js │ ├── setupDatabase.js │ └── sql │ │ └── app_info.sql └── www ├── config ├── envi_config.js └── log_config.js ├── package.json ├── pm2.json ├── public ├── css │ └── Index.css ├── img │ ├── index_bg.jpg │ └── qr_code.png ├── index.html ├── js │ ├── index.js │ └── jquery.js └── stylesheets │ └── style.css └── views ├── error.pug ├── index.pug └── layout.pug /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | node_modules/ 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | 65 | Packages/ 66 | PerfectTemplate.xcodeproj 67 | Tests/ 68 | webroot/ 69 | -------------------------------------------------------------------------------- /.idea/Ttel-Server-Koa.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/dbnavigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
144 |
145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 |
542 | 543 | 544 | 545 |
-------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 134 | 135 | 136 | 137 | ApiError 138 | rorHa---------- 139 | nhandled Rejection at: Pr 140 | dev.app_info' doesn't exist 141 | sdfhljklj 142 | global 143 | " 144 | format 145 | onerror 146 | console 147 | walkFile 148 | sql脚本执行结束 149 | sqlContentMap 150 | getSqlContentMap 151 | underscore 152 | serverD-> 153 | path 154 | formatReqLog 155 | envi_config 156 | log_config 157 | sqlite3 158 | mysql 159 | pug 160 | fs-extra 161 | mustache 162 | dbushell-grunt-mustatic 163 | shelljs 164 | strftime 165 | exec_mode 166 | 10 167 | 168 | 169 | 170 | const 171 | ' 172 | 173 | 174 | 175 | 177 | 178 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | true 240 | 241 | false 242 | true 243 | 244 | 245 | true 246 | DEFINITION_ORDER 247 | 248 | 249 | 250 | 251 | 252 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 281 | 282 | 285 | 286 | 287 | 288 | 291 | 292 | 295 | 296 | 299 | 300 | 301 | 302 | 305 | 306 | 309 | 310 | 313 | 314 | 315 | 316 | 319 | 320 | 323 | 324 | 327 | 328 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 342 | 343 | 346 | 347 | 348 | 349 | 352 | 353 | 356 | 357 | 360 | 361 | 362 | 363 | 366 | 367 | 370 | 371 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 9 | 10 | 11 | 12 |
༺ Ttel ༻
13 |
APP内测分发平台
14 |
15 | 16 |
17 | 扫描二维码,并使用浏览器打开 18 |
19 | 20 |
21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/js/index.js: -------------------------------------------------------------------------------- 1 | // create by weiwei 2 | 3 | var G_URL_SERVER = getHttpHead(window.location.href) + "apiv1/"; 4 | 5 | var u = navigator.userAgent, 6 | app = navigator.appVersion; 7 | var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器 8 | var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 9 | var downloadUrl = ""; 10 | 11 | $(function() { 12 | // init 13 | // change btn style to disable 14 | document.getElementById("downloadBtn").disabled = true; 15 | document.getElementById("downloadBtn").style.backgroundColor = "gray"; 16 | 17 | $('.qr_code_img').attr("src","http://qr.liantu.com/api.php?&bg=F0F6FC&text="+window.location.href); 18 | 19 | var paramStr; 20 | 21 | if(isiOS) { 22 | paramStr = "pageNo=1&pageSize=100&platform=1"; 23 | $("#cerBtn").show(); 24 | 25 | } else { 26 | paramStr = "pageNo=1&pageSize=100&platform=2"; 27 | $("#cerBtn").hide(); 28 | } 29 | 30 | // 查询所有产品最新版本 app/listAllProds 31 | startHttpRequest("get", "app/listAllProds", paramStr, function(status, message, jsonData) { 32 | console.log("success"); 33 | 34 | var arrOfData = jsonData; 35 | 36 | var dictOfItem; 37 | for(var i = 0; i < arrOfData.length; i++) { 38 | 39 | if(arrOfData[i].prodType == "1031") { 40 | dictOfItem = arrOfData[i]; 41 | } 42 | } 43 | 44 | console.log(dictOfItem); 45 | 46 | if(dictOfItem) { 47 | 48 | downloadUrl = dictOfItem.downloadUrl; 49 | 50 | // change btn style to enable 51 | document.getElementById("downloadBtn").disabled = false; 52 | document.getElementById("downloadBtn").style.backgroundColor = "rgba(35,150,255,0.6)" 53 | } else { 54 | 55 | document.getElementById("tip").hidden = false; 56 | } 57 | }); 58 | }) 59 | 60 | function download_btn_click() { 61 | 62 | window.location.href = downloadUrl; 63 | } 64 | 65 | function cerBtn_btn_click() { 66 | 67 | window.location.href = getHttpHead(window.location.href) + "cer/pubCer/selfSigned_pubCA.cer"; 68 | } 69 | 70 | //网络请求入口 71 | function startHttpRequest(method, url, postData, callback) { 72 | var queryUrl = G_URL_SERVER + url; 73 | 74 | console.log(queryUrl); 75 | console.log(postData); 76 | $.ajax({ 77 | contentType: "application/json; charset=utf-8", 78 | dataType: "json", 79 | url: queryUrl, 80 | type: method, 81 | data: postData, 82 | cache: false, 83 | async: true, 84 | success: function(result) { 85 | if(1 == result.code) { 86 | console.log(result); 87 | callback(result.status, result.message, result.data); 88 | } else { 89 | console.log("请求失败") 90 | } 91 | }, 92 | error: function(result) { 93 | console.log(JSON.stringify(result)); 94 | } 95 | }); 96 | } 97 | 98 | function getHttpHead(s) { 99 | var r = new RegExp("(http.*\/\/[^\/]+\/)"); 100 | var a = r.exec(s); 101 | if(a) { 102 | return a[1]; 103 | } 104 | } -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= title 5 | p Welcome to #{title} 6 | -------------------------------------------------------------------------------- /views/layout.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | --------------------------------------------------------------------------------