Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
3e3f8f70
提交
3e3f8f70
编写于
3月 18, 2019
作者:
Yuanzhao.dai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
api fixed
上级
48ee1bfd
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
30 行删除
+25
-30
envConfig.js
src/utils/envConfig.js
+11
-5
followapis.js
src/utils/followup/followapis.js
+9
-25
index.js
src/utils/index.js
+5
-0
未找到文件。
src/utils/envConfig.js
浏览文件 @
3e3f8f70
...
...
@@ -21,7 +21,9 @@ export const envConfig = {
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'http://localhost:8090/PICA_SSO_FE/html/pica_login.html'
innerLoginUrl
:
'http://localhost:8090/PICA_SSO_FE/html/pica_login.html'
,
followUpApi
:
''
,
followUpApiSoSoApi
:
'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/73'
},
dev
:
{
baseUrl
:
'https://dev-sc.yunqueyi.com/portal/'
,
...
...
@@ -32,7 +34,8 @@ export const envConfig = {
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
innerLoginUrl
:
'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
,
followUpApi
:
''
,
},
test
:
{
baseUrl
:
'https://test1-sc.yunqueyi.com/portal/'
,
...
...
@@ -43,7 +46,8 @@ export const envConfig = {
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://test1-saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
innerLoginUrl
:
'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
,
followUpApi
:
''
,
},
uat
:
{
baseUrl
:
'https://uat-sc.yunqueyi.com/portal/'
,
...
...
@@ -54,7 +58,8 @@ export const envConfig = {
qiniuResourceUrl
:
"https://videos.yunqueyi.com"
,
// 视频
qiniuImgUrl
:
"https://file.yunqueyi.com"
,
loginUrl
:
'https://uat-saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
innerLoginUrl
:
'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
,
followUpApi
:
''
,
},
pro
:
{
baseUrl
:
'https://sc.yunqueyi.com/portal/'
,
...
...
@@ -65,6 +70,7 @@ export const envConfig = {
qiniuResourceUrl
:
"https://videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://file.yunqueyi.com"
,
loginUrl
:
'https://saas.yunqueyi.com/pica-login/work_station.html'
,
innerLoginUrl
:
'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
innerLoginUrl
:
'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_login.html'
,
followUpApi
:
''
,
}
}
src/utils/followup/followapis.js
浏览文件 @
3e3f8f70
import
axios
from
'../fetch'
;
import
fetch
from
'../fetch'
;
import
{
getFollowUpApi
}
from
'@/utils/index'
import
utils
from
'./followupUtils'
;
// 随访接口域名
let
domain
=
' '
;
if
(
process
.
env
.
APIDOMAIN
===
'prod'
)
{
domain
=
' '
;
}
else
if
(
process
.
env
.
APIDOMAIN
===
'test'
)
{
domain
=
' '
;
}
else
if
(
process
.
env
.
APIDOMAIN
===
'uat'
)
{
domain
=
' '
;
}
else
if
(
process
.
env
.
APIDOMAIN
===
'dev'
)
{
domain
=
' '
;
}
/*计划管理API*/
const
planManageApi
=
[
{
url
:
'/followup/planPatient'
,
method
:
'
GET
'
,
url
:
'/followup/planPatient
/
'
,
method
:
'
get
'
,
params
:
'params'
,
name
:
'getResidentList'
,
description
:
'获取居民列表'
,
...
...
@@ -34,10 +24,10 @@ const apis = [...planManageApi];
apis
.
forEach
(
item
=>
api
[
item
.
name
]
=
(
params
=
{},
extraConfig
=
{})
=>
{
const
config
=
{
baseURL
:
domain
,
url
:
item
.
url
,
url
:
getFollowUpApi
(
item
.
url
),
method
:
item
.
method
,
};
if
(
extraConfig
.
urlSuffix
)
{
// 需要做URL拼接的情况(比如*.do/2),,,可以根据自己的实际情况进行扩展
config
.
url
=
`
${
config
.
url
}${
extraConfig
.
urlSuffix
}
`
;
//something else
...
...
@@ -48,21 +38,15 @@ apis.forEach(item => api[item.name] = (params = {}, extraConfig = {}) => {
}
else
{
config
.
params
=
filterParams
;
}
console
.
log
(
'item'
,{...
config
})
/*utils.MSG.$emit('axios:begin', item.url);*/
return
axios
({
return
fetch
({
...
config
,
...
extraConfig
,
}).
then
(
res
=>
{
return
Promise
.
resolve
(
res
);
}).
catch
(
err
=>
{
return
Promise
.
resolve
({
// 请务必根据data判断
data
:
{
code
:
222222
,
// exception 专用
msg
:
'axios:error'
,
err
,
message
:
err
},
});
return
Promise
.
resolve
(
err
);
});
});
...
...
src/utils/index.js
浏览文件 @
3e3f8f70
...
...
@@ -179,9 +179,14 @@ export function uploadVideo() {
export
function
uploadImg
()
{
return
getConfigByEnvType
(
'qiniuImgUrl'
)
}
// 获取随访服务器域名地址
export
function
getFollowUpApi
(
url
)
{
return
getConfigByEnvType
(
'followUpApiSoSoApi'
)
+
url
//当前使用sosoapi mock数据
}
// 根据不同环境,生成URL
function
getConfigByEnvType
(
urlType
)
{
return
envConfig
[
process
.
env
.
BUILD_ENV
][
urlType
]
}
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录