Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mining-manager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
Mining
mining-manager
Commits
eb96ad45
Commit
eb96ad45
authored
Feb 11, 2022
by
mxm-web-develop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
321
parent
64d642e9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
index.ts
src/api/index.ts
+8
-6
login.vue
src/components/login.vue
+2
-0
vite.config.ts
vite.config.ts
+1
-0
No files found.
src/api/index.ts
View file @
eb96ad45
...
...
@@ -9,21 +9,23 @@ const instance = axios.create({
timeout
:
15000
})
instance
.
interceptors
.
request
.
use
((
config
)
=>
{
if
(
config
.
url
!==
'
/api
/admin/login'
){
if
(
config
.
url
!==
'
http://172.16.100.59:8091
/admin/login'
){
config
.
headers
=
{
'
A
uth-Token'
:
store
?
store
.
token
?
store
.
token
:
''
:
''
'
a
uth-Token'
:
store
?
store
.
token
?
store
.
token
:
''
:
''
}
return
config
}
else
{
return
config
}
})
const
store
=
getStore
<
USR
<
any
>>
(
'mining-manager'
)
export
const
doLogin
=
async
(
data
:
LoginData
)
=>
{
console
.
log
(
111
);
return
instance
.
post
(
'/api/admin/login'
,
return
instance
.
post
(
'http://172.16.100.59:8091/admin/login'
,
data
).
then
(
res
=>
{
console
.
log
(
res
.
headers
);
if
(
res
.
data
.
data
.
isSucc
){
return
res
.
headers
[
'auth-token'
]
}
...
...
@@ -34,7 +36,7 @@ export const doLogin = async (data:LoginData) => {
export
const
getPlatList
=
async
()
=>
{
return
instance
.
get
(
'
/api
/admin/plat-list'
,).
then
(
res
=>
res
.
data
)
return
instance
.
get
(
'
http://172.16.100.59:8091
/admin/plat-list'
,).
then
(
res
=>
res
.
data
)
}
export
interface
GetTransListParams
{
...
...
@@ -50,7 +52,7 @@ export interface GetTransListParams{
export
const
getTransList
=
async
(
params
:
GetTransListParams
)
=>
{
params
.
page
?
params
.
page
:
params
.
page
=
1
params
.
pageSize
?
params
.
pageSize
:
params
.
pageSize
=
10
return
instance
.
get
(
'
/api
/admin/trans-list'
,{
return
instance
.
get
(
'
http://172.16.100.59:8091
/admin/trans-list'
,{
params
:
params
}).
then
(
res
=>
{
return
res
.
data
...
...
src/components/login.vue
View file @
eb96ad45
...
...
@@ -11,6 +11,8 @@ const data = reactive({
const
login
=
async
()
=>
{
const
getToken
=
await
doLogin
(
data
)
console
.
log
(
getToken
,
'这里'
);
if
(
getToken
){
setStore
({
app
:
'mining-manager'
,
...
...
vite.config.ts
View file @
eb96ad45
...
...
@@ -7,6 +7,7 @@ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export
default
defineConfig
({
plugins
:
[
vue
()],
server
:{
port
:
8092
,
proxy
:{
'/api'
:
{
target
:
'http://172.16.100.59:8091/'
,
...
...
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