当前位置:网站首页>[wechat applet development (V)] the interface is intelligently configured according to the official version of the experience version of the development version
[wechat applet development (V)] the interface is intelligently configured according to the official version of the experience version of the development version
2022-07-28 02:48:00 【Sock is a dog】
utils/api.js
// Interface api
// api Request address of
// Get current account information
const accountInfo = wx.getAccountInfoSync();
// env type
var BASE_URL = ""
const baseApi = {
// Development Edition
develop: {
api_host:"https://www.xxx.com"},
// Experience version
trial: {
api_host:"https://www.xxx.com"},
// Official version
release: {
api_host:"https://www.xxxxxxx.com"}
};
// When the phone is in a low version , Write the address directly into the development version
if (!accountInfo.miniProgram.envVersion) {
// console.error(" Failed to get the running environment !");
BASE_URL = baseApi['develop'].api_host
} else {
// request request baseURL
BASE_URL = baseApi[accountInfo.miniProgram.envVersion].api_host
}
module.exports = {
BASE_URL
}
Use
import {
BASE_URL } from "../../utils/api";
边栏推荐
- unordered_map的hash function及hash bucket存储方式探索
- 修改MySQL密码的四种方法(适合初学者)
- 关于Sqli-labs单引号不报错的问题
- Newline required at end of file but not found.
- [image defogging] image defogging based on dark channel and non-mean filtering with matlab code
- Manual installation of Dlib Library
- Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance
- Important arrangements - the follow-up live broadcast of dx12 engine development course will be held at station B
- 树的孩子兄弟表示法
- [elm classification] classification of UCI data sets based on nuclear limit learning machine and limit learning machine, with matlab code
猜你喜欢

Find - block search
![[self growth website collection]](/img/42/fa17c9167697543defd3e63a97237a.png)
[self growth website collection]

Compile and use Qwt in qt|vs2017

Emotional drama in the world Zhou Bingkun lost his job because he saw Tu Zhiqiang and was shot

Product axure9 English version, using repeater repeater repeater to realize multi-choice and single choice

Cesium3Dtilesets 使用customShader的解读以及泛光效果示例

Some shortest path problems solved by hierarchical graph

Deep Residual Learning for Image Recognition浅读与实现

【HCIP】路由策略、策略路由

新基建助力智能化道路交通领域的转型发展
随机推荐
Achievements in science and Technology (XXVIII)
特征值和特征向量
Necessary knowledge points of software engineering
作业7.27 IO进程
数字孪生农业丨智慧农业稻米加工厂从“看天吃饭”到“知天而作”
【TA-霜狼_may-《百人计划》】图形3.7 移动端TP(D)R架构
Deep Residual Learning for Image Recognition浅读与实现
Necessary knowledge points of the original group
JS event loop synchronous task, asynchronous task (micro task, macro task) problem analysis
【信号处理】基于高阶统计量特征的通信系统中微弱信号检测附matlab代码
Leetcode judge whether palindrome number
cn+dt
[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
【信号去噪】基于卡尔曼滤波实现信号去噪附matlab代码
Maskedauutoencoders visual learner cvpr2022
Emotional drama in the world Zhou Bingkun lost his job because he saw Tu Zhiqiang and was shot
Flutter神操作学习之(满级攻略)
基于stm32的恒功率无线充电
Network must know topics
Some shortest path problems solved by hierarchical graph