Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 57ee7c6e
authored
Mar 13, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
config 配置修改
1 parent
b11bfa11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
65 deletions
src/api/request2.js
vue.config.js
src/api/request2.js
View file @
57ee7c6
...
@@ -5,63 +5,63 @@
...
@@ -5,63 +5,63 @@
* @Last Modified time: 2021-06-30 14:30:41
* @Last Modified time: 2021-06-30 14:30:41
*/
*/
import
axios
from
'@/plugin/axios'
import
axios
from
"@/plugin/axios"
import
sign
from
'./sign'
import
sign
from
"./sign"
import
RequestMethods
from
'./request.methods'
import
RequestMethods
from
"./request.methods"
import
util
from
'@/libs/util.js'
import
util
from
"@/libs/util.js"
import
{
baseConfig
}
from
'@/main'
import
{
baseConfig
}
from
"@/main"
const
request
=
(
const
request
=
(
params
=
{},
params
=
{},
method
=
RequestMethods
.
GET
,
method
=
RequestMethods
.
GET
,
noSignAttr
=
[],
noSignAttr
=
[],
options
options
)
=>
{
)
=>
{
// console.log(baseConfig)
// console.log(baseConfig)
// params.source = 'glsx'
// params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params
.
appKey
=
baseConfig
?.
axios2
?.
appkey
params
.
appKey
=
baseConfig
?.
axios2
?.
appkey
// clg
// clg
// console.log(params.appKey)
// console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
// : '48e5e13229b82c1b4e6e8c96151f0637'
params
.
timestamp
=
new
Date
().
getTime
()
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
'1.0.0'
params
.
v
=
"1.0.0"
params
.
format
=
'json'
params
.
format
=
"json"
params
.
locale
=
'zh_CN'
params
.
locale
=
"zh_CN"
// if (params.method !== 'dj.api.user.login') {
// if (params.method !== 'dj.api.user.login') {
// params.sessionId = util.cookies.get('token')
// params.sessionId = util.cookies.get('token')
// }
// }
/**
/**
* mock - url = params.method
* mock - url = params.method
* 调后端接口 - url = ''
* 调后端接口 - url = ''
*/
*/
const
url
=
params
.
method
const
url
=
params
.
method
// console.log(url)
// console.log(url)
/**
/**
* 调后端接口,请使用以下代码。
* 调后端接口,请使用以下代码。
*/
*/
//
//
var
reqData
=
var
reqData
=
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method
===
RequestMethods
.
POST
method
===
RequestMethods
.
POST
?
{
baseURL
:
'/'
,
data
:
sign
(
params
,
noSignAttr
)
}
?
{
baseURL
:
"/"
,
data
:
sign
(
params
,
noSignAttr
)
}
:
{
params
:
sign
(
params
,
noSignAttr
)
}
:
{
params
:
sign
(
params
,
noSignAttr
)
}
reqData
=
reqData
=
Object
.
assign
(
reqData
,
options
,
{})
reqData
=
reqData
=
Object
.
assign
(
reqData
,
options
,
{})
return
axios
({
return
axios
({
url
,
url
,
method
,
method
,
...
reqData
,
...
reqData
,
isPoint
:
true
isPoint
:
true
})
})
/**
/**
* mock,请使用以下代码。
* mock,请使用以下代码。
*/
*/
// return axios({
// return axios({
// url,
// url,
// method,
// method,
// params: sign(params, noSignAttr)
// params: sign(params, noSignAttr)
// })
// })
}
}
export
default
request
export
default
request
vue.config.js
View file @
57ee7c6
...
@@ -175,7 +175,7 @@ module.exports = {
...
@@ -175,7 +175,7 @@ module.exports = {
process
.
env
.
NODE_ENV
===
"production"
&&
process
.
env
.
NODE_ENV
===
"production"
&&
Object
.
assign
(
config
,
{
Object
.
assign
(
config
,
{
plugins
:
[
plugins
:
[
...
config
.
plugins
,
...
config
.
plugins
// new SentryWebpackPlugin({
// new SentryWebpackPlugin({
// // webpack specific configuration
// // webpack specific configuration
// release: "0.0.1",
// release: "0.0.1",
...
@@ -191,15 +191,15 @@ module.exports = {
...
@@ -191,15 +191,15 @@ module.exports = {
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack
:
(
config
)
=>
{
chainWebpack
:
(
config
)
=>
{
// 删除注释
// 删除注释
//
config.optimization.minimizer("terser").tap((args) => {
config
.
optimization
.
minimizer
(
"terser"
).
tap
((
args
)
=>
{
//
args[0].terserOptions.compress.drop_console = true
//
args[0].terserOptions.compress.drop_console = true
//
args[0].terserOptions.compress.drop_debugger = true
//
args[0].terserOptions.compress.drop_debugger = true
//
args[0].terserOptions.compress.pure_funcs = ["console.log"]
//
args[0].terserOptions.compress.pure_funcs = ["console.log"]
//
args[0].terserOptions.output = {
//
args[0].terserOptions.output = {
//
comments: false
//
comments: false
//
}
//
}
//
return args
return
args
//
})
})
/**
/**
* 删除懒加载模块的 prefetch preload,降低带宽压力
* 删除懒加载模块的 prefetch preload,降低带宽压力
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch
...
...
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