Browse Source

添加线上api 配置

liwei 1 year ago
parent
commit
c49f50deb8
4 changed files with 19 additions and 16 deletions
  1. 1 1
      scripts/deployAssetsToOss.js
  2. 11 9
      scripts/deployHtmlToServer.js
  3. 2 1
      src/dict/apis.ts
  4. 5 5
      vue.config.js

+ 1 - 1
scripts/deployAssetsToOss.js

@@ -4,7 +4,7 @@ const co = require('co');
 const path = require('path');
 const fs = require('fs');
 
-const cdnpath = `/cloud/v1/`;
+const cdnpath = `/queenshow/`;
 const client = new OSS({
     region: 'oss-cn-chengdu',
     accessKeyId: 'LTAI4GHqGdgY3b14jVRTzL2w',

+ 11 - 9
scripts/deployHtmlToServer.js

@@ -8,19 +8,21 @@ var nativePath = `dist/temp`;
 //创建临时目录
 fs.mkdirSync(nativePath);
 
-// var indexHtml = fs.readFileSync('dist/index.html');
-// fs.writeFileSync(nativePath + path.sep + 'index.html', indexHtml);
+var indexHtml = fs.readFileSync('dist/index.html');
+fs.writeFileSync(nativePath + path.sep + 'index.html', indexHtml);
 
-var shareHtml = fs.readFileSync('dist/share.html');
-fs.writeFileSync(nativePath + path.sep + 'share.html', shareHtml);
+var editHtml = fs.readFileSync('dist/editor.html');
+fs.writeFileSync(nativePath + path.sep + 'editor.html', editHtml);
+// var shareHtml = fs.readFileSync('dist/share.html');
+// fs.writeFileSync(nativePath + path.sep + 'share.html', shareHtml);
 
-var shareHtml = fs.readFileSync('dist/login.html');
-fs.writeFileSync(nativePath + path.sep + 'login.html', shareHtml);
+// var shareHtml = fs.readFileSync('dist/login.html');
+// fs.writeFileSync(nativePath + path.sep + 'login.html', shareHtml);
 
-var consoleHtml = fs.readFileSync('dist/console.html');
-fs.writeFileSync(nativePath + path.sep + 'console.html', consoleHtml);
+// var consoleHtml = fs.readFileSync('dist/console.html');
+// fs.writeFileSync(nativePath + path.sep + 'console.html', consoleHtml);
 
-var serverPath = `/var/www/3dqueencloud/`;
+var serverPath = `/var/www/html/projects/queenshow`;
 
 var ftpUtils = new sftp({
     remotePath: serverPath,

+ 2 - 1
src/dict/apis.ts

@@ -7,7 +7,8 @@ const treeVersion = "/tree/v1";
 const Dict_Apis = {
   auth: `${baseURL}${baseVersion}/usercenter`,
   queentree: `${baseURL}${treeVersion}/assetcenter`,
-  promotion: `${localURL}/promotion`,
+  promotion: `${baseURL}${baseVersion}/promotion`,
+  // promotion: `${localURL}/promotion`,
 };
 
 export { Dict_Apis };

+ 5 - 5
vue.config.js

@@ -7,11 +7,11 @@ const {
 } = require("@ckeditor/ckeditor5-dev-translations");
 const { styles } = require("@ckeditor/ckeditor5-dev-utils");
 
-// const publicPath =
-//   process.env.NODE_ENV === "production"
-//     ? `//infishwaibao.oss-cn-chengdu.aliyuncs.com/cloud/v1/`
-//     : "./";
-const publicPath = "./";
+const publicPath =
+  process.env.NODE_ENV === "production"
+    ? `//infishwaibao.oss-cn-chengdu.aliyuncs.com/queenshow/`
+    : "./";
+// const publicPath = "./";
 
 module.exports = defineConfig({
   pages: {