Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit abd60335
authored
Mar 05, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改环境取值位置
1 parent
4e8eda3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
config.js
utils/request/environment.js
config.js
View file @
abd6033
...
@@ -4,14 +4,19 @@
...
@@ -4,14 +4,19 @@
*/
*/
// 配置预发布的小程序aapId
// 配置预发布的小程序aapId
export
const
preReleaseAppId
=
'wx24ebae5768e74138'
//
export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id
// 小程序id
export
const
appId
=
'wx570d9331f9ace0bd'
export
const
appId
=
'wx570d9331f9ace0bd'
// 开发环境
/**
* 环境指定
// 开发指定的小程序
* 0本地
* 1开发
* 2测试
* 3生产环境
*/
export
const
env
=
1
// sentry Dsn 地址
// sentry Dsn 地址
export
const
dsnUrl
=
'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
export
const
dsnUrl
=
'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
utils/request/environment.js
View file @
abd6033
/**
import
{
env
}
from
'~/config'
*
0本地
1开发
2测试
3生产环境
*/
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
accountInfo
=
wx
.
getAccountInfoSync
()
const
systemInfo
=
wx
.
getSystemInfoSync
()
const
systemInfo
=
wx
.
getSystemInfoSync
()
// console.log(systemInfo);
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const
manual
=
false
const
manual
=
false
const
release
=
false
const
release
=
false
let
index
=
2
const
index
=
env
// 判断小程序环境
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// develop:开发版(正常开发工具,测试时)
...
@@ -25,7 +19,6 @@ let index = 2
...
@@ -25,7 +19,6 @@ let index = 2
if
(
systemInfo
.
platform
!=
'devtools'
)
{
if
(
systemInfo
.
platform
!=
'devtools'
)
{
switch
(
accountInfo
.
miniProgram
.
envVersion
)
{
switch
(
accountInfo
.
miniProgram
.
envVersion
)
{
case
'develop'
:
case
'develop'
:
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
break
case
'trial'
:
case
'trial'
:
index
=
manual
?
index
:
2
index
=
manual
?
index
:
2
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment