From b8d9e3a6bf8089800c1b7f7e605e7ed9c57b67e8 Mon Sep 17 00:00:00 2001 From: roger_home_pc Date: Sun, 17 Dec 2023 22:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=A1=A8=E6=A0=BC=E7=9A=84?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/update.js | 10 +++- src/request/index.js | 40 +++++++++------- src/views/update/index.vue | 98 +++++++++++++++++--------------------- 3 files changed, 75 insertions(+), 73 deletions(-) diff --git a/src/apis/update.js b/src/apis/update.js index 205d1f3..698bdc2 100644 --- a/src/apis/update.js +++ b/src/apis/update.js @@ -6,4 +6,12 @@ export const cinema_list = () => { url: '/update/cinema/', method: 'get' }) -} \ No newline at end of file +} + +export const cinema_search = (params) => { + return request({ + url: '/update/cinema/search', + method: 'get', + params: params + }) +} diff --git a/src/request/index.js b/src/request/index.js index cdedf6a..d68b7ac 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -4,21 +4,6 @@ import config from "@/request/config.js"; // import {rejects} from "node:assert"; // import router from "@/router"; - -// const config = { -// method: 'get', -// baseURL: 'http://127.0.0.1:8000', -// headers: { -// 'Content-Type': 'application/json;charset=UTF-8', -// 'Authorization': 'token 4e63b8854974c1fdac9deb891fd74dc145b53f85' -// }, -// timeout: 10000, -// withCredentials: true, -// responseType: 'json', -// } - -console.log('axios') - function request(options) { const instance = axios.create({...config}) @@ -64,10 +49,31 @@ function request(options) { }) } +// +// // 调试信息 +// const config = { +// method: 'get', +// baseURL: 'http://127.0.0.1:8000', +// headers: { +// 'Content-Type': 'application/json;charset=UTF-8', +// 'Authorization': 'token 4e63b8854974c1fdac9deb891fd74dc145b53f85' +// }, +// timeout: 10000, +// withCredentials: true, +// responseType: 'json', +// } +// +// const params = {ip: '', version: '33'} +// // const params = {ip: '172.16.3.112'} +// // const ip = '172.16.3.112' +// // const version = '11' // request({ -// url: '/update/cinema/' +// // url: `/update/cinema/search/ip/${ip}/version/${version}/`, +// url: `update/cinema/search/`, +// method: 'get', +// params: params // }).then(res => { // console.log(res) // }) -export default request \ No newline at end of file +export default request diff --git a/src/views/update/index.vue b/src/views/update/index.vue index b3da357..ed657cc 100644 --- a/src/views/update/index.vue +++ b/src/views/update/index.vue @@ -1,6 +1,6 @@