Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
ydLife
Commits
9a830047
Commit
9a830047
authored
Oct 27, 2021
by
sunchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取token接口添加loginId&验证码6位
parent
4de97899
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
8 deletions
+14
-8
src/app/app.component.ts
+3
-1
src/app/auth/auth.service.ts
+2
-5
src/app/auth/login/login.component.html
+1
-1
src/app/auth/login/login.component.ts
+5
-0
src/index.html
+3
-1
No files found.
src/app/app.component.ts
View file @
9a830047
...
@@ -18,6 +18,7 @@ export class AppComponent implements OnInit, OnDestroy {
...
@@ -18,6 +18,7 @@ export class AppComponent implements OnInit, OnDestroy {
dialogInfo
:
any
;
dialogInfo
:
any
;
// 是否显示首页浮标
// 是否显示首页浮标
isShowIndexBtn
:
boolean
;
isShowIndexBtn
:
boolean
;
loginId
:
any
;
constructor
(
private
router
:
Router
,
private
authService
:
AuthService
,
private
lifeCommonService
:
LifeCommonService
)
{
constructor
(
private
router
:
Router
,
private
authService
:
AuthService
,
private
lifeCommonService
:
LifeCommonService
)
{
this
.
subscription
=
lifeCommonService
.
shareStatus$
.
subscribe
(
status
=>
{
this
.
subscription
=
lifeCommonService
.
shareStatus$
.
subscribe
(
status
=>
{
this
.
shareGuidePageEnable
=
status
==
'1'
;
this
.
shareGuidePageEnable
=
status
==
'1'
;
...
@@ -25,7 +26,8 @@ export class AppComponent implements OnInit, OnDestroy {
...
@@ -25,7 +26,8 @@ export class AppComponent implements OnInit, OnDestroy {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
authService
.
obtainToken
().
subscribe
(
res
=>
{
this
.
loginId
=
localStorage
.
getItem
(
'lifeCustomerInfo'
)?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
)).
mobileNo
:
null
;
this
.
authService
.
obtainToken
(
this
.
loginId
).
subscribe
(
res
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
localStorage
.
setItem
(
'lifeToken'
,
res
[
'data'
][
'token'
]);
localStorage
.
setItem
(
'lifeToken'
,
res
[
'data'
][
'token'
]);
this
.
ydWxConfig
();
this
.
ydWxConfig
();
...
...
src/app/auth/auth.service.ts
View file @
9a830047
...
@@ -43,12 +43,9 @@ export class AuthService {
...
@@ -43,12 +43,9 @@ export class AuthService {
/**
/**
* 获取TOKEN
* 获取TOKEN
*/
*/
obtainToken
()
{
obtainToken
(
loginId
)
{
const
url
=
this
.
API
+
'/authorize/obtainToken'
;
const
url
=
this
.
API
+
'/authorize/obtainToken'
;
const
ticketObj
=
{
return
this
.
http
.
post
(
url
,
JSON
.
stringify
({
ticket
:
"life"
,
loginId
:
loginId
}));
ticket
:
'life'
};
return
this
.
http
.
post
(
url
,
JSON
.
stringify
(
ticketObj
));
}
}
//获取微信配置ydLife公众号
//获取微信配置ydLife公众号
...
...
src/app/auth/login/login.component.html
View file @
9a830047
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<div
class=
"weui-cell weui-cell_vcode"
style=
"padding:12px 0px"
>
<div
class=
"weui-cell weui-cell_vcode"
style=
"padding:12px 0px"
>
<!-- <div class="weui-cell__hd"><label class="weui-label">验证码</label></div> -->
<!-- <div class="weui-cell__hd"><label class="weui-label">验证码</label></div> -->
<div
class=
"weui-cell__bd"
>
<div
class=
"weui-cell__bd"
>
<input
class=
"weui-input"
type=
"tel"
pattern=
"[0-9]*"
id=
"js_input"
placeholder=
"请输入验证码"
maxlength=
"
4
"
<input
class=
"weui-input"
type=
"tel"
pattern=
"[0-9]*"
id=
"js_input"
placeholder=
"请输入验证码"
maxlength=
"
6
"
name=
"verificationCode"
[(
ngModel
)]="
userInfo
.
verificationCode
"
(
blur
)="
inputBlur
()"
>
name=
"verificationCode"
[(
ngModel
)]="
userInfo
.
verificationCode
"
(
blur
)="
inputBlur
()"
>
</div>
</div>
<div
class=
"weui-cell__ft"
>
<div
class=
"weui-cell__ft"
>
...
...
src/app/auth/login/login.component.ts
View file @
9a830047
...
@@ -52,6 +52,11 @@ export class LoginComponent implements OnInit, OnDestroy {
...
@@ -52,6 +52,11 @@ export class LoginComponent implements OnInit, OnDestroy {
sessionStorage
.
setItem
(
'subordinateSystemName'
,
response
[
'data'
][
'practitionerBasicInfo'
][
'subordinateName'
])
sessionStorage
.
setItem
(
'subordinateSystemName'
,
response
[
'data'
][
'practitionerBasicInfo'
][
'subordinateName'
])
}
}
const
lifeCustomerInfo
=
{
...
response
.
data
,
mobileNo
:
this
.
userInfo
.
mobileNo
,
commonResult
:
null
};
const
lifeCustomerInfo
=
{
...
response
.
data
,
mobileNo
:
this
.
userInfo
.
mobileNo
,
commonResult
:
null
};
this
.
authService
.
obtainToken
(
this
.
userInfo
.
mobileNo
).
subscribe
((
res
)
=>
{
if
(
res
[
'success'
])
{
localStorage
.
setItem
(
'lifeToken'
,
res
[
'data'
][
'token'
]);
}
})
if
(
lifeCustomerInfo
[
'customerId'
]
&&
lifeCustomerInfo
[
'practitionerId'
])
{
if
(
lifeCustomerInfo
[
'customerId'
]
&&
lifeCustomerInfo
[
'practitionerId'
])
{
// if (response['data']['practitionerTypeId'] == 28) {
// if (response['data']['practitionerTypeId'] == 28) {
localStorage
.
setItem
(
'lifeCustomerInfo'
,
JSON
.
stringify
(
lifeCustomerInfo
));
localStorage
.
setItem
(
'lifeCustomerInfo'
,
JSON
.
stringify
(
lifeCustomerInfo
));
...
...
src/index.html
View file @
9a830047
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
<script
src=
"./assets/laydate/laydate.js"
></script>
<script
src=
"./assets/laydate/laydate.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
api
=
'https://'
+
window
.
location
.
host
;
var
api
=
'https://'
+
window
.
location
.
host
;
var
loginId
=
localStorage
.
getItem
(
'lifeCustomerInfo'
)?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
)).
mobileNo
:
null
;
// var api = 'https://mdev.zuihuibi.cn';
// var api = 'https://mdev.zuihuibi.cn';
function
getToken
()
{
function
getToken
()
{
$
.
ajax
({
$
.
ajax
({
...
@@ -80,7 +81,8 @@
...
@@ -80,7 +81,8 @@
url
:
api
+
'/api/authorize/obtainToken'
,
url
:
api
+
'/api/authorize/obtainToken'
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
data
:
JSON
.
stringify
({
data
:
JSON
.
stringify
({
ticket
:
'life'
ticket
:
'life'
,
loginId
:
loginId
}),
}),
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
...
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