Jeremy il y a 3 ans
Parent
commit
8044319565

+ 1 - 0
VinnoManagementSystem/package.json

@@ -4,6 +4,7 @@
 	"private": true,
 	"scripts": {
 		"dev": "vue-cli-service serve",
+		"serve": "vue-cli-service serve",
 		"build": "vue-cli-service build --report",
 		"lint": "vue-cli-service lint"
 	},

+ 2 - 1
VinnoManagementSystem/src/api/index.js

@@ -2,7 +2,8 @@
  * @description 自动import导入所有 api 模块
  */
 
-const files = require.context('./model', false, /\.js$/)
+//const files = require.context('./wing', false, /\.js$/)
+const files = require.context('./mock', false, /\.js$/)
 const modules = {}
 files.keys().forEach((key) => {
 	modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default

+ 0 - 0
VinnoManagementSystem/src/api/model/auth.js → VinnoManagementSystem/src/api/mock/auth.js


+ 0 - 0
VinnoManagementSystem/src/api/model/common.js → VinnoManagementSystem/src/api/mock/common.js


+ 0 - 0
VinnoManagementSystem/src/api/model/demo.js → VinnoManagementSystem/src/api/mock/demo.js


+ 0 - 0
VinnoManagementSystem/src/api/model/system.js → VinnoManagementSystem/src/api/mock/system.js


+ 22 - 0
VinnoManagementSystem/src/api/wing/wing.js

@@ -0,0 +1,22 @@
+import config from "@/config"
+import http from "@/utils/request"
+import common from "@/utils/common"
+
+export default {
+    post: async function (method, datas = {}) {
+        return await http.post(config.API_URL, {
+            "jsonrpc": "2.0",
+            "id": common.guid(),
+            "method": method,
+            "params": [datas]
+        });
+    },
+    get: async function (method, datas = {}) {
+        return await http.post(config.API_URL, {
+            "jsonrpc": "2.0",
+            "id": common.guid(),
+            "method": method,
+            "params": [datas]
+        });
+    },
+}

+ 2 - 2
VinnoManagementSystem/src/config/index.js

@@ -1,6 +1,6 @@
 const DEFAULT_CONFIG = {
 	//标题
-	APP_NAME: "SCUI",
+	APP_NAME: "Flyinsono",
 
 	//首页地址
 	DASHBOARD_URL: "/dashboard",
@@ -12,7 +12,7 @@ const DEFAULT_CONFIG = {
 	CORE_VER: "1.5.0",
 
 	//接口地址
-	API_URL: "/api",
+	API_URL: "/mock",
 
 	//请求超时
 	TIMEOUT: 10000,

+ 8 - 0
VinnoManagementSystem/src/utils/common.js

@@ -0,0 +1,8 @@
+export default {
+    guid: function() {
+        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+            var r = Math.random() * 16 | 0; var v = c === 'x' ? r : (r & 0x3 | 0x8)
+            return v.toString(16)
+        })
+    }
+}

+ 8 - 1
VinnoManagementSystem/vue.config.js

@@ -13,11 +13,18 @@ module.exports = {
 		port: 2800, //挂载端口
 		proxy: {
 			'/api': {
-				target: 'https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api',
+				target: 'http://192.168.6.117/IManagementService',
 				ws: true,
 				pathRewrite: {
 					'^/api': '/'
 				}
+			},
+			'/mock': {
+				target: 'https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api',
+				ws: true,
+				pathRewrite: {
+					'^/mock': '/'
+				}
 			}
 		}
 	},