瀏覽代碼

部署多套环境

Michael Wang 6 年之前
父節點
當前提交
7435c51251
共有 3 個文件被更改,包括 6 次插入32 次删除
  1. 1 6
      .env.production
  2. 2 2
      src/views/index.vue
  3. 3 24
      vue.config.js

+ 1 - 6
.env.production

@@ -6,9 +6,4 @@ VUE_APP_UPYUN_OPERATOR=examcloud
 VUE_APP_UPYUN_PASSWORD=examcloud123456
 VUE_APP_UPYUN_SERVER=v0.api.upyun.com
 VUE_APP_UPYUN_BUCKET=exam-cloud
-VUE_APP_UPYUN_BUCKETURL=/exam-cloud/student_base_photo/
-
-VUE_APP_MYSQL_HOST=rds7b2sll8un5kz99s0io.mysql.rds.aliyuncs.com
-VUE_APP_MYSQL_USER_NAME=exam_cloud
-VUE_APP_MYSQL_PASSWORD=examcloud123!@#
-VUE_APP_MYSQL_DATABASE=exam_cloud
+VUE_APP_UPYUN_BUCKETURL=/exam-cloud/student_base_photo/

+ 2 - 2
src/views/index.vue

@@ -321,7 +321,7 @@ export default {
       } else {
         return new Promise((resolve, reject) => {
           this.$http
-            .get("/api/ecs_core/faceset/getUsableFacesetList")
+            .get("/api/ecs_core/face/getUsableFacesetList")
             .then(res => {
               if (res.data.length < 1) {
                 reject("获取facesetToken失败: 没有可用的facesetToken");
@@ -407,7 +407,7 @@ export default {
       photoName
     }) {
       return this.$http
-        .post("/api/ecs_core/faceset/saveStudentFace", {
+        .post("/api/ecs_core/face/saveStudentFace", {
           rootOrgId,
           studentId,
           facesetToken: faceSetToken,

+ 3 - 24
vue.config.js

@@ -8,41 +8,20 @@ let proxy = {
     target: "https://api-cn.faceplusplus.com",
     changeOrigin: true
   },
-  "/exam-cloud-test/student_base_photo": {
+  [process.env.VUE_APP_UPYUN_BUCKETURL]: {
     secure: false,
     target: "http://v0.api.upyun.com",
     changeOrigin: true
   },
-  "/exam-cloud-test": {
+  [process.env.VUE_APP_UPYUN_BUCKET]: {
     secure: false,
     target: "http://v0.api.upyun.com",
     changeOrigin: true
   }
 };
-// let proxyProd = {
-//   "/api/ecs_core": {
-//     target: "https://ecs.qmth.com.cn:8878", //代理跨域转地址,基础信息
-//     changeOrigin: true
-//   },
-//   "/facepp/v3": {
-//     secure: false,
-//     target: "https://api-cn.faceplusplus.com",
-//     changeOrigin: true
-//   },
-//   "/exam-cloud/student_base_photo/": {
-//     secure: false,
-//     target: "http://v0.api.upyun.com",
-//     changeOrigin: true
-//   },
-//   "/exam-cloud": {
-//     secure: false,
-//     target: "http://v0.api.upyun.com",
-//     changeOrigin: true
-//   }
-// };
 
 module.exports = {
   devServer: {
-    proxy: proxy
+    proxy
   }
 };