Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
luqiao-admin-mobile
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨子
luqiao-admin-mobile
Commits
0268c947
Commit
0268c947
authored
Apr 25, 2019
by
牛晓林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加正常跳转功能login
parent
baf79236
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
50 deletions
+24
-50
package.json
package.json
+1
-1
delon.module.ts
src/app/delon.module.ts
+3
-1
passport.component.html
src/app/layout/passport/passport.component.html
+4
-4
login.component.html
src/app/routes/passport/login/login.component.html
+1
-36
login.component.ts
src/app/routes/passport/login/login.component.ts
+7
-7
app-data.json
src/assets/tmp/app-data.json
+0
-1
proxy.config.json
src/proxy.config.json
+8
-0
No files found.
package.json
View file @
0268c947
...
...
@@ -18,7 +18,7 @@
],
"scripts"
:
{
"ng"
:
"ng"
,
"start"
:
"npm run color-less && ng serve -o"
,
"start"
:
"npm run color-less && ng serve -o
--proxy-config src/proxy.config.json
"
,
"hmr"
:
"npm run color-less && ng serve -c=hmr"
,
"build"
:
"npm run color-less && ng build --prod --build-optimizer"
,
"analyze"
:
"ng build --prod --build-optimizer --stats-json"
,
...
...
src/app/delon.module.ts
View file @
0268c947
...
...
@@ -75,7 +75,9 @@ const GLOBAL_CONFIG_PROVIDES = [
// #endregion
@
NgModule
({
imports
:
[
AlainThemeModule
.
forRoot
(),
...
MOCK_MODULES
],
imports
:
[
AlainThemeModule
.
forRoot
()
],
})
export
class
DelonModule
{
constructor
(@
Optional
()
@
SkipSelf
()
parentModule
:
DelonModule
)
{
...
...
src/app/layout/passport/passport.component.html
View file @
0268c947
...
...
@@ -4,15 +4,15 @@
<div
class=
"top"
>
<div
class=
"head"
>
<img
class=
"logo"
src=
"./assets/logo-color.svg"
>
<span
class=
"title"
>
ng-alain
</span>
<span
class=
"title"
>
路桥资产管理系统
</span>
</div>
<div
class=
"desc"
>
武林中最有影响力的《葵花宝典》;欲练神功,挥刀自宫
</div>
<div
class=
"desc"
></div>
</div>
<router-outlet></router-outlet>
<global-footer
[
links
]="
links
"
>
Copyright
<i
class=
"anticon anticon-copyright"
></i>
201
7
<a
href=
"//github.com/cipchk"
target=
"_blank"
>
卡色
</a>
出品
<i
class=
"anticon anticon-copyright"
></i>
201
9
<a
href=
"//github.com/cipchk"
target=
"_blank"
>
山西盈众科技有限公司
</a>
出品
</global-footer>
</div>
</div>
src/app/routes/passport/login/login.component.html
View file @
0268c947
...
...
@@ -23,42 +23,7 @@
</nz-form-control>
</nz-form-item>
</nz-tab>
<nz-tab
[
nzTitle
]="'
app
.
login
.
tab-login-mobile
'
|
translate
"
>
<nz-form-item>
<nz-form-control>
<nz-input-group
nzSize=
"large"
nzPrefixIcon=
"anticon anticon-user"
>
<input
nz-input
formControlName=
"mobile"
placeholder=
"mobile number"
>
</nz-input-group>
<nz-form-explain
*
ngIf=
"mobile.dirty && mobile.errors"
>
<ng-container
*
ngIf=
"mobile.errors.required"
>
{{ 'validation.phone-number.required' | translate }}
</ng-container>
<ng-container
*
ngIf=
"mobile.errors.pattern"
>
{{ 'validation.phone-number.wrong-format' | translate }}
</ng-container>
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-row
[
nzGutter
]="
8
"
>
<nz-col
[
nzSpan
]="
16
"
>
<nz-input-group
nzSize=
"large"
nzPrefixIcon=
"anticon anticon-mail"
>
<input
nz-input
formControlName=
"captcha"
placeholder=
"captcha"
>
</nz-input-group>
<nz-form-explain
*
ngIf=
"captcha.dirty && captcha.errors"
>
{{ 'validation.verification-code.required' | translate }}
</nz-form-explain>
</nz-col>
<nz-col
[
nzSpan
]="
8
"
>
<button
type=
"button"
nz-button
nzSize=
"large"
(
click
)="
getCaptcha
()"
[
disabled
]="
count
"
nzBlock
[
nzLoading
]="
http
.
loading
"
>
{{ count ? count + 's' : 'app.register.get-verification-code' | translate }}
</button>
</nz-col>
</nz-row>
</nz-form-control>
</nz-form-item>
</nz-tab>
</nz-tabset>
<nz-form-item>
<nz-col
[
nzSpan
]="
12
"
>
...
...
src/app/routes/passport/login/login.component.ts
View file @
0268c947
...
...
@@ -7,6 +7,7 @@ import { SocialService, SocialOpenType, ITokenService, DA_SERVICE_TOKEN } from '
import
{
ReuseTabService
}
from
'@delon/abc'
;
import
{
environment
}
from
'@env/environment'
;
import
{
StartupService
}
from
'@core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
@
Component
({
selector
:
'passport-login'
,
...
...
@@ -20,6 +21,7 @@ export class UserLoginComponent implements OnDestroy {
type
=
0
;
constructor
(
private
httpClient
:
HttpClient
,
fb
:
FormBuilder
,
modalSrv
:
NzModalService
,
private
router
:
Router
,
...
...
@@ -102,21 +104,19 @@ export class UserLoginComponent implements OnDestroy {
// 默认配置中对所有HTTP请求都会强制 [校验](https://ng-alain.com/auth/getting-started) 用户 Token
// 然一般来说登录请求不需要校验,因此可以在请求URL加上:`/login?_allow_anonymous=true` 表示不触发用户 Token 校验
this
.
http
.
post
(
'/login/account?_allow_anonymous=true'
,
{
type
:
this
.
type
,
userName
:
this
.
userName
.
value
,
password
:
this
.
password
.
value
,
})
.
post
(
`asset/a/login?__ajax=true&username=
${
this
.
userName
.
value
}
&password=
${
this
.
password
.
value
}
&mobileLogin=true`
,{})
.
subscribe
((
res
:
any
)
=>
{
if
(
res
.
msg
!==
'ok'
)
{
if
(
res
.
success
!==
true
)
{
this
.
error
=
res
.
msg
;
return
;
}
// 清空路由复用信息
this
.
reuseTabService
.
clear
();
// 设置用户Token信息
this
.
tokenService
.
set
(
res
.
user
);
res
.
body
.
token
=
res
.
body
.
JSESSIONID
;
this
.
tokenService
.
set
(
res
.
body
);
// 重新获取 StartupService 内容,我们始终认为应用信息一般都会受当前用户授权范围而影响
this
.
startupSrv
.
load
().
then
(()
=>
{
let
url
=
this
.
tokenService
.
referrer
!
.
url
||
'/'
;
...
...
src/assets/tmp/app-data.json
View file @
0268c947
...
...
@@ -73,7 +73,6 @@
"text"
:
"文件资料"
,
"link"
:
"/dashboard/v1"
,
"children"
:[
]
},{
"text"
:
"系统设置"
,
...
...
src/proxy.config.json
0 → 100644
View file @
0268c947
{
"/asset/*"
:
{
"target"
:
"http://localhost:8081/"
,
"secure"
:
false
,
"logLevel"
:
"debug"
,
"changeOrigin"
:
true
}
}
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