Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-www-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-www-pc
Commits
c66f4b63
提交
c66f4b63
authored
5月 27, 2021
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
0dfe90d9
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
12 行删除
+18
-12
index.js
api/index.js
+6
-2
rightAside.vue
components/rightAside.vue
+5
-1
httpRequest.js
utils/httpRequest.js
+7
-9
没有找到文件。
api/index.js
浏览文件 @
c66f4b63
...
@@ -14,7 +14,9 @@ export function getNewsDetails(params) {
...
@@ -14,7 +14,9 @@ export function getNewsDetails(params) {
* 发送验证码
* 发送验证码
*/
*/
export
function
sendCode
(
data
)
{
export
function
sendCode
(
data
)
{
return
httpRequest
.
post
(
'/api/usercenter/user/send-code'
,
data
)
return
httpRequest
.
post
(
'/api/usercenter/user/send-code'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
}
/**
/**
...
@@ -28,5 +30,7 @@ export function checkCode(params) {
...
@@ -28,5 +30,7 @@ export function checkCode(params) {
* 提交留咨信息
* 提交留咨信息
*/
*/
export
function
postNes
(
data
)
{
export
function
postNes
(
data
)
{
return
httpRequest
.
post
(
'/api/enrollment/v1.0/applications'
,
data
)
return
httpRequest
.
post
(
'/api/enrollment/v1.0/applications'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
}
components/rightAside.vue
浏览文件 @
c66f4b63
...
@@ -156,7 +156,11 @@ export default {
...
@@ -156,7 +156,11 @@ export default {
}
}
},
},
checkSendcode
()
{
checkSendcode
()
{
const
checkCodeParam
=
'?account='
+
this
.
formInfo
.
phone
+
'&code='
+
this
.
sendCode
+
'&countryCode=86'
const
checkCodeParam
=
{
account
:
this
.
formInfo
.
phone
,
code
:
this
.
sendCode
,
countryCode
:
86
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
checkCode
(
checkCodeParam
).
then
(
res
=>
{
checkCode
(
checkCodeParam
).
then
(
res
=>
{
if
(
res
&&
res
.
code
===
0
)
{
if
(
res
&&
res
.
code
===
0
)
{
...
...
utils/httpRequest.js
浏览文件 @
c66f4b63
...
@@ -13,6 +13,13 @@ const httpRequest = axios.create({
...
@@ -13,6 +13,13 @@ const httpRequest = axios.create({
// 请求拦截
// 请求拦截
httpRequest
.
interceptors
.
request
.
use
(
httpRequest
.
interceptors
.
request
.
use
(
function
(
config
)
{
function
(
config
)
{
if
(
config
.
headers
[
'Content-Type'
]
===
'multipart/form-data'
)
{
const
form
=
new
window
.
FormData
()
for
(
const
key
in
config
.
data
)
{
form
.
append
(
key
,
config
.
data
[
key
])
}
config
.
data
=
form
}
else
{
const
defaultParams
=
{
const
defaultParams
=
{
timestamp
:
parseInt
(
Date
.
now
()
/
1000
),
timestamp
:
parseInt
(
Date
.
now
()
/
1000
),
nonce
:
Math
.
random
()
nonce
:
Math
.
random
()
...
@@ -37,15 +44,6 @@ httpRequest.interceptors.request.use(
...
@@ -37,15 +44,6 @@ httpRequest.interceptors.request.use(
}
else
{
}
else
{
config
.
params
=
params
config
.
params
=
params
}
}
// if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
// config.data = qs.stringify(config.data)
// }
if
(
config
.
headers
[
'Content-Type'
]
===
'multipart/form-data'
)
{
const
form
=
new
window
.
FormData
()
for
(
const
key
in
config
.
data
)
{
form
.
append
(
key
,
config
.
data
[
key
])
}
config
.
data
=
form
}
}
return
config
return
config
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论