seat 请求头增加Language
Showing
3 changed files
with
9 additions
and
4 deletions
| ... | @@ -294,15 +294,14 @@ detail.fetchData(); | ... | @@ -294,15 +294,14 @@ detail.fetchData(); |
| 294 | </div> | 294 | </div> |
| 295 | <div v-else> | 295 | <div v-else> |
| 296 | <!-- v-if="detail.data?.state == 1 && detail.data?.isRefund" --> | 296 | <!-- v-if="detail.data?.state == 1 && detail.data?.isRefund" --> |
| 297 | <!-- v-if="detail.data?.state == 1 && detail.data?.isRefund" --> | 297 | <div v-if="detail.data?.state == 1 && detail.data?.isRefund" class="btn_box"> |
| 298 | <div class="btn_box"> | ||
| 299 | <div class="can_pay" @click="detail.cancelOrder()">取消购票</div> | 298 | <div class="can_pay" @click="detail.cancelOrder()">取消购票</div> |
| 300 | <div class="pay" @click="detail.comeBack()">再来一单</div> | 299 | <div class="pay" @click="detail.comeBack()">再来一单</div> |
| 301 | </div> | 300 | </div> |
| 302 | 301 | ||
| 303 | <!-- <div v-else class="btn_box"> | 302 | <div v-else class="btn_box"> |
| 304 | <div class="pay_dis">请联系工作人员</div> | 303 | <div class="pay_dis">请联系工作人员</div> |
| 305 | </div> --> | 304 | </div> |
| 306 | </div> | 305 | </div> |
| 307 | </div> | 306 | </div> |
| 308 | <div v-if="detail.data?.state == 0" class="tip"> | 307 | <div v-if="detail.data?.state == 0" class="tip"> | ... | ... |
| ... | @@ -4,6 +4,9 @@ import axios from "axios"; | ... | @@ -4,6 +4,9 @@ import axios from "axios"; |
| 4 | import { getToken } from "./local-store"; | 4 | import { getToken } from "./local-store"; |
| 5 | import { ElMessage } from "element-plus"; | 5 | import { ElMessage } from "element-plus"; |
| 6 | 6 | ||
| 7 | import { useStorage } from "@vueuse/core/index"; | ||
| 8 | const language = useStorage("language", 0); | ||
| 9 | |||
| 7 | const baseURL = "https://radv4.gitliuyi.top/ticket"; //"http://book.xiaojinyu.games"; // 这里填入你的基础 API URL | 10 | const baseURL = "https://radv4.gitliuyi.top/ticket"; //"http://book.xiaojinyu.games"; // 这里填入你的基础 API URL |
| 8 | const timeout = 15000; // 请求超时时间 | 11 | const timeout = 15000; // 请求超时时间 |
| 9 | 12 | ||
| ... | @@ -19,9 +22,11 @@ const http = axios.create({ | ... | @@ -19,9 +22,11 @@ const http = axios.create({ |
| 19 | http.interceptors.request.use( | 22 | http.interceptors.request.use( |
| 20 | (config) => { | 23 | (config) => { |
| 21 | // 在发送请求之前做些什么 | 24 | // 在发送请求之前做些什么 |
| 25 | if (language.value == 1) config.headers.Language = "en-us"; | ||
| 22 | const TOKEN = getToken(); | 26 | const TOKEN = getToken(); |
| 23 | if (TOKEN) config.headers.Authorization = TOKEN; | 27 | if (TOKEN) config.headers.Authorization = TOKEN; |
| 24 | if (config.method == "get") config.params = config.data; | 28 | if (config.method == "get") config.params = config.data; |
| 29 | console.log("config", config); | ||
| 25 | return config; | 30 | return config; |
| 26 | }, | 31 | }, |
| 27 | (error) => { | 32 | (error) => { | ... | ... |
-
Please register or sign in to post a comment