Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
a3a4366e
提交
a3a4366e
authored
7月 17, 2019
作者:
hexi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户手机号没有绑定微信弹出提示框
上级
5754ccd9
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
9 行删除
+46
-9
bindAccount.js
learnOnline/pages/index/bindAccount/bindAccount.js
+20
-4
bindPhone.js
learnOnline/pages/index/bindPhone/bindPhone.js
+20
-3
util.js
learnOnline/utils/util.js
+6
-2
没有找到文件。
learnOnline/pages/index/bindAccount/bindAccount.js
浏览文件 @
a3a4366e
...
...
@@ -13,8 +13,7 @@ const BindAccount = {
/* 点击确定 */
accountConfirm
:
function
(
e
)
{
const
_that
=
this
,
_bind
=
_that
.
data
.
bindaccount
const
_that
=
this
,
_bind
=
_that
.
data
.
bindaccount
;
/* 调用接口 - 使用账号登录 */
wx
.
request
({
url
:
util
.
config
.
URL_PATH2
+
'/user_center/login'
,
...
...
@@ -24,11 +23,12 @@ const BindAccount = {
service
:
'applet.ezijing.com'
},
method
:
'POST'
,
header
:
{
'tenant'
:
util
.
config
.
tenant
,
'content-type'
:
'application/x-www-form-urlencoded'
,
'version'
:
util
.
config
.
version
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
},
success
:
function
(
res
)
{
if
(
res
.
statusCode
&&
res
.
statusCode
!=
200
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
wx
.
hideToast
()
wx
.
hideToast
()
;
wx
.
setStorageSync
(
'userSession'
,
{
sessionKey
:
res
.
data
.
ticket
});
let
_token
=
wx
.
getStorageSync
(
'userSession'
).
sessionKey
...
...
@@ -43,10 +43,26 @@ const BindAccount = {
token
:
_token
,
tenant
:
util
.
config
.
tenant
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
,
'version'
:
util
.
config
.
version
,
unionid
:
wx
.
getStorageSync
(
'union_id'
)
},
success
:
res
=>
{
if
(
res
.
statusCode
!=
200
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
if
(
res
.
statusCode
!=
200
&&
res
.
statusCode
!=
401
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
if
(
res
.
statusCode
&&
res
.
statusCode
==
401
)
{
// 401特殊处理,这种情况,理解为手机号绑定错误
wx
.
hideToast
();
wx
.
showModal
({
title
:
'提示'
,
content
:
res
.
data
.
message
,
showCancel
:
false
,
complete
(
res
)
{
_that
.
setData
({
'bindaccount.pwd'
:
''
,
});
}
})
return
;
}
let
_userInfo
=
{
avatarUrl
:
res
.
data
.
avatar
||
_that
.
tempUserInfo
.
avatarUrl
||
'无'
,
nickName
:
res
.
data
.
nickname
||
_that
.
tempUserInfo
.
nickName
||
'无'
...
...
learnOnline/pages/index/bindPhone/bindPhone.js
浏览文件 @
a3a4366e
...
...
@@ -46,7 +46,7 @@ const BindPhone = {
},
/* 点击确定 */
codeConfirm
:
function
(
e
)
{
const
_that
=
this
,
_bind
=
_that
.
data
.
bindphone
const
_that
=
this
,
_bind
=
_that
.
data
.
bindphone
;
if
(
!
_bind
.
phone
||
!
/^1
[
3-9
][
0-9
]{9}
$/
.
test
(
_bind
.
phone
))
{
wx
.
showToast
({
title
:
'请填入正确手机号'
,
icon
:
'none'
});
return
;
}
if
(
!
_bind
.
code
||
!
/^
\d{4}
$/
.
test
(
_bind
.
code
))
{
wx
.
showToast
({
title
:
'请填入正确验证码'
,
icon
:
'none'
});
return
;
}
wx
.
showToast
({
title
:
'验证中'
,
icon
:
'none'
})
...
...
@@ -56,11 +56,12 @@ const BindPhone = {
data
:
{
mobile
:
_bind
.
phone
,
code
:
_bind
.
code
,
service
:
'applet.ezijing.com'
},
method
:
'POST'
,
header
:
{
'tenant'
:
util
.
config
.
tenant
,
'content-type'
:
'application/x-www-form-urlencoded'
,
'version'
:
util
.
config
.
version
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
},
success
:
function
(
res
)
{
if
(
res
.
statusCode
&&
res
.
statusCode
!=
200
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
wx
.
hideToast
()
wx
.
hideToast
()
;
clearInterval
(
_that
.
timer
);
wx
.
setStorageSync
(
'userSession'
,
{
sessionKey
:
res
.
data
.
ticket
});
...
...
@@ -76,10 +77,26 @@ const BindPhone = {
token
:
_token
,
'tenant'
:
util
.
config
.
tenant
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
,
'version'
:
util
.
config
.
version
,
unionid
:
wx
.
getStorageSync
(
'union_id'
)
},
success
:
res
=>
{
if
(
res
.
statusCode
!=
200
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
if
(
res
.
statusCode
!=
200
&&
res
.
statusCode
!=
401
)
{
wx
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
});
return
;
}
if
(
res
.
statusCode
&&
res
.
statusCode
==
401
)
{
// 401特殊处理,这种情况,理解为手机号绑定错误
wx
.
hideToast
();
wx
.
showModal
({
title
:
'提示'
,
content
:
res
.
data
.
message
,
showCancel
:
false
,
complete
(
res
)
{
_that
.
setData
({
'bindphone.code'
:
''
,
});
}
})
return
;
}
let
_userInfo
=
{
avatarUrl
:
res
.
data
.
avatar
||
_that
.
tempUserInfo
.
avatarUrl
||
'无'
,
nickName
:
res
.
data
.
nickname
||
_that
.
tempUserInfo
.
nickName
||
'无'
...
...
learnOnline/utils/util.js
浏览文件 @
a3a4366e
...
...
@@ -11,7 +11,7 @@ const config = {
URL_PATH2
:
'https://sso.ezijing.com'
,
// 正式域名 - 由于项目变动域名
outSiteLink
:
'https://e-learning.ezijing.com'
,
// 正式外链
tenant
:
'sofia'
,
version
:
'3.0.
5
'
version
:
'3.0.
7
'
};
/* 请求接口统一 重定义 */
const
requestApi
=
(
obj
)
=>
{
...
...
@@ -133,8 +133,8 @@ const loginApi = (obj, callback) => {
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
},
success
:
res1
=>
{
if
(
res1
.
statusCode
==
200
)
{
let
_token
=
res1
.
data
.
ticket
;
if
(
!
_token
)
{
wx
.
reLaunch
({
url
:
'/pages/index/index'
})
return
;
...
...
@@ -147,6 +147,7 @@ const loginApi = (obj, callback) => {
data
:
{},
method
:
'GET'
,
header
:
{
token
:
_token
,
tenant
:
config
.
tenant
,
'version'
:
config
.
version
,
'apikey'
:
'pP5ECUqRDLDzuh4qRuJro0L1LPgjLP0N'
,
unionid
:
res
.
data
.
union_id
},
...
...
@@ -158,6 +159,9 @@ const loginApi = (obj, callback) => {
callback
(
res1
,
obj
);
}
})
}
else
{
callback
(
res1
,
obj
);
}
}
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论