Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 7bccd613
authored
Feb 09, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
配置
1 parent
d576e9c0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
32 deletions
linkwe-ui/.env.development
linkwe-ui/.env.production
linkwe-ui/.env.test
linkwe-ui/src/api/common.js
linkwe-ui/src/config.js
linkwe-ui/src/utils/common.js
linkwe-ui/src/utils/request.js
linkwe-ui/vue.config.js
linkwe-ui/.env.development
View file @
7bccd61
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
ENV = 'development'
ENV = 'development'
# 基础api(根据实际情况,自行配置,下为示例)
# 基础api(根据实际情况,自行配置,下为示例)
VUE_APP_BASE_API = 'http://demo.linkwechat.cn'
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_SYSTEM_API = '/dev-api'
# 路由基础路径
# 路由基础路径
VUE_APP_BASE_URL = '/'
VUE_APP_BASE_URL = '/'
\ No newline at end of file
\ No newline at end of file
linkwe-ui/.env.production
View file @
7bccd61
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
ENV = 'production'
ENV = 'production'
# 基础api
# 基础api
VUE_APP_BASE_API = 'http://demo.linkwechat.cn'
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_SYSTEM_API = '/dev-api'
# 路由基础路径
# 路由基础路径
VUE_APP_BASE_URL = '/'
\ No newline at end of file
\ No newline at end of file
VUE_APP_BASE_URL = '/dev/'
\ No newline at end of file
\ No newline at end of file
linkwe-ui/.env.test
View file @
7bccd61
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
ENV = 'test'
ENV = 'test'
# 基础api
# 基础api
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/dev-api'
VUE_APP_SYSTEM_API = '/dev-api'
# 路由基础路径
# 路由基础路径
VUE_APP_BASE_URL = '/dev/'
VUE_APP_BASE_URL = '/dev/'
linkwe-ui/src/api/common.js
View file @
7bccd61
...
@@ -3,11 +3,11 @@ import { dataURLtoFile } from '@/utils/common'
...
@@ -3,11 +3,11 @@ import { dataURLtoFile } from '@/utils/common'
const
service
=
window
.
CONFIG
.
services
.
system
+
window
.
CONFIG
.
services
.
common
const
service
=
window
.
CONFIG
.
services
.
system
+
window
.
CONFIG
.
services
.
common
export
function
upload
(
data
)
{
export
function
upload
(
data
)
{
return
request
({
return
request
({
url
:
service
+
'/uploadFile2Cos'
,
url
:
service
+
'/uploadFile2Cos'
,
method
:
'POST'
,
method
:
'POST'
,
data
,
data
})
})
}
}
...
@@ -19,9 +19,10 @@ export function upload (data) {
...
@@ -19,9 +19,10 @@ export function upload (data) {
name=文件名称,带后缀
name=文件名称,带后缀
}
}
*/
*/
export
function
download
(
url
,
name
)
{
export
function
download
(
url
,
name
)
{
return
(
return
(
process
.
env
.
VUE_APP_BASE_API
+
window
.
CONFIG
.
services
.
system
+
process
.
env
.
VUE_APP_DOMAIN
+
window
.
CONFIG
.
services
.
system
+
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
`/common/download/url?url=
${
url
}
&name=
${
name
}
`
)
)
}
}
...
@@ -33,16 +34,15 @@ export function download (url, name) {
...
@@ -33,16 +34,15 @@ export function download (url, name) {
"dataURL": 本地文件(base64)
"dataURL": 本地文件(base64)
}
}
*/
*/
export
function
uploadDataURL
(
dataURL
)
{
export
function
uploadDataURL
(
dataURL
)
{
const
data
=
new
window
.
FormData
()
const
data
=
new
window
.
FormData
()
const
f
=
dataURLtoFile
(
dataURL
)
const
f
=
dataURLtoFile
(
dataURL
)
data
.
append
(
'file'
,
f
)
data
.
append
(
'file'
,
f
)
return
request
({
return
request
({
url
:
process
.
env
.
VUE_APP_BASE_API
+
window
.
CONFIG
.
services
.
system
+
url
:
window
.
CONFIG
.
services
.
system
+
'/common/uploadFile2Cos'
,
'/common/uploadFile2Cos'
,
method
:
'post'
,
method
:
'post'
,
processData
:
false
,
processData
:
false
,
data
,
data
})
})
}
}
linkwe-ui/src/config.js
View file @
7bccd61
...
@@ -32,8 +32,8 @@ window.CONFIG = {
...
@@ -32,8 +32,8 @@ window.CONFIG = {
services
:
{
services
:
{
wecom
:
'/wecom'
,
wecom
:
'/wecom'
,
kf
:
'/dev-kf'
,
kf
:
'/dev-kf'
,
system
:
'/dev-api'
,
system
:
process
.
env
.
VUE_APP_SYSTEM_API
,
common
:
'/common'
,
common
:
'/common'
},
},
/**
/**
...
@@ -43,9 +43,9 @@ window.CONFIG = {
...
@@ -43,9 +43,9 @@ window.CONFIG = {
*/
*/
groupCodeH5Link
:
'http://linkwechat.cn/mobile/#/groupCode'
,
groupCodeH5Link
:
'http://linkwechat.cn/mobile/#/groupCode'
,
get
headers
()
{
get
headers
()
{
return
{
Authorization
:
'Bearer '
+
getToken
()
}
return
{
Authorization
:
'Bearer '
+
getToken
()
}
}
,
}
}
}
// 统一为img的src不是绝对地址的拼接接口地址
// 统一为img的src不是绝对地址的拼接接口地址
document
.
addEventListener
(
document
.
addEventListener
(
...
@@ -53,11 +53,7 @@ document.addEventListener(
...
@@ -53,11 +53,7 @@ document.addEventListener(
function
(
e
)
{
function
(
e
)
{
let
target
=
e
.
target
let
target
=
e
.
target
let
src
=
target
.
attributes
.
getNamedItem
(
'src'
).
value
let
src
=
target
.
attributes
.
getNamedItem
(
'src'
).
value
if
(
if
(
target
.
tagName
.
toUpperCase
()
===
'IMG'
&&
src
&&
!
src
.
includes
(
'http'
))
{
target
.
tagName
.
toUpperCase
()
===
'IMG'
&&
src
&&
!
src
.
includes
(
'http'
)
)
{
target
.
src
=
process
.
env
.
VUE_APP_BASE_API
+
src
target
.
src
=
process
.
env
.
VUE_APP_BASE_API
+
src
}
}
},
},
...
...
linkwe-ui/src/utils/common.js
View file @
7bccd61
...
@@ -96,12 +96,7 @@ export function selectDictLabels(datas, value, separator) {
...
@@ -96,12 +96,7 @@ export function selectDictLabels(datas, value, separator) {
// 通用下载方法
// 通用下载方法
export
function
download
(
fileName
)
{
export
function
download
(
fileName
)
{
window
.
location
.
href
=
window
.
location
.
href
=
baseURL
+
baseURL
+
'/common/download?fileName='
+
encodeURI
(
fileName
)
+
'&delete='
+
true
window
.
CONFIG
.
services
.
system
+
'/common/download?fileName='
+
encodeURI
(
fileName
)
+
'&delete='
+
true
}
}
// 字符串格式化(%s )
// 字符串格式化(%s )
...
...
linkwe-ui/src/utils/request.js
View file @
7bccd61
...
@@ -8,7 +8,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
...
@@ -8,7 +8,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
// 创建axios实例
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
// axios中请求配置有baseURL选项,表示请求URL公共部分
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL
:
process
.
env
.
NODE_ENV
===
'development'
?
'api'
:
process
.
env
.
VUE_APP_
BASE_API
,
baseURL
:
process
.
env
.
NODE_ENV
===
'development'
?
'api'
:
process
.
env
.
VUE_APP_
DOMAIN
,
// 超时
// 超时
timeout
:
10000
timeout
:
10000
})
})
...
...
linkwe-ui/vue.config.js
View file @
7bccd61
...
@@ -31,7 +31,7 @@ module.exports = {
...
@@ -31,7 +31,7 @@ module.exports = {
proxy
:
{
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
'/api'
]:
{
[
'/api'
]:
{
target
:
process
.
env
.
VUE_APP_
BASE_API
,
target
:
process
.
env
.
VUE_APP_
DOMAIN
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
[
'^/api'
]:
''
[
'^/api'
]:
''
...
@@ -60,10 +60,7 @@ module.exports = {
...
@@ -60,10 +60,7 @@ module.exports = {
// 修复HMR
// 修复HMR
config
.
resolve
.
symlinks
(
true
)
config
.
resolve
.
symlinks
(
true
)
// set svg-sprite-loader
// set svg-sprite-loader
config
.
module
config
.
module
.
rule
(
'svg'
).
exclude
.
add
(
resolve
(
'src/assets/icons'
)).
end
()
.
rule
(
'svg'
)
.
exclude
.
add
(
resolve
(
'src/assets/icons'
))
.
end
()
config
.
module
config
.
module
.
rule
(
'icons'
)
.
rule
(
'icons'
)
.
test
(
/
\.
svg$/
)
.
test
(
/
\.
svg$/
)
...
...
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