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 9d0b72e1
authored
Jun 15, 2021
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化:统一系统共用文件上传接口,统一为img的src不是绝对地址的src拼接接口地址
1 parent
81c4b476
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
14 deletions
linkwe-ui/src/components/Upload.vue
linkwe-ui/src/config.js
linkwe-ui/src/main.js
linkwe-ui/src/utils/request.js
linkwe-ui/src/components/Upload.vue
View file @
9d0b72e
...
@@ -28,11 +28,10 @@ export default {
...
@@ -28,11 +28,10 @@ export default {
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
action
:
action
:
process
.
env
.
VUE_APP_BASE_API
+
'/common/uploadFile2Cos'
,
process
.
env
.
VUE_APP_BASE_API
+
// (this.type == 0
(
this
.
type
==
0
// ? '/wecom/material/uploadimg'
?
'/wecom/material/uploadimg'
// : '/common/uploadFile2Cos'),
:
'/common/uploadFile2Cos'
),
headers
:
window
.
CONFIG
.
headers
,
headers
:
window
.
CONFIG
.
headers
,
domain
:
process
.
env
.
VUE_APP_BASE_API
,
domain
:
process
.
env
.
VUE_APP_BASE_API
,
}
}
...
...
linkwe-ui/src/config.js
View file @
9d0b72e
...
@@ -45,4 +45,21 @@ window.CONFIG = {
...
@@ -45,4 +45,21 @@ window.CONFIG = {
return
{
Authorization
:
'Bearer '
+
getToken
()
}
return
{
Authorization
:
'Bearer '
+
getToken
()
}
},
},
}
}
// 统一为img的src不是绝对地址的拼接接口地址
document
.
addEventListener
(
'error'
,
function
(
e
)
{
let
target
=
e
.
target
let
src
=
target
.
attributes
.
getNamedItem
(
'src'
).
value
if
(
target
.
tagName
.
toUpperCase
()
===
'IMG'
&&
src
&&
!
src
.
includes
(
'http'
)
)
{
target
.
src
=
process
.
env
.
VUE_APP_BASE_API
+
src
}
},
true
)
export
default
window
.
CONFIG
export
default
window
.
CONFIG
linkwe-ui/src/main.js
View file @
9d0b72e
...
@@ -67,20 +67,29 @@ Vue.prototype.msgInfo = function(msg) {
...
@@ -67,20 +67,29 @@ Vue.prototype.msgInfo = function(msg) {
import
{
pickerOptions
}
from
'@/utils/index'
import
{
pickerOptions
}
from
'@/utils/index'
Vue
.
prototype
.
pickerOptions
=
pickerOptions
Vue
.
prototype
.
pickerOptions
=
pickerOptions
import
VideoPlayer
from
'vue-video-player'
import
VideoPlayer
from
'vue-video-player'
Vue
.
use
(
VideoPlayer
);
Vue
.
use
(
VideoPlayer
)
import
AudioPlayer
from
'@liripeng/vue-audio-player'
import
AudioPlayer
from
'@liripeng/vue-audio-player'
import
'@liripeng/vue-audio-player/lib/vue-audio-player.css'
import
'@liripeng/vue-audio-player/lib/vue-audio-player.css'
Vue
.
use
(
AudioPlayer
)
Vue
.
use
(
AudioPlayer
)
import
VueAMap
from
'vue-amap'
;
import
VueAMap
from
'vue-amap'
Vue
.
use
(
VueAMap
)
;
Vue
.
use
(
VueAMap
)
VueAMap
.
initAMapApiLoader
({
VueAMap
.
initAMapApiLoader
({
key
:
'32396af00cd726deed804cf5b63ed2d8'
,
key
:
'32396af00cd726deed804cf5b63ed2d8'
,
plugin
:
[
'AMap.Autocomplete'
,
'AMap.PlaceSearch'
,
'AMap.Scale'
,
'AMap.OverView'
,
'AMap.ToolBar'
,
'AMap.MapType'
,
'AMap.PolyEditor'
,
'AMap.CircleEditor'
],
plugin
:
[
v
:
'1.4.4'
'AMap.Autocomplete'
,
});
'AMap.PlaceSearch'
,
'AMap.Scale'
,
'AMap.OverView'
,
'AMap.ToolBar'
,
'AMap.MapType'
,
'AMap.PolyEditor'
,
'AMap.CircleEditor'
,
],
v
:
'1.4.4'
,
})
// 全局组件挂载
// 全局组件挂载
Vue
.
component
(
'Pagination'
,
Pagination
)
Vue
.
component
(
'Pagination'
,
Pagination
)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
...
...
linkwe-ui/src/utils/request.js
View file @
9d0b72e
...
@@ -10,7 +10,7 @@ const service = axios.create({
...
@@ -10,7 +10,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL
:
baseURL
:
process
.
env
.
NODE_ENV
===
'development'
process
.
env
.
NODE_ENV
===
'development'
?
process
.
env
.
VUE_APP_BASE_API
?
'/api'
:
process
.
env
.
VUE_APP_BASE_API
,
:
process
.
env
.
VUE_APP_BASE_API
,
// 超时
// 超时
timeout
:
10000
,
timeout
:
10000
,
...
...
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