初始化admin pc端
This commit is contained in:
parent
bc41d7362b
commit
37439d9bde
|
|
@ -1,4 +1,4 @@
|
|||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
VITE_APP_BASE_URL='https://likeadmin.yixiangonline.com'
|
||||
VITE_APP_BASE_URL='http://likeadmin-java-api.yixiangonline.com'
|
||||
|
|
@ -24,15 +24,19 @@ export default defineComponent({
|
|||
// 获取配置
|
||||
const data = await store.dispatch('app/getConfig')
|
||||
|
||||
console.log(data, 'data.webFavicon')
|
||||
|
||||
// console.log(favicon, 'favicon')
|
||||
|
||||
// 设置网站logo
|
||||
let favicon: HTMLLinkElement = document.querySelector('link[rel="icon"]')!
|
||||
if (favicon) {
|
||||
favicon.href = data.web_favicon
|
||||
favicon.href = data.webFavicon
|
||||
return
|
||||
}
|
||||
favicon = document.createElement('link')
|
||||
favicon.rel = 'icon'
|
||||
favicon.href = data.web_favicon
|
||||
favicon.href = data.webFavicon
|
||||
document.head.appendChild(favicon)
|
||||
})
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -40,5 +40,5 @@ export function apiFileRename(params: { id: number; name: string }) {
|
|||
|
||||
// 配置
|
||||
export function apiConfig() {
|
||||
return request.get('/config/getConfig')
|
||||
return request.get('/index/config')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,27 +2,28 @@ import request from '@/utils/request'
|
|||
import { terminal } from '@/config/app'
|
||||
|
||||
export function adminLists(params: any) {
|
||||
return request.get('/auth.admin/lists', { params })
|
||||
return request.get('/admin/lists', { params })
|
||||
}
|
||||
|
||||
// 管理员添加
|
||||
export function apiAdminAdd(params: any) {
|
||||
return request.post('/auth.admin/add', params)
|
||||
return request.post('/admin/add', params)
|
||||
}
|
||||
|
||||
export function apiAdminEdit(params: any) {
|
||||
return request.post('/auth.admin/edit', params)
|
||||
return request.post('/admin/edit', params)
|
||||
}
|
||||
|
||||
// 管理员删除
|
||||
export function apiAdminDelete(params: { id: number }) {
|
||||
return request.post('/auth.admin/delete', params)
|
||||
return request.post('/admin/del', params)
|
||||
}
|
||||
|
||||
// 管理员详情
|
||||
export function apiAdminDetail(params: any) {
|
||||
return request.get('/auth.admin/detail', { params })
|
||||
return request.get('/admin/detail', { params })
|
||||
}
|
||||
|
||||
// 角色列表
|
||||
export function apiRoleLists(params: any) {
|
||||
return request.get('/auth.role/lists', { params })
|
||||
|
|
@ -50,6 +51,6 @@ export function apiConfigGetMenu() {
|
|||
}
|
||||
|
||||
// 角色权限
|
||||
export function apiConfigGetAuth() {
|
||||
return request.get('/config/getAuth')
|
||||
}
|
||||
// export function apiConfigGetAuth() {
|
||||
// return request.get('/config/getAuth')
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ import { terminal } from '@/config/app'
|
|||
|
||||
// 登录
|
||||
export function apiLogin(params: { account: string; password: string }) {
|
||||
return request.post('/login/account', { ...params, terminal })
|
||||
return request.post('/system/login', { ...params, terminal })
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
export function apiLogout() {
|
||||
return request.post('/login/logout')
|
||||
return request.post('/system/logout')
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export function apiUserInfo() {
|
||||
return request.get('/auth.admin/mySelf')
|
||||
return request.get('/system/admin/self')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ const app: Module<AppModule, any> = {
|
|||
return new Promise((resolve, reject) => {
|
||||
apiConfig().then(data => {
|
||||
commit('setConfig', data)
|
||||
console.log(data, '==============================')
|
||||
|
||||
resolve(data)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ const permission: Module<PermissionModule, any> = {
|
|||
actions: {
|
||||
getPermission({ commit }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
apiConfigGetAuth()
|
||||
.then(data => {
|
||||
commit('setPermission', data)
|
||||
resolve(data)
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
// apiConfigGetAuth()
|
||||
// .then(data => {
|
||||
// commit('setPermission', data)
|
||||
// resolve(data)
|
||||
// })
|
||||
// .catch(err => {
|
||||
// reject(err)
|
||||
// })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const eventResponse = {
|
|||
}
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: `${import.meta.env.VITE_APP_BASE_URL}/adminapi`,
|
||||
baseURL: `${import.meta.env.VITE_APP_BASE_URL}/api`,
|
||||
timeout: 60 * 1000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
<div
|
||||
class="login-img"
|
||||
:style="{
|
||||
'background-image': `url(${config.login_image})`
|
||||
'background-image': `url(${config?.login_image})`
|
||||
}"
|
||||
></div>
|
||||
<div class="login-form flex flex-col">
|
||||
<div class="f-s-24 f-w-500 text-center m-b-40">
|
||||
{{ config.web_name }}
|
||||
{{ config?.web_name }}
|
||||
</div>
|
||||
<el-form ref="loginFormRefs" :model="loginForm" status-icon :rules="rules">
|
||||
<el-form-item prop="account">
|
||||
|
|
@ -49,9 +49,9 @@
|
|||
</div>
|
||||
<div class="login-footer">
|
||||
<div class="flex flex-center muted xs m-t-20">
|
||||
<span class="m-r-10">{{ config.copyright_info }}</span>
|
||||
<a class="link muted" :href="config.icp_link" target="_blank">{{
|
||||
config.icp_number
|
||||
<span class="m-r-10">{{ config?.copyright_info }}</span>
|
||||
<a class="link muted" :href="config?.icp_link" target="_blank">{{
|
||||
config?.icp_number
|
||||
}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue