Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-consultation
提交
46ed9d46
提交
46ed9d46
编写于
3月 18, 2019
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改dev环境图片上传路径
上级
1f796eb5
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
6 行增加
和
89 行删除
+6
-89
envConfig.js
src/utils/envConfig.js
+3
-22
index.js
src/utils/index.js
+0
-13
mixins.js
src/utils/mixins.js
+2
-23
qiniuUtil.js
src/utils/qiniuUtil.js
+1
-31
未找到文件。
src/utils/envConfig.js
浏览文件 @
46ed9d46
...
...
@@ -6,17 +6,10 @@ export const envConfig = {
// baseUrl: 'https://dev-sc.yunqueyi.com/',
// // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/',
// apiUrl: 'https://dev-api.yunqueyi.com/',
// webPageUrl: 'https://dev-phome.yunqueyi.com/',
// baseUrl: 'https://test1-sc.yunqueyi.com/',
// apiUrl: 'https://test1-api.yunqueyi.com/',
// webPageUrl: 'https://test1-phome.yunqueyi.com/'
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl
:
'http://192.168.110.226:11905/portal/'
,
apiUrl
:
'https://uat-api.yunqueyi.com/'
,
webPageUrl
:
'https://uat-phome.yunqueyi.com/'
,
qiniuUrl
:
"http://localhost:10201/contents/admin/qiniu/token"
,
baseUrl
:
'http://localhost:11905/portal/'
,
qiniuFileUrl
:
"http://localhost:10201/contents/admin/qiniu/token1"
,
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
...
...
@@ -25,10 +18,7 @@ export const envConfig = {
},
dev
:
{
baseUrl
:
'https://dev-sc.yunqueyi.com/portal/'
,
apiUrl
:
'https://dev-api.yunqueyi.com/'
,
webPageUrl
:
'https://dev-phome.yunqueyi.com/'
,
qiniuUrl
:
"http://localhost:11905/contents/admin/qiniu/token"
,
qiniuFileUrl
:
"http://localhost:11905/contents/admin/qiniu/token1"
,
qiniuFileUrl
:
"https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1"
,
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
loginUrl
:
'https://dev-saas.yunqueyi.com/pica-login/work_station.html'
,
...
...
@@ -36,9 +26,6 @@ export const envConfig = {
},
test
:
{
baseUrl
:
'https://test1-sc.yunqueyi.com/portal/'
,
apiUrl
:
'https://test1-api.yunqueyi.com/'
,
webPageUrl
:
'https://test1-phome.yunqueyi.com/'
,
qiniuUrl
:
"https://test1-sc.yunqueyi.com/contents/admin/qiniu/token"
,
qiniuFileUrl
:
"https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1"
,
qiniuResourceUrl
:
"https://test1-videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://test1-file.yunqueyi.com"
,
...
...
@@ -47,9 +34,6 @@ export const envConfig = {
},
uat
:
{
baseUrl
:
'https://uat-sc.yunqueyi.com/portal/'
,
apiUrl
:
'https://uat-api.yunqueyi.com/'
,
webPageUrl
:
'https://uat-phome.yunqueyi.com/'
,
qiniuUrl
:
"https://uat-sc.yunqueyi.com/contents/admin/qiniu/token"
,
qiniuFileUrl
:
"https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1"
,
qiniuResourceUrl
:
"https://videos.yunqueyi.com"
,
// 视频
qiniuImgUrl
:
"https://file.yunqueyi.com"
,
...
...
@@ -58,9 +42,6 @@ export const envConfig = {
},
pro
:
{
baseUrl
:
'https://sc.yunqueyi.com/portal/'
,
apiUrl
:
'https://api.yunqueyi.com/'
,
webPageUrl
:
'https://phome.yunqueyi.com/'
,
qiniuUrl
:
"https://sc.yunqueyi.com/contents/admin/qiniu/token"
,
qiniuFileUrl
:
"https://sc.yunqueyi.com/contents/admin/qiniu/token1"
,
qiniuResourceUrl
:
"https://videos.yunqueyi.com"
,
qiniuImgUrl
:
"https://file.yunqueyi.com"
,
...
...
src/utils/index.js
浏览文件 @
46ed9d46
...
...
@@ -146,20 +146,7 @@ export function getBaseUrl(url) {
return
getConfigByEnvType
(
'baseUrl'
)
+
url
}
// 获取API服务器域名地址
export
function
getApiUrl
(
url
)
{
return
getConfigByEnvType
(
'apiUrl'
)
+
url
}
// 获取WEB部署服务器域名地址
export
function
getWebPageUrl
(
url
)
{
return
getConfigByEnvType
(
'webPageUrl'
)
+
url
}
// 获取七牛token
export
function
getQiniuToken
()
{
return
getConfigByEnvType
(
'qiniuUrl'
)
}
export
function
getQiniuToken1
()
{
return
getConfigByEnvType
(
'qiniuFileUrl'
)
}
...
...
src/utils/mixins.js
浏览文件 @
46ed9d46
import
fetch
from
'@/utils/fetch'
import
{
getBaseUrl
,
getApiUrl
}
from
'@/utils/index'
import
{
getBaseUrl
}
from
'@/utils/index'
module
.
exports
=
{
data
:
function
()
{
...
...
@@ -175,27 +175,6 @@ module.exports = {
})
},
// 通用GET请求
API_GET
(
api
,
para
,
callback
)
{
para
.
token
=
para
.
token
||
this
.
token
||
'00175A13D70D4234822D90AC3C74202C'
//'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
let
url
=
api
+
this
.
getUrlPara
(
para
)
return
fetch
({
url
:
getApiUrl
(
url
),
method
:
'get'
,
data
:
para
})
},
// 通用POST请求
API_POST
(
api
,
para
,
callback
)
{
para
.
token
=
para
.
token
||
this
.
token
||
'00175A13D70D4234822D90AC3C74202C'
//'AF3DFCF2DD4B4115AC47ACA25D5420E9''F90DF48D3EFA49DFAE1267A67DBEFB18'//token
return
fetch
({
url
:
getApiUrl
(
api
),
method
:
'post'
,
data
:
para
})
},
// 从html参数
getUrlKey
(
name
)
{
if
(
decodeURIComponent
&&
location
.
href
)
{
...
...
@@ -219,7 +198,7 @@ module.exports = {
}
}
return
null
}
,
}
}
}
src/utils/qiniuUtil.js
浏览文件 @
46ed9d46
import
{
isEmptyUtils
,
isNotEmptyUtils
,
subString
}
from
"./utils"
;
import
fetchQiniu
from
'./fetchQiniu.js'
;
import
{
getQiniuToken
,
getQiniuToken
1
,
uploadVideo
,
uploadImg
}
from
'./index'
import
{
getQiniuToken1
,
uploadVideo
,
uploadImg
}
from
'./index'
// let apiUrl = localStorage.getItem("qiniuUrl");
// let fileApiUrl = localStorage.getItem("qiniuFileUrl");
let
apiUrl
=
getQiniuToken
()
let
fileApiUrl
=
getQiniuToken1
()
//该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
let
subscription
=
null
;
...
...
@@ -82,32 +78,6 @@ export const createFilePath = (file, fileName) => {
return
filePath
;
};
/**
* 获取七牛上传凭证
*
* @return {Promise} token 七牛上传凭证
* */
const
doQiniuAction
=
()
=>
{
console
.
log
(
'send---'
+
apiUrl
);
return
new
Promise
(
function
(
resolve
,
reject
)
{
fetchQiniu
(
apiUrl
,{},
'GET'
).
then
(
function
(
result
)
{
let
token
=
null
;
if
(
isNotEmptyUtils
(
result
)
&&
result
.
code
==
"000000"
)
{
token
=
result
.
data
.
qiniuToken
;
resolve
(
token
);
console
.
log
(
'七牛临时授权成功'
);
localStorage
.
setItem
(
'qiniuToken'
,
token
);
}
else
{
reject
(
result
);
console
.
error
(
'七牛临时授权失败:'
,
result
);
}
}).
catch
(
function
(
error
)
{
reject
();
console
.
error
(
'七牛临时授权失败:'
,
error
);
});
});
};
/**
* 获取七牛上传凭证
*
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录