Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Damon
study
Commits
d752ba30
Commit
d752ba30
authored
Aug 03, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of
https://git.banshouhui.com/wuzhenzhe/study
into dev-v1.0.0
parents
74c975be
765a3b41
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
42 deletions
+68
-42
mine.vue
src/pages/index/mine.vue
+1
-1
index.vue
src/pages/login/index.vue
+12
-1
certify.vue
src/pages/mine/certify.vue
+20
-5
info.vue
src/pages/mine/info.vue
+35
-35
No files found.
src/pages/index/mine.vue
View file @
d752ba30
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
</view>
</view>
</view>
</view>
<view
class=
"u-m-r-10 avatar"
>
<view
class=
"u-m-r-10 avatar"
>
<u-avatar
class=
"avatar-iamge"
:src=
"avatar"
size=
"1
4
0"
></u-avatar>
<u-avatar
class=
"avatar-iamge"
:src=
"avatar"
size=
"1
6
0"
></u-avatar>
</view>
</view>
</view>
</view>
<view
class=
""
>
<view
class=
""
>
...
...
src/pages/login/index.vue
View file @
d752ba30
...
@@ -35,6 +35,7 @@ export default {
...
@@ -35,6 +35,7 @@ export default {
return
{
return
{
title
:
'微信授权登录'
,
title
:
'微信授权登录'
,
host
:
''
,
//配置为自己的额服务器即可
host
:
''
,
//配置为自己的额服务器即可
back
:
false
,
//跳回页面
}
}
},
},
computed
:
{
computed
:
{
...
@@ -42,7 +43,11 @@ export default {
...
@@ -42,7 +43,11 @@ export default {
return
process
.
uniEnv
.
qn_base_url
+
'LOGO@3x.png'
return
process
.
uniEnv
.
qn_base_url
+
'LOGO@3x.png'
},
},
},
},
onShow
()
{},
onLoad
(
params
)
{
if
(
params
&&
params
.
back
)
{
this
.
back
=
true
}
},
methods
:
{
methods
:
{
wxLogin
()
{
wxLogin
()
{
// 获取code 小程序专有,用户登录凭证。
// 获取code 小程序专有,用户登录凭证。
...
@@ -68,6 +73,12 @@ export default {
...
@@ -68,6 +73,12 @@ export default {
})
})
this
.
$u
.
api
.
loginWechatAuth
(
data
).
then
((
res
)
=>
{
this
.
$u
.
api
.
loginWechatAuth
(
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
this
.
back
)
{
this
.
$u
.
route
({
type
:
'back'
,
})
return
}
this
.
$u
.
vuex
(
'vuex_token'
,
res
.
token
)
this
.
$u
.
vuex
(
'vuex_token'
,
res
.
token
)
this
.
$u
.
vuex
(
'openId'
,
res
.
openId
)
this
.
$u
.
vuex
(
'openId'
,
res
.
openId
)
this
.
$u
.
vuex
(
'userInfo'
,
userInfo
)
this
.
$u
.
vuex
(
'userInfo'
,
userInfo
)
...
...
src/pages/mine/certify.vue
View file @
d752ba30
...
@@ -79,7 +79,8 @@ export default {
...
@@ -79,7 +79,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
student
:
{},
student
:
{},
token
:
''
,
qiToken
:
''
,
vToken
:
null
,
}
}
},
},
computed
:
{
computed
:
{
...
@@ -118,7 +119,11 @@ export default {
...
@@ -118,7 +119,11 @@ export default {
},
},
onLoad
()
{
onLoad
()
{
this
.
student
=
getApp
().
globalData
.
student
this
.
student
=
getApp
().
globalData
.
student
this
.
token
=
getApp
().
globalData
.
qiNiuToken
this
.
qiToken
=
getApp
().
globalData
.
qiNiuToken
this
.
vToken
=
this
.
vuex_token
},
onUnload
()
{
uni
.
hideLoading
()
},
},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
...
@@ -148,19 +153,24 @@ export default {
...
@@ -148,19 +153,24 @@ export default {
})
})
},
},
getFront
()
{
getFront
()
{
let
that
=
this
//身份证正面图片识别
//身份证正面图片识别
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
this
.
student
.
identityFrontPath
=
res
.
key
this
.
student
.
identityFrontPath
=
res
.
key
uni
.
showLoading
({
title
:
'识别中,请稍后'
,
})
this
.
$u
.
api
this
.
$u
.
api
.
getCertifyInfoByType
(
'front'
,
{
.
getCertifyInfoByType
(
'front'
,
{
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'识别结果'
,
res
)
uni
.
hideLoading
(
)
this
.
student
.
name
=
res
.
name
this
.
student
.
name
=
res
.
name
this
.
student
.
identityNumber
=
res
.
number
this
.
student
.
identityNumber
=
res
.
number
})
})
.
catch
((
data
)
=>
{
.
catch
((
data
)
=>
{
uni
.
hideLoading
()
this
.
student
.
name
=
''
this
.
student
.
name
=
''
this
.
student
.
identityNumber
=
''
this
.
student
.
identityNumber
=
''
this
.
$u
.
toast
(
'识别身份证信息错误'
)
this
.
$u
.
toast
(
'识别身份证信息错误'
)
...
@@ -169,17 +179,22 @@ export default {
...
@@ -169,17 +179,22 @@ export default {
},
},
getBack
()
{
getBack
()
{
//身份证反面图片识别
//身份证反面图片识别
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
this
.
student
.
identityBackPath
=
res
.
key
this
.
student
.
identityBackPath
=
res
.
key
uni
.
showLoading
({
title
:
'识别中,请稍后'
,
})
this
.
$u
.
api
this
.
$u
.
api
.
getCertifyInfoByType
(
'back'
,
{
.
getCertifyInfoByType
(
'back'
,
{
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
uni
.
hideLoading
()
console
.
log
(
'识别结果'
,
res
)
console
.
log
(
'识别结果'
,
res
)
this
.
student
.
certificateValidityDate
=
res
.
expire
this
.
student
.
certificateValidityDate
=
res
.
expire
})
})
.
catch
((
data
)
=>
{
.
catch
((
data
)
=>
{
uni
.
hideLoading
()
this
.
student
.
certificateValidityDate
=
''
this
.
student
.
certificateValidityDate
=
''
this
.
$u
.
toast
(
'识别身份证信息错误'
)
this
.
$u
.
toast
(
'识别身份证信息错误'
)
})
})
...
...
src/pages/mine/info.vue
View file @
d752ba30
...
@@ -86,7 +86,7 @@ export default {
...
@@ -86,7 +86,7 @@ export default {
student
:
{
student
:
{
isCertify
:
false
,
isCertify
:
false
,
},
},
t
oken
:
null
,
qiT
oken
:
null
,
code
:
''
,
code
:
''
,
count
:
0
,
count
:
0
,
}
}
...
@@ -126,7 +126,7 @@ export default {
...
@@ -126,7 +126,7 @@ export default {
.
getQiNiuToken
({
bucketName
:
'banshou-userprofile'
})
.
getQiNiuToken
({
bucketName
:
'banshou-userprofile'
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'chushihua token'
,
res
)
console
.
log
(
'chushihua token'
,
res
)
this
.
t
oken
=
res
//token为七牛云的token一般由后台接口提供
this
.
qiT
oken
=
res
//token为七牛云的token一般由后台接口提供
getApp
().
globalData
.
qiNiuToken
=
res
getApp
().
globalData
.
qiNiuToken
=
res
})
})
this
.
$u
.
api
.
getUserInfo
().
then
((
res
)
=>
{
this
.
$u
.
api
.
getUserInfo
().
then
((
res
)
=>
{
...
@@ -159,7 +159,6 @@ export default {
...
@@ -159,7 +159,6 @@ export default {
},
},
getPhonenumber
(
e
)
{
getPhonenumber
(
e
)
{
console
.
log
(
'eeeee'
,
e
)
console
.
log
(
'eeeee'
,
e
)
let
that
=
this
let
params
=
{}
let
params
=
{}
if
(
e
&&
e
.
detail
)
{
if
(
e
&&
e
.
detail
)
{
if
(
e
.
detail
.
errMsg
.
indexOf
(
'user deny'
)
>
-
1
)
{
if
(
e
.
detail
.
errMsg
.
indexOf
(
'user deny'
)
>
-
1
)
{
...
@@ -172,14 +171,14 @@ export default {
...
@@ -172,14 +171,14 @@ export default {
iv
:
e
.
detail
.
iv
,
iv
:
e
.
detail
.
iv
,
}
}
}
else
{
}
else
{
th
at
.
$u
.
toast
(
e
.
detail
.
errMsg
)
th
is
.
$u
.
toast
(
e
.
detail
.
errMsg
)
return
return
}
}
}
else
{
}
else
{
th
at
.
$u
.
toast
(
'授权失败,请重新授权'
)
th
is
.
$u
.
toast
(
'授权失败,请重新授权'
)
return
return
}
}
th
at
.
syncUserinfo
(
params
)
th
is
.
syncUserinfo
(
params
)
},
},
syncUserinfo
(
params
)
{
syncUserinfo
(
params
)
{
let
that
=
this
let
that
=
this
...
@@ -190,24 +189,12 @@ export default {
...
@@ -190,24 +189,12 @@ export default {
uni
.
login
({
uni
.
login
({
provider
:
'weixin'
,
provider
:
'weixin'
,
success
:
(
code_res
)
=>
{
success
:
(
code_res
)
=>
{
//获取code
if
(
code_res
.
errMsg
==
'login:ok'
)
{
if
(
code_res
.
errMsg
==
'login:ok'
)
{
console
.
log
(
'走的第一个2'
)
console
.
log
(
'走的第一个2'
)
params
.
code
=
code_res
.
code
params
.
code
=
code_res
.
code
that
.
$u
.
api
//传参到服务器解析
.
loginWechatAuth
(
params
)
that
.
sendInfo
(
params
)
.
then
((
res
)
=>
{
that
.
student
.
phoneNumber
=
res
.
phoneNumber
that
.
$u
.
api
.
updateUserInfo
({
phoneNumber
:
res
.
phoneNumber
,
})
.
then
((
ret
)
=>
{
that
.
$u
.
toast
(
'绑定成功!'
)
})
})
.
catch
((
err
)
=>
{
that
.
toLogin
()
})
}
}
},
},
})
})
...
@@ -215,26 +202,39 @@ export default {
...
@@ -215,26 +202,39 @@ export default {
fail
()
{
fail
()
{
console
.
log
(
'走的第二个1'
,
params
)
console
.
log
(
'走的第二个1'
,
params
)
// session_key 已经失效,需要重新执行登录流程
// session_key 已经失效,需要重新执行登录流程
that
.
count
++
setTimeout
(()
=>
{
if
(
that
.
count
>
1
)
{
uni
.
navigateTo
({
console
.
log
(
'重试次数大于1'
)
url
:
'pages/login/index'
,
that
.
toLogin
()
})
}
},
800
)
that
.
syncUserinfo
(
params
)
},
},
})
})
},
},
toLogin
()
{
sendInfo
(
params
)
{
that
.
$u
.
toast
(
'登录信息失效,请重新登录后重试'
)
this
.
$u
.
api
setTimeout
(()
=>
{
.
loginWechatAuth
(
params
)
uni
.
navigateTo
({
.
then
((
res
)
=>
{
url
:
'pages/login/index'
,
this
.
student
.
phoneNumber
=
res
.
phoneNumber
this
.
$u
.
api
.
updateUserInfo
({
phoneNumber
:
res
.
phoneNumber
,
})
.
then
((
ret
)
=>
{
this
.
$u
.
toast
(
'绑定成功!'
)
})
})
.
catch
((
err
)
=>
{
this
.
$u
.
route
({
url
:
'pages/login/index'
,
params
:
{
back
:
true
,
},
})
})
})
},
800
)
},
},
changeHead
()
{
changeHead
()
{
//获取图片
//获取图片
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
this
.
student
.
avatarPath
=
process
.
uniEnv
.
qn_asset_url
+
res
.
key
this
.
student
.
avatarPath
=
process
.
uniEnv
.
qn_asset_url
+
res
.
key
this
.
$u
.
api
.
updateUserInfo
({
this
.
$u
.
api
.
updateUserInfo
({
avatarPath
:
this
.
student
.
avatarPath
,
avatarPath
:
this
.
student
.
avatarPath
,
...
@@ -243,7 +243,7 @@ export default {
...
@@ -243,7 +243,7 @@ export default {
},
},
changeCertPhoto
()
{
changeCertPhoto
()
{
//获取图片
//获取图片
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
//显示
//显示
this
.
student
.
certificatePhotoPath
=
this
.
student
.
certificatePhotoPath
=
process
.
uniEnv
.
qn_asset_url
+
res
.
key
process
.
uniEnv
.
qn_asset_url
+
res
.
key
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment