Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
cms-admin
Commits
52dce77c
提交
52dce77c
authored
5月 17, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
员工管理列表修改手机号和密码接口调试
上级
ee1e9fb3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
64 行增加
和
7 行删除
+64
-7
account.js
src/api/account.js
+25
-1
system.js
src/api/system.js
+0
-1
index.vue
src/pages/settings/staff/index.vue
+39
-5
没有找到文件。
src/api/account.js
浏览文件 @
52dce77c
...
...
@@ -10,5 +10,28 @@ export function getUser() {
}
// 发送验证码
export
function
sendCode
(
data
)
{
return
httpRequest
.
post
(
'/api/usercenter/user/send-code'
,
data
)
return
httpRequest
({
url
:
'/api/usercenter/user/send-code'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
data
})
}
// 修改密码
export
function
updatePassword
(
data
)
{
return
httpRequest
({
url
:
'/api/usercenter/user/update-pwd'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
data
})
}
// 修改用户信息
export
function
updateUserInfo
(
data
)
{
return
httpRequest
({
url
:
'/api/usercenter/user/update-user'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
data
})
}
\ No newline at end of file
src/api/system.js
浏览文件 @
52dce77c
...
...
@@ -32,5 +32,4 @@ export function fileUpload(formData) {
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
data
:
formData
})
// return httpRequest.post('/api/cms/admin/v1/common/file-upload', { headers: { 'Content-Type': 'multipart/form-data' } })
}
src/pages/settings/staff/index.vue
浏览文件 @
52dce77c
...
...
@@ -95,10 +95,11 @@
<el-form-item
label=
"手机号"
prop=
"phone"
:rules=
"
{ validator: checkedMobile, trigger: 'blur' }">
<el-input
v-model=
"dialogForm.phone"
size=
"small"
></el-input>
</el-form-item>
<el-form-item
label=
"验证码"
prop=
"code"
:rules=
"
{ required: true, message: '请输入验证码', trigger: 'blur' }"
>
<el-form-item
label=
"验证码"
>
<el-col
:span=
"16"
>
<el-form-item
prop=
"endDate"
></el-form-item>
<el-input
v-model=
"dialogForm.code"
size=
"small"
></el-input>
<el-form-item
prop=
"code"
:rules=
"
{ required: true, message: '请输入验证码', trigger: 'blur' }">
<el-input
v-model=
"dialogForm.code"
size=
"small"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"7"
style=
"float:right"
>
<el-button
type=
"primary"
@
click=
"sendCode"
size=
"small"
style=
"width:100%;"
id=
"checkedCode"
:disabled=
"isBtnDisabled"
>
...
...
@@ -126,7 +127,7 @@
<
script
>
import
TableList
from
'@/components/TableList'
import
{
getStaffList
,
getProjectList
,
getRoleList
,
createStaff
,
updateStaff
,
batchDeleteStaff
}
from
'@/api/settings'
import
{
sendCode
}
from
'@/api/account'
import
{
sendCode
,
updatePassword
,
updateUserInfo
}
from
'@/api/account'
import
{
searchUserList
}
from
'@/api/system'
const
MOBILE_REG
=
/^1
(
3
[
0-9
]
|4
[
01456879
]
|5
[
0-35-9
]
|6
[
2567
]
|7
[
0-8
]
|8
[
0-9
]
|9
[
0-35-9
])\d{4,8}
$/
const
EMAIL_REG
=
/^
[
A-Za-z0-9
]
+
([
_.
][
A-Za-z0-9
]
+
)
*@
[
A-Za-z0-9-.
]
+$/
...
...
@@ -367,7 +368,11 @@ export default {
handleDialogSubmit
()
{
this
.
$refs
.
dialogForm
.
validate
(
valid
=>
{
if
(
valid
)
{
console
.
log
(
'dialogForm'
)
if
(
this
.
dialogType
===
'pwd'
)
{
this
.
fetchChangePwd
()
}
else
{
this
.
fetchChangePhone
()
}
}
else
{
return
false
}
...
...
@@ -386,6 +391,35 @@ export default {
}
})
},
fetchChangePwd
()
{
const
params
=
{
account
:
this
.
dialogForm
.
phone
,
code
:
this
.
dialogForm
.
code
,
password
:
this
.
dialogForm
.
password
,
passwordR
:
this
.
dialogForm
.
ensurePassword
}
updatePassword
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
msg
===
'OK'
)
{
this
.
$message
.
success
(
'更改密码成功'
)
this
.
dialogVisible
=
false
}
else
{
this
.
$message
.
error
(
'更改密码失败'
)
}
})
},
fetchChangePhone
()
{
const
params
=
{
mobile
:
this
.
dialogForm
.
phone
||
''
}
updateUserInfo
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
mobile
)
{
this
.
$message
.
success
(
'更改手机号成功'
)
this
.
dialogVisible
=
false
}
else
{
this
.
$message
.
error
(
'更改手机号失败'
)
}
})
},
fetchCreateStaff
()
{
createStaff
(
this
.
form
).
then
((
res
)
=>
{
if
(
res
.
code
===
0
&&
res
.
data
&&
res
.
data
.
id
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论