Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cxerpapp
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
李苏
cxerpapp
Commits
f3f1ae77
Commit
f3f1ae77
authored
Feb 11, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
6b99c952
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
66 deletions
+74
-66
main.js
main.js
+2
-0
pages.json
pages.json
+2
-0
cusmerLogin.vue
pages/login/cusmerLogin.vue
+66
-63
login.vue
pages/login/login.vue
+3
-2
people.vue
pages/user/people.vue
+1
-1
No files found.
main.js
View file @
f3f1ae77
...
...
@@ -9,6 +9,8 @@ import {RouterMount} from './plugin/uni-simple-router/index.js'
console
.
log
(
"main"
)
// 注册缓存器
Vue
.
use
(
MinCache
,{
timeout
:
6
})
//判定isCloud
Vue
.
prototype
.
isCloud
=
true
;
// store
Vue
.
prototype
.
$store
=
store
;
// tip
...
...
pages.json
View file @
f3f1ae77
...
...
@@ -9,6 +9,8 @@
"path"
:
"pages/login/login"
,
"style"
:
{}
},
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/index/index"
,
...
...
pages/login/cusmerLogin.vue
View file @
f3f1ae77
...
...
@@ -66,9 +66,9 @@
<!--
<image
src=
"https://static.jeecg.com/upload/test/login4_1595818039175.png"
mode=
"aspectFit"
class=
"round"
></image>
-->
<view
class=
"gray-text"
>
登录中...
</view>
</view>
<view
@
tap=
"changErp()"
style=
"position: absolute;bottom: 20px;right: 10px;text-decoration:underline"
>
<
!--
<
view
@
tap=
"changErp()"
style=
"position: absolute;bottom: 20px;right: 10px;text-decoration:underline"
>
切换到格物erp登录
</view>
</view>
-->
</view>
</
template
>
...
...
@@ -112,6 +112,7 @@
},
onLoad
:
function
(
da
){
this
.
isCloud
=
true
if
(
da
&&
da
.
query
){
let
infor
=
JSON
.
parse
(
da
.
query
).
infor
this
.
userName
=
infor
.
userName
...
...
@@ -144,65 +145,6 @@
// #endif
},
watch
:{
loginBz
:
function
(
val
){
let
_this
=
this
;
http
.
config
.
baseUrl
=
"http://192.168.20.214:9090/erp"
;
if
(
val
){
this
.
$http
.
post
(
this
.
loginurl
,{}).
then
((
resp
)
=>
{
if
(
resp
.
data
.
success
){
console
.
log
(
"success"
)
uni
.
setStorage
({
key
:
'userid'
,
data
:
resp
.
data
.
data
.
userid
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
userid
);
}
});
uni
.
setStorage
({
key
:
'username'
,
data
:
resp
.
data
.
data
.
username
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
username
);
}
});
uni
.
setStorage
({
key
:
'ACCESS_TOKEN'
,
data
:
resp
.
data
.
data
.
token
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
token
)
}
});
// 本地存储信息
uni
.
setStorage
({
key
:
'userName'
,
data
:
_this
.
userName
,
success
:
function
()
{
console
.
log
(
"用户名获取成功"
)
}
});
uni
.
setStorage
({
key
:
'password'
,
data
:
_this
.
password
,
success
:
function
()
{
console
.
log
(
"用户名获取成功"
)
}
});
//ACCESS_TOKEN
this
.
$tip
.
success
(
'登录成功!'
)
this
.
$Router
.
replaceAll
({
name
:
'index'
})
// #ifdef APP-PLUS
// this.saveClientId()
// #endif
// #ifndef APP-PLUS
this
.
$tip
.
success
(
'登录成功!'
)
this
.
$Router
.
replaceAll
({
name
:
'index'
})
// #endif
}
else
{
this
.
$tip
.
alert
(
resp
.
data
.
message
||
"登录失败"
);
}
})
}
}
},
computed
:
{
isSendSMSEnable
()
{
...
...
@@ -224,6 +166,65 @@
},
methods
:
{
...
mapActions
([
"mLogin"
,
"PhoneLogin"
,
"ThirdLogin"
]),
// 二次登录
loginT
(){
let
_this
=
this
;
http
.
config
.
baseUrl
=
"http://localhost:9090/erp"
;
this
.
$http
.
post
(
this
.
loginurl
,{}).
then
((
resp
)
=>
{
if
(
resp
.
data
.
success
){
console
.
log
(
"success"
)
uni
.
setStorage
({
key
:
'userid'
,
data
:
resp
.
data
.
data
.
userid
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
userid
);
}
});
uni
.
setStorage
({
key
:
'username'
,
data
:
resp
.
data
.
data
.
username
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
username
);
}
});
uni
.
setStorage
({
key
:
'ACCESS_TOKEN'
,
data
:
resp
.
data
.
data
.
token
,
success
:
function
()
{
console
.
log
(
resp
.
data
.
data
.
token
)
}
});
// 本地存储信息
uni
.
setStorage
({
key
:
'userName'
,
data
:
_this
.
userName
,
success
:
function
()
{
console
.
log
(
"用户名获取成功"
)
}
});
uni
.
setStorage
({
key
:
'password'
,
data
:
_this
.
password
,
success
:
function
()
{
console
.
log
(
"用户名获取成功"
)
}
});
//ACCESS_TOKEN
this
.
$tip
.
success
(
'登录成功!'
)
this
.
$Router
.
replaceAll
({
name
:
'index'
})
// #ifdef APP-PLUS
// this.saveClientId()
// #endif
// #ifndef APP-PLUS
this
.
$tip
.
success
(
'登录成功!'
)
this
.
$Router
.
replaceAll
({
name
:
'index'
})
// #endif
}
else
{
this
.
$tip
.
alert
(
resp
.
data
.
message
||
"登录失败"
);
}
})
},
changErp
(){
this
.
$Router
.
replaceAll
({
name
:
'login'
})
},
...
...
@@ -240,7 +241,7 @@
onLogin
:
function
(){
// http.config.baseUrl='http://'+this.fwq+'/'+this.dkh
let
_this
=
this
;
http
.
config
.
baseUrl
=
"http://
192.168.20.214
:9080/"
http
.
config
.
baseUrl
=
"http://
localhost
:9080/"
if
(
!
this
.
userName
||
this
.
userName
.
length
==
0
){
this
.
$tip
.
toast
(
'请填写用户名'
);
return
;
...
...
@@ -268,9 +269,11 @@
},
3000
)
this
.
$http
.
post
(
"/erp/clouderp/cusmer/login"
,
params
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
success
){
this
.
lo
ginBz
=
tru
e
;
this
.
lo
ading
=
fals
e
;
this
.
loginurl
=
resp
.
data
.
data
.
records
+
"&&tp='1'"
;
this
.
loginT
()
}
else
{
this
.
loading
=
false
;
this
.
$tip
.
alert
(
resp
.
data
.
message
||
"请求失败"
);
}
})
...
...
pages/login/login.vue
View file @
f3f1ae77
...
...
@@ -76,9 +76,9 @@
<!--
<image
src=
"https://static.jeecg.com/upload/test/login4_1595818039175.png"
mode=
"aspectFit"
class=
"round"
></image>
-->
<view
class=
"gray-text"
>
登录中...
</view>
</view>
<view
@
tap=
"changErp()"
style=
"position: absolute;bottom: 20px;right: 10px;text-decoration:underline"
>
<
!--
<
view
@
tap=
"changErp()"
style=
"position: absolute;bottom: 20px;right: 10px;text-decoration:underline"
>
切换到格物云erp登录
</view>
</view>
-->
</view>
</
template
>
...
...
@@ -120,6 +120,7 @@
},
onLoad
:
function
(
da
){
this
.
isCloud
=
false
if
(
da
&&
da
.
query
){
let
infor
=
JSON
.
parse
(
da
.
query
).
infor
this
.
userName
=
infor
.
userName
...
...
pages/user/people.vue
View file @
f3f1ae77
...
...
@@ -41,7 +41,7 @@
<text
class=
"text-grey"
>
设置
</text>
</view>
</navigator>
<navigator
style=
""
class=
"cu-item arrow animation-slide-bottom"
:style=
"[
{animationDelay: '0.7s'}]"
url="/pages/login/login"
hover-class="none">
<navigator
style=
""
class=
"cu-item arrow animation-slide-bottom"
:style=
"[
{animationDelay: '0.7s'}]"
:url="isCloud?'/pages/login/login':'/pages/login/cusmerLogin'"
hover-class="none">
<view
class=
"content"
@
click=
"clearToken()"
>
<text
class=
"cuIcon-exit text-cyan"
></text>
<text
class=
"text-grey"
>
退出
</text>
...
...
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