Bläddra i källkod

修改接口前

JXDS18FUJT 1 år sedan
förälder
incheckning
9fab13c094
5 ändrade filer med 38 tillägg och 23 borttagningar
  1. 12 0
      src/api/modules/openApi.ts
  2. 1 1
      src/api/request.ts
  3. 4 3
      src/model/test.ts
  4. 3 1
      src/views/exercise/index.vue
  5. 18 18
      vite.config.ts

+ 12 - 0
src/api/modules/openApi.ts

@@ -12,5 +12,17 @@ class Wx {
 
 		});
 	}
+	selectTestK14QuestionInfoListnN(params:{
+		subject?:number
+	}):AxiosPromise<any>{
+		return request({
+			url: "/open-api/question/info/selectTestK14QuestionInfoListnN",
+			params,
+			method:'GET'
+
+		});
+	}
+
+
 }
 export const openApi  = new Wx()

+ 1 - 1
src/api/request.ts

@@ -3,7 +3,7 @@ import { requestLogger, responseLogger } from "axios-logger";
 import store from "@/store";
 import { Toast } from "vant";
 const request = axios.create({
-	baseURL: import.meta.env.MODE === "production" ? "https://jpcj.zzxcx.net/prod-api/" : "https://jpcj1.zzxcx.net/jpcj-admin/",
+	baseURL: import.meta.env.MODE === "production" ? "https://jpcj.zzxcx.net/prod-api/" : "http://192.168.8.63:8080/",
 });
 
 request.interceptors.request.use((config) => {

+ 4 - 3
src/model/test.ts

@@ -1,4 +1,5 @@
-import { test } from "@/api";
+import { openApi, test } from "@/api";
+import { LocationQuery } from "vue-router";
 
 class TestModel {
 	/** 根据不同类型获取分类 */
@@ -97,8 +98,8 @@ class TestModel {
 	}
 
 	/** 获取免费题目列表 */
-	async getFreeList(params: Test.listParams) {
-		const res = await test.getFreeList(params);
+	async getFreeList(params:LocationQuery) {
+		const res = await openApi.selectTestK14QuestionInfoListnN(params);
 
 		const data = {
 			total: res.data.total,

+ 3 - 1
src/views/exercise/index.vue

@@ -13,4 +13,6 @@
 	});
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+
+</style>

+ 18 - 18
vite.config.ts

@@ -22,25 +22,25 @@ export default defineConfig({
 		}
 	},
 	server: {
-		host: "jpcj-h5.zzxcx.net",
-		port: 443,
-		https: {
-			key: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.key"),
-			cert: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.pem"),
-		},
-		proxy: {
-			"/dev-api": {
-				target: "https://jpcj1.zzxcx.net/jpcj-admin",
-				changeOrigin: true,
+		// host: "jpcj-h5.zzxcx.net",
+		// port: 443,
+		// https: {
+		// 	key: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.key"),
+		// 	cert: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.pem"),
+		// },
+		// proxy: {
+		// 	"/dev-api": {
+		// 		target: "https://jpcj1.zzxcx.net/jpcj-admin",
+		// 		changeOrigin: true,
 
-				rewrite: (path) => path.replace(/^\/dev-api/, ""),
-			},
-			"/prod-api": {
-				target: "https://jpcj.zzxcx.net/jpcj-admin",
-				changeOrigin: true,
+		// 		rewrite: (path) => path.replace(/^\/dev-api/, ""),
+		// 	},
+		// 	"/prod-api": {
+		// 		target: "https://jpcj.zzxcx.net/jpcj-admin",
+		// 		changeOrigin: true,
 
-				rewrite: (path) => path.replace(/^\/prod-api/, ""),
-			},
-		},
+		// 		rewrite: (path) => path.replace(/^\/prod-api/, ""),
+		// 	},
+		// },
 	},
 });