Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mocp-uniapp
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
pangchong
mocp-uniapp
Commits
474be6a7
Commit
474be6a7
authored
Aug 22, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整
parent
4fff4973
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
+29
-29
src/pages/modules/mocp/login/constants/index.functionals.js
+0
-28
src/pages/modules/mocp/login/index.vue
+29
-1
No files found.
src/pages/modules/mocp/login/constants/index.functionals.js
View file @
474be6a7
...
...
@@ -11,31 +11,3 @@ export const getGifCaptcha = async () => {
loginCode
.
value
=
'data:image/png;base64,'
+
uni
.
arrayBufferToBase64
(
res
)
}
}
//接入amms
export
const
loginAmms
=
()
=>
{
const
ammsToken
=
uni
.
getStorageSync
(
'access_token'
)
if
(
ammsToken
)
{
showLoad
.
value
=
true
uni
.
request
({
url
:
`http://10.72.63.191:8080/mroapi/auth/oauth/check_token?token=
${
ammsToken
}
`
,
method
:
'GET'
,
header
:
{
Authorization
:
'Basic YXBwOmVraW5n'
}
})
.
then
(
function
(
res
)
{
showLoad
.
value
=
false
if
(
res
.
username
)
{
loginForm
.
username
=
res
.
username
loginForm
.
verifyCode
=
'Mocp_DebuG_9527_8341'
loginForm
.
password
=
'Ifar2016_0525'
handleLogin
()
}
})
.
catch
(
function
(
reason
)
{
showLoad
.
value
=
false
console
.
log
(
'AMMS跳转登录出现错误'
,
reason
)
})
}
}
src/pages/modules/mocp/login/index.vue
View file @
474be6a7
...
...
@@ -41,7 +41,7 @@
<
script
setup
>
import
{
debounce
}
from
'lodash'
import
{
loginCode
,
loginForm
,
rules
,
loginFormRef
,
showLoad
}
from
'./constants/index.compositions'
import
{
getGifCaptcha
,
loginAmms
}
from
'./constants/index.functionals'
import
{
getGifCaptcha
}
from
'./constants/index.functionals'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
ref
,
toRaw
,
watch
}
from
'vue'
import
useUserStore
from
'mocp/store/user'
...
...
@@ -76,6 +76,34 @@ const handleLogin = async () => {
uni
.
$mocpMessage
.
error
(
res
.
message
)
}
}
//接入amms
const
loginAmms
=
()
=>
{
const
ammsToken
=
uni
.
getStorageSync
(
'access_token'
)
if
(
ammsToken
)
{
showLoad
.
value
=
true
uni
.
request
({
url
:
`http://10.72.63.191:8080/mroapi/auth/oauth/check_token?token=
${
ammsToken
}
`
,
method
:
'GET'
,
header
:
{
Authorization
:
'Basic YXBwOmVraW5n'
}
})
.
then
(
function
(
res
)
{
if
(
res
.
username
)
{
loginForm
.
username
=
res
.
username
loginForm
.
verifyCode
=
'Mocp_DebuG_9527_8341'
loginForm
.
password
=
'Ifar2016_0525'
handleLogin
()
}
})
.
catch
(
function
(
reason
)
{
console
.
log
(
'AMMS跳转登录出现错误'
,
reason
)
})
.
finally
(()
=>
{
showLoad
.
value
=
false
})
}
}
</
script
>
<
style
lang=
"scss"
>
@import
'./constants/index.scss'
;
...
...
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