请求头多语言参数-版本号显示

This commit is contained in:
2023-12-05 14:48:56 +08:00
parent bd32e62fc4
commit a5e336ea6a
3 changed files with 11 additions and 2 deletions

View File

@@ -1,10 +1,13 @@
import config from "@/common/config";
import _this from "../main.js";
//1、首先创建一个工具包utils
//2、创建一个api.js文件
//3、编写api.js内容
//创建一个常量 conset BASE_URL作为默认url地址
// console.log('语言',_this.$i18n.locale);
export const myRequest = (option) => {
//将封装好的函数导入出去
return new Promise((resolve, reject) => {
@@ -14,7 +17,7 @@ export const myRequest = (option) => {
method: option.method || "GET", //请求方法
header: option.header || {
// 根据实际接口设计 key 取 token 或者 authorization
lang: "zh-CN",
lang: _this.$i18n.locale || "zh-CN",
// #ifdef MP-WEIXIN
app_type: "miniprogram",
// #endif