Commit 34253ff3 authored by rockyl's avatar rockyl

修改上传

parent 575723b0
......@@ -3,7 +3,7 @@
const program = require('commander');
program
.version('1.0.1')
.version('1.0.2')
.description('game command line interface')
.command('init [name]', 'Initialize a project with template').alias('i')
.command('mock', 'Mock server').alias('m')
......
const path = require('path');
const program = require('commander');
const {exit, getProjectConfig} = require('./tools');
const ossUpload = require('./oss-upload');
......@@ -10,11 +11,13 @@ program
async function execute() {
let remotePath;
let version = program.versionCode;
let releasePath = './bin-release/web/';
const gameProjectConfig = getProjectConfig();
if(gameProjectConfig){
remotePath = gameProjectConfig['remote-path'];
version = version ? version : gameProjectConfig['version'];
releasePath = gameProjectConfig['release-path'];
}
if(version){
......@@ -22,7 +25,7 @@ async function execute() {
if(remotePath){
try {
await ossUpload({
localDir: './bin-release/web/' + version,
localDir: path.join(releasePath, version),
remoteDir: `/db_games/${remotePath}/${version}`
}, program.mode);
}catch (e) {
......
......@@ -41,7 +41,10 @@ function handler(request, response) {
const headers = {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Origin': 'http://localhost:3001',
'Access-Control-Allow-Credentials': 'true',
'Access-Control-Allow-Methods': 'POST,GET,PUT,OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type,Access-Token',
};
if (content) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment