Parcourir la source

提交一下

1
mo il y a 2 ans
Parent
commit
b1cefd3556
3 fichiers modifiés avec 18 ajouts et 3 suppressions
  1. 15 1
      config/index.js
  2. 2 1
      config/prod.env.js
  3. 1 1
      src/api/login.js

+ 15 - 1
config/index.js

@@ -10,7 +10,21 @@ module.exports = {
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: {},
+    proxyTable: {
+      '/api-web': {
+        target: proxyUrl,
+        changeOrigin: true
+      },
+      '/api-admin': {
+        target: proxyUrl,
+        changeOrigin: true
+      },
+      '/api-auth': {
+        target: proxyUrl,
+        changeOrigin: true,
+        rewrite: path => path.replace(/^\/gitee/, '/api-auth')
+      }
+    },
 
     // Various Dev Server settings
     host: 'localhost', // can be overwritten by process.env.HOST

+ 2 - 1
config/prod.env.js

@@ -1,5 +1,6 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  BASE_API: '"http://admin-api.macrozheng.com"'
+
 }
+// /   BASE_API: '"http://admin-api.macrozheng.com"'

+ 1 - 1
src/api/login.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function login(username, password) {
   return request({
-    url: '/admin/login',
+    url: '/admin/login/token',
     method: 'post',
     data: {
       username,