Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
69c5fcec
Commit
69c5fcec
authored
Sep 10, 2021
by
Zhang Xiaojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
请求函数
parent
ea99fd3a
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
134 additions
and
91 deletions
+134
-91
index.vue
src/components/Editor/index.vue
+0
-6
index.ts
src/service/BannerManagementService/index.ts
+28
-0
index.ts
src/service/LoginService/index.ts
+0
-8
index.ts
src/service/UploadCoverService/index.ts
+0
-12
index.ts
src/service/UserManagementService/index.ts
+44
-0
index.ts
src/service/index.ts
+15
-1
level.ts
src/types/level.ts
+5
-4
index.vue
src/views/Login/index.vue
+30
-19
const.ts
src/views/Root/Security/const.ts
+2
-5
index.vue
src/views/Root/Security/index.vue
+0
-19
vue.config.js
vue.config.js
+10
-17
No files found.
src/components/Editor/index.vue
View file @
69c5fcec
...
...
@@ -9,7 +9,6 @@
import
Vue
from
'vue'
import
{
Editor
,
EditorContent
}
from
'@tiptap/vue-2'
import
StarterKit
from
'@tiptap/starter-kit'
import
Placeholder
from
'@tiptap/extension-placeholder'
import
{
Image
as
Timage
}
from
'@tiptap/extension-image'
import
EditorMenuBar
from
'./editorMenuBar.vue'
...
...
@@ -49,7 +48,6 @@ export default Vue.extend({
extensions
:
[
StarterKit
,
Timage
,
Placeholder
],
autofocus
:
'start'
,
})
...
...
@@ -67,10 +65,6 @@ export default Vue.extend({
img
{
display
:
block
;
margin
:
0
auto
;
&
:
:
after
{
content
:
'sc'
;
display
:
block
;
}
}
}
...
...
src/service/BannerManagementService/index.ts
0 → 100644
View file @
69c5fcec
import
baseAxios
from
'../index'
const
prefix
=
'/banner/admin'
export
function
bannerAdd
(
data
:
{
file_name
:
string
location
:
number
title
:
string
})
{
return
baseAxios
({
url
:
prefix
+
'/add'
,
method
:
'POST'
,
data
,
})
}
export
function
bannerQuery
(
data
:
{
banner_status
:
string
location
:
number
title
:
string
})
{
return
baseAxios
({
url
:
prefix
+
'/add'
,
method
:
'POST'
,
data
,
})
}
\ No newline at end of file
src/service/LoginService/index.ts
deleted
100644 → 0
View file @
ea99fd3a
import
baseAxios
from
'..'
export
function
login
()
{
return
baseAxios
({
method
:
'POST'
,
data
:
JSON
.
stringify
({}),
})
}
src/service/UploadCoverService/index.ts
deleted
100644 → 0
View file @
ea99fd3a
import
baseAxios
from
'..'
export
function
upload
(
file
:
File
|
Blob
)
{
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
);
return
baseAxios
({
method
:
'POST'
,
url
:
'/upload'
,
data
:
formData
})
}
\ No newline at end of file
src/service/UserManagementService/index.ts
0 → 100644
View file @
69c5fcec
import
baseAxios
from
'../index'
const
prefix
=
'/admin'
export
function
adminLogin
(
data
:
{
name
:
string
pwd
:
string
}):
any
;
export
function
adminLogin
(
data
:
{
name
:
string
phone
:
string
verifyCode
:
string
}):
any
;
export
function
adminLogin
(
data
:
{
name
:
string
phone
?:
string
pwd
?:
string
verifyCode
?:
string
})
{
return
baseAxios
({
url
:
prefix
+
'/login'
,
method
:
'POST'
,
data
,
})
}
// export function checkPhoneIsRegistered(phone: string) {
// return baseAxios({
// url: prefix + '/check/phone',
// method: 'get',
// params: {
// phone,
// },
// })
// }
// export function userLogout() {
// return baseAxios({
// url: prefix + '/logout',
// method: 'GET',
// })
// }
src/service/index.ts
View file @
69c5fcec
import
{
getUserMsg
}
from
'@/utils/userMsg/userMsg'
import
axios
from
'axios'
import
{
Modal
}
from
'ant-design-vue'
const
baseAxios
=
axios
.
create
({
baseURL
:
'/
api
'
,
baseURL
:
'/
proxyApi/api/v1
'
,
headers
:
{
Authorization
:
getUserMsg
()?.
token
,
},
...
...
@@ -11,5 +12,18 @@ const baseAxios = axios.create({
const
get
=
baseAxios
.
get
const
post
=
baseAxios
.
post
baseAxios
.
interceptors
.
response
.
use
(
(
value
:
any
)
=>
{
return
value
.
data
},
(
error
)
=>
{
Modal
.
error
({
title
:
'错误'
,
content
:
error
.
message
,
});
throw
new
Error
(
error
)
},
)
export
default
baseAxios
src/types/level.ts
View file @
69c5fcec
export
enum
eLevel
{
firstLevel_branch
,
secondary_branch
,
firstLevel_sub_branch
,
secondary_sub_branch
,
firstLevel_branch
=
1
,
secondary_branch
=
2
,
firstLevel_sub_branch
=
3
,
secondary_sub_branch
=
4
,
}
\ No newline at end of file
src/views/Login/index.vue
View file @
69c5fcec
...
...
@@ -73,6 +73,7 @@ import { setUserMsg } from '@/utils/userMsg/userMsg'
import
{
eLoginWay
}
from
'./type'
import
{
phoneValid
,
isPhoneValid
}
from
'./const'
import
{
Tabs
,
FormModel
}
from
'ant-design-vue'
import
{
adminLogin
}
from
'@/service/UserManagementService/index'
import
Vue
from
'vue'
Vue
.
use
(
Tabs
)
...
...
@@ -150,26 +151,36 @@ export default Vue.extend({
}
return
isValid
},
async
registerFunc
(
phone
:
string
,
code
:
string
)
{
// const ret = await this.$service.userService.loginAndSign({
// codetype: "sms",
// telephone: phone,
// verificationCode: code,
// });
// if (ret) {
// const { Authorization, user } = ret;
// token.setToken(Authorization);
// userMsg.setUserMsg(user);
// this.$router.push({
// name: "Home",
// });
// }
},
async
loginByCodeFunc
(
phone
:
string
,
code
:
string
)
{
return
this
.
registerFunc
(
phone
,
code
);
async
loginByCodeFunc
(
name
:
string
,
phone
:
string
,
code
:
string
)
{
const
ret
=
await
adminLogin
({
name
:
name
,
phone
:
name
,
verifyCode
:
code
,
})
if
(
ret
)
{
const
{
accessToken
,
user
}
=
ret
.
data
// setUserMsg(user)
console
.
log
(
ret
.
data
);
// this.$router.push({
// name: "home",
// });
}
},
async
loginByPwdFunc
(
phone
:
string
,
pwd
:
string
)
{
console
.
log
(
phone
,
pwd
);
async
loginByPwdFunc
(
name
:
string
,
pwd
:
string
)
{
const
ret
=
await
adminLogin
({
name
:
name
,
pwd
:
pwd
,
})
if
(
ret
)
{
const
{
accessToken
,
user
}
=
ret
.
data
// setUserMsg(user)
console
.
log
(
ret
.
data
);
// this.$router.push({
// name: "home",
// });
}
},
async
handleClickLogin
()
{
if
(
this
.
isValid
())
{
...
...
src/views/Root/Security/const.ts
View file @
69c5fcec
export
enum
changeWay
{
CODE
,
PASSWORD
<<<<<<<
HEAD
}
=======
}
export
enum
codeType
{
...
...
@@ -11,5 +8,4 @@ export enum codeType{
toConfirmChange
}
export
const
phoneValid
=
new
RegExp
(
/^
((
0
\d{2,3}
-
\d{7,8})
|
(
1
[
3456789
]\d{9}))
$/
)
>>>>>>>
c85785174709d6a01b7b9e48a35a0b1688df9008
export
const
phoneValid
=
new
RegExp
(
/^
((
0
\d{2,3}
-
\d{7,8})
|
(
1
[
3456789
]\d{9}))
$/
)
\ No newline at end of file
src/views/Root/Security/index.vue
View file @
69c5fcec
<
template
>
<div>
<<<<<<<
HEAD
<p
class=
" text-2xl font-bold mb-5"
>
修改密码
</p>
<a-tabs
default-active-key=
"1"
@
change=
"toggleChangeWay"
style=
"width:40%"
>
<!-- 通过手机验证码修改 -->
...
...
@@ -71,16 +70,10 @@
</a-tab-pane>
</a-tabs>
<a-button
type=
"primary"
@
click=
"handleSubmission"
>
提交
</a-button>
=======
<template>
<router-view></router-view>
</
template
>
>>>>>>> c85785174709d6a01b7b9e48a35a0b1688df9008
</div>
</
template
>
<
script
lang=
"ts"
>
<<<<<<<
HEAD
import
Vue
from
'vue'
import
{
changeWay
}
from
'./const'
import
{
Tabs
,
FormModel
}
from
'ant-design-vue'
...
...
@@ -185,15 +178,4 @@ export default Vue.extend({
.w-200
{
width
:
200px
}
=======
import
Vue
from
'vue'
export
default
Vue
.extend
(
{
}
)
</
script
>
<
style
scoped
>
>>>>>>>
c85785174709d6a01b7b9e48a35a0b1688df9008
</
style
>
\ No newline at end of file
vue.config.js
View file @
69c5fcec
...
...
@@ -13,21 +13,13 @@ module.exports = {
}
},
devServer
:
{
proxy
:
{
// 设置代理
'/api'
:
{
target
:
'http://localhost:8999/news'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
}
},
// [IMAGE_PROXY]: {
// // target: 'http://47.114.159.142:7999',
// target: 'http://localhost:8999',
// pathRewrite: {
// ["^" + IMAGE_PROXY]: '',
// }
// }
}
},
proxy
:
{
"/proxyApi"
:
{
target
:
'http://172.16.102.150:8091'
,
pathRewrite
:
{
'^/proxyApi'
:
''
,
},
}
},
},
}
\ No newline at end of file
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