Signed-off-by: skyselang <215817969@qq.com>
This commit is contained in:
skyselang 2021-05-27 18:46:09 +08:00
parent f258f9309b
commit 531cc8e2ca
56 changed files with 1009 additions and 504 deletions

15
.env.production.domain Normal file
View File

@ -0,0 +1,15 @@
# 前后端部署到同一域名的环境变量文件
# 重命名成 .env.production.local 后
# 运行打包命令 cnpm run build:prod
# 把生成的 admin 文件夹复制到 yylAdmin/public 下
# 浏览器访问yylAdmin项目 你的域名/admin 即可
# 正式环境
ENV = 'production'
# 接口地址
VUE_APP_BASE_API = ''
# publicPath
VUE_APP_PUBLICPATH = '/admin/'
# outputDir
VUE_APP_OUTPUTDIR = 'admin'

View File

@ -5,9 +5,9 @@ import request from '@/utils/request'
* 验证码
* @param {array} params 请求参数
*/
export function verify(params) {
export function captcha(params) {
return request({
url: '/admin/AdminLogin/verify',
url: '/admin/AdminLogin/captcha',
method: 'get',
params: params
})

View File

@ -78,6 +78,17 @@ export function unauth(data) {
data
})
}
/**
* 菜单是否无需登录
* @param {array} data 请求数据
*/
export function unlogin(data) {
return request({
url: '/admin/AdminMenu/unlogin',
method: 'post',
data
})
}
/**
* 菜单角色
* @param {array} params 请求参数

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// ----------------设置管理----------------
/**
* 缓存信息
* 缓存设置信息
* @param {array} params 请求数据
*/
export function cacheInfo(params) {
@ -13,7 +13,7 @@ export function cacheInfo(params) {
})
}
/**
* 缓存清除
* 缓存设置清除
* @param {array} data 请求数据
*/
export function cacheClear(data) {
@ -24,7 +24,7 @@ export function cacheClear(data) {
})
}
/**
* Token信息
* Token设置信息
* @param {array} params 请求数据
*/
export function tokenInfo(params) {
@ -35,7 +35,7 @@ export function tokenInfo(params) {
})
}
/**
* Token修改
* Token设置修改
* @param {array} data 请求数据
*/
export function tokenEdit(data) {
@ -46,23 +46,67 @@ export function tokenEdit(data) {
})
}
/**
* 验证码信息
* 验证码设置信息
* @param {array} params 请求数据
*/
export function verifyInfo(params) {
export function captchaInfo(params) {
return request({
url: '/admin/AdminSetting/verifyInfo',
url: '/admin/AdminSetting/captchaInfo',
method: 'get',
params: params
})
}
/**
* 验证码修改
* 验证码设置修改
* @param {array} data 请求数据
*/
export function verifyEdit(data) {
export function captchaEdit(data) {
return request({
url: '/admin/AdminSetting/verifyEdit',
url: '/admin/AdminSetting/captchaEdit',
method: 'post',
data
})
}
/**
* 日志设置信息
* @param {array} params 请求数据
*/
export function logInfo(params) {
return request({
url: '/admin/AdminSetting/logInfo',
method: 'get',
params: params
})
}
/**
* 日志设置修改
* @param {array} data 请求数据
*/
export function logEdit(data) {
return request({
url: '/admin/AdminSetting/logEdit',
method: 'post',
data
})
}
/**
* 接口设置信息
* @param {array} params 请求数据
*/
export function apiInfo(params) {
return request({
url: '/admin/AdminSetting/apiInfo',
method: 'get',
params: params
})
}
/**
* 接口设置修改
* @param {array} data 请求数据
*/
export function apiEdit(data) {
return request({
url: '/admin/AdminSetting/apiEdit',
method: 'post',
data
})

View File

@ -67,12 +67,12 @@ export function disable(data) {
})
}
/**
* 接口是否无需权限
* 接口是否无需登录
* @param {array} data 请求数据
*/
export function unauth(data) {
export function unlogin(data) {
return request({
url: '/admin/Api/unauth',
url: '/admin/Api/unlogin',
method: 'post',
data
})

View File

@ -34,6 +34,17 @@ export function dele(data) {
data
})
}
/**
* 会员日志清除
* @param {array} data 请求数据
*/
export function clear(data) {
return request({
url: '/admin/MemberLog/clear',
method: 'post',
data
})
}
/**
* 会员日志统计
* @param {array} data 请求数据

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
// ----------------基础管理----------------
/**
* Token信息
* Token设置信息
* @param {array} params 请求数据
*/
export function tokenInfo(params) {
@ -13,7 +13,7 @@ export function tokenInfo(params) {
})
}
/**
* Token修改
* Token设置修改
* @param {array} data 请求数据
*/
export function tokenEdit(data) {
@ -24,23 +24,67 @@ export function tokenEdit(data) {
})
}
/**
* 验证码信息
* 验证码设置信息
* @param {array} params 请求数据
*/
export function verifyInfo(params) {
export function captchaInfo(params) {
return request({
url: '/admin/Setting/verifyInfo',
url: '/admin/Setting/captchaInfo',
method: 'get',
params: params
})
}
/**
* 验证码修改
* 验证码设置修改
* @param {array} data 请求数据
*/
export function verifyEdit(data) {
export function captchaEdit(data) {
return request({
url: '/admin/Setting/verifyEdit',
url: '/admin/Setting/captchaEdit',
method: 'post',
data
})
}
/**
* 日志设置信息
* @param {array} params 请求数据
*/
export function logInfo(params) {
return request({
url: '/admin/Setting/logInfo',
method: 'get',
params: params
})
}
/**
* 日志设置修改
* @param {array} data 请求数据
*/
export function logEdit(data) {
return request({
url: '/admin/Setting/logEdit',
method: 'post',
data
})
}
/**
* 接口设置信息
* @param {array} params 请求数据
*/
export function apiInfo(params) {
return request({
url: '/admin/Setting/apiInfo',
method: 'get',
params: params
})
}
/**
* 接口设置修改
* @param {array} data 请求数据
*/
export function apiEdit(data) {
return request({
url: '/admin/Setting/apiEdit',
method: 'post',
data
})

View File

@ -35,7 +35,7 @@ export default {
pageSizes: {
type: Array,
default() {
return [10, 13, 20, 30, 50, 80, 100, 150, 200, 300]
return [10, 12, 20, 30, 50, 80, 100, 150, 200, 300, 500, 800, 1000]
}
},
layout: {
@ -94,6 +94,7 @@ export default {
.pagination-container {
text-align: right;
padding-top: 0;
margin-top: 20px;
}
.pagination-container.hidden {
display: none;

View File

@ -64,7 +64,7 @@ export default {
}
},
computed: {
...mapGetters(['sidebar', 'device', 'username', 'nickname', 'avatar'])
...mapGetters(['sidebar', 'device', 'nickname', 'avatar'])
},
methods: {
toggleSideBar() {

View File

@ -226,7 +226,9 @@ export const asyncRoutes = [
icon: 'el-icon-menu',
roles: [
'admin/Setting/tokenInfo',
'admin/Setting/verifyInfo',
'admin/Setting/captchaInfo',
'admin/Setting/logInfo',
'admin/Setting/apiInfo',
'admin/SettingWechat/offiInfo',
'admin/SettingWechat/miniInfo',
'admin/Region/list'
@ -242,7 +244,12 @@ export const asyncRoutes = [
meta: {
title: '基础设置',
icon: 'el-icon-s-grid',
roles: ['admin/Setting/tokenInfo', 'admin/Setting/verifyInfo']
roles: [
'admin/Setting/tokenInfo',
'admin/Setting/captchaInfo',
'admin/Setting/logInfo',
'admin/Setting/apiInfo'
]
},
component: () => import('@/views/setting/base')
},
@ -331,7 +338,7 @@ export const asyncRoutes = [
path: 'user-log-stat',
name: 'UserLogStat',
meta: {
title: '日志统计',
title: '日志管理统计',
icon: 'el-icon-s-data',
roles: ['admin/AdminUserLog/stat'],
activeMenu: '/admin/rule/user-log'
@ -359,10 +366,12 @@ export const asyncRoutes = [
title: '系统管理',
icon: 'el-icon-setting',
roles: [
'admin/AdminApidoc/apidoc',
'admin/AdminSetting/cacheInfo',
'admin/AdminSetting/tokenInfo',
'admin/AdminSetting/verifyInfo',
'admin/AdminSetting/captchaInfo',
'admin/AdminSetting/logInfo',
'admin/AdminSetting/apiInfo',
'admin/AdminApidoc/apidoc',
'admin/AdminUtils/utils'
]
},
@ -370,16 +379,6 @@ export const asyncRoutes = [
component: Layout,
alwaysShow: true,
children: [
{
path: 'apidoc',
name: 'Apidoc',
meta: {
title: '接口文档',
icon: 'el-icon-document',
roles: ['admin/AdminApidoc/apidoc']
},
component: () => import('@/views/admin/apidoc/apidoc')
},
{
path: 'setting',
name: 'Setting',
@ -389,11 +388,23 @@ export const asyncRoutes = [
roles: [
'admin/AdminSetting/cacheInfo',
'admin/AdminSetting/tokenInfo',
'admin/AdminSetting/verifyInfo'
'admin/AdminSetting/captchaInfo',
'admin/AdminSetting/logInfo',
'admin/AdminSetting/apiInfo'
]
},
component: () => import('@/views/admin/setting/setting')
},
{
path: 'apidoc',
name: 'Apidoc',
meta: {
title: '接口文档',
icon: 'el-icon-document',
roles: ['admin/AdminApidoc/apidoc']
},
component: () => import('@/views/admin/apidoc/apidoc')
},
{
path: 'utils',
name: 'Utils',

View File

@ -4,9 +4,7 @@ const getters = {
device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
adminUserId: state => state.user.adminUserId,
adminToken: state => state.user.adminToken,
username: state => state.user.username,
nickname: state => state.user.nickname,
avatar: state => state.user.avatar,
roles: state => state.user.roles,

View File

@ -1,14 +1,9 @@
import { login, logout } from '@/api/admin-login'
import { info as userInfo } from '@/api/admin-user-center'
import {
setAdminUserId,
getAdminUserId,
delAdminUserId,
setAdminToken,
getAdminToken,
delAdminToken,
setUsername,
delUsername,
setNickname,
delNickname,
setAvatar,
@ -19,7 +14,6 @@ import router, {
} from '@/router'
const state = {
adminUserId: '',
adminToken: getAdminToken(),
username: '',
nickname: '',
@ -28,15 +22,9 @@ const state = {
}
const mutations = {
SET_ADMINUSERID: (state, adminUserId) => {
state.adminUserId = adminUserId
},
SET_ADMINTOKEN: (state, adminToken) => {
state.adminToken = adminToken
},
SET_USERNAME: (state, username) => {
state.username = username
},
SET_NICKNAME: (state, nickname) => {
state.nickname = nickname
},
@ -54,20 +42,18 @@ const actions = {
const {
username,
password,
verify_id,
verify_code
captcha_id,
captcha_code
} = userInfo
return new Promise((resolve, reject) => {
login({
username: username,
password: password,
verify_id: verify_id,
verify_code: verify_code
captcha_id: captcha_id,
captcha_code: captcha_code
}).then(response => {
const { data } = response
commit('SET_ADMINUSERID', data.admin_user_id)
commit('SET_ADMINTOKEN', data.admin_token)
setAdminUserId(data.admin_user_id)
setAdminToken(data.admin_token)
resolve()
}).catch(error => {
@ -79,9 +65,7 @@ const actions = {
// 获取用户信息
userInfo({ commit, state }) {
return new Promise((resolve, reject) => {
userInfo({
admin_user_id: getAdminUserId()
}).then(response => {
userInfo().then(response => {
const { data } = response
if (!data) {
@ -89,8 +73,6 @@ const actions = {
}
const {
admin_user_id,
username,
nickname,
avatar,
roles
@ -101,12 +83,9 @@ const actions = {
reject('获取权限失败, 请重新登录!')
}
commit('SET_ADMINUSERID', admin_user_id)
commit('SET_USERNAME', username)
commit('SET_NICKNAME', nickname)
commit('SET_AVATAR', avatar)
commit('SET_ROLES', roles)
setUsername(data.username)
setNickname(data.nickname)
setAvatar(data.avatar)
resolve(data)
@ -119,14 +98,10 @@ const actions = {
// 退出
logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
logout({
admin_user_id: getAdminUserId()
}).then(() => {
logout().then(() => {
commit('SET_ADMINTOKEN', '')
commit('SET_ROLES', [])
delAdminUserId()
delAdminToken()
delUsername()
delNickname()
delAvatar()
resetRouter()
@ -146,7 +121,6 @@ const actions = {
return new Promise(resolve => {
commit('SET_ADMINTOKEN', '')
commit('SET_ROLES', [])
delAdminUserId()
delAdminToken()
resolve()
})

View File

@ -1,16 +1,5 @@
import Cookies from 'js-cookie'
const AdminUserIdKey = 'AdminUserId'
export function setAdminUserId(AdminUserId) {
return Cookies.set(AdminUserIdKey, AdminUserId)
}
export function getAdminUserId() {
return Cookies.get(AdminUserIdKey)
}
export function delAdminUserId() {
return Cookies.remove(AdminUserIdKey)
}
const AdminTokenKey = 'AdminToken'
export function setAdminToken(AdminToken) {
return Cookies.set(AdminTokenKey, AdminToken)
@ -22,17 +11,6 @@ export function delAdminToken() {
return Cookies.remove(AdminTokenKey)
}
const UsernameKey = 'AdminUsername'
export function setUsername(username) {
return Cookies.set(UsernameKey, username)
}
export function getUsername() {
return Cookies.get(UsernameKey)
}
export function delUsername() {
return Cookies.remove(UsernameKey)
}
const NicknameKey = 'AdminNickname'
export function setNickname(nickname) {
return Cookies.set(NicknameKey, nickname)

View File

@ -1,7 +1,7 @@
import axios from 'axios'
import store from '@/store'
import { Message, MessageBox } from 'element-ui'
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
@ -15,8 +15,7 @@ service.interceptors.request.use(
config => {
// 发送请求之前
if (store.getters.adminToken) {
// 让每个请求头部带上AdminUserId、AdminToken
config.headers['AdminUserId'] = getAdminUserId()
// 让每个请求头部带上AdminToken
config.headers['AdminToken'] = getAdminToken()
}
return config

View File

@ -3,7 +3,7 @@
* @param {number} height 要减去的高度
* @return {number}
*/
export default function screenHeight(height = 250) {
export default function screenHeight(height = 230) {
var defaultHeight = 880
var clientHeight = document.documentElement.clientHeight || document.body.clientHeight
if (clientHeight) {

View File

@ -5,13 +5,10 @@
<span class="padding-right">密码{{ apidocModel.apidoc_pwd }}
<i class="el-icon-copy-document" title="复制密码" @click="apidocCopy(apidocModel.apidoc_pwd, $event)" />
</span>
<span class="padding-right">AdminUserId{{ apidocModel.admin_user_id }}
<i class="el-icon-copy-document" title="复制用户id" @click="apidocCopy(apidocModel.admin_user_id, $event)" />
</span>
<span class="padding-right">AdminToken{{ apidocModel.admin_token_sub }}
<i class="el-icon-copy-document" title="复制Token" @click="apidocCopy(apidocModel.admin_token, $event)" />
</span>
<el-button class="filter-item" size="mini" @click="apidoc()"><i class="el-icon-refresh" />刷新</el-button>
<el-button class="filter-item" size="mini" @click="refresh()"><i class="el-icon-refresh" />刷新</el-button>
</el-col>
<el-col :span="24">
<iframe :src="apidocModel.apidoc_url" frameborder="0" width="100%" :height="height" />
@ -31,10 +28,10 @@ export default {
data() {
return {
height: 600,
isload: false,
apidocModel: {
apidoc_url: '',
apidoc_pwd: '',
admin_user_id: '',
admin_token: '',
admin_token_sub: ''
}
@ -42,14 +39,21 @@ export default {
},
created() {
this.height = screenHeight(160)
this.apidoc()
if (!this.isload) {
this.apidoc()
}
},
methods: {
apidoc() {
apidoc().then(res => {
this.isload = true
this.apidocModel = res.data
})
},
//
refresh() {
this.apidoc()
},
apidocCopy(text, event) {
if (text) {
clip(text, event)

View File

@ -10,12 +10,12 @@
<el-form-item prop="password">
<el-input v-model="model.password" type="password" placeholder="请输入密码" prefix-icon="el-icon-lock" autocomplete="on" clearable show-password />
</el-form-item>
<el-form-item v-if="verify_switch" prop="verify_code">
<el-form-item v-if="captcha_switch" prop="captcha_code">
<el-col :span="13">
<el-input v-model="model.verify_code" placeholder="请输入验证码" prefix-icon="el-icon-picture" autocomplete="off" clearable />
<el-input v-model="model.captcha_code" placeholder="请输入验证码" prefix-icon="el-icon-picture" autocomplete="off" clearable />
</el-col>
<el-col :span="11">
<el-image :src="verify_src" fit="fill" alt="验证码" title="点击刷新验证码" style="width:200px;height:36px;float:right" @click="verify" />
<el-image :src="captcha_src" fit="fill" alt="验证码" title="点击刷新验证码" style="width:200px;height:36px;float:right" @click="captcha" />
</el-col>
</el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
@ -25,7 +25,7 @@
<script>
import setting from '@/settings'
import { verify } from '@/api/admin-login'
import { captcha } from '@/api/admin-login'
export default {
name: 'Login',
@ -36,18 +36,18 @@ export default {
loading: false,
redirect: undefined,
otherQuery: {},
verify_src: '',
verify_switch: 0,
captcha_src: '',
captcha_switch: 0,
model: {
username: '',
password: '',
verify_id: '',
verify_code: ''
captcha_id: '',
captcha_code: ''
},
rules: {
username: [{ required: true, message: '请输入账号', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
verify_code: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
captcha_code: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
}
}
},
@ -64,19 +64,19 @@ export default {
}
},
created() {
this.verify()
this.captcha()
},
mounted() { },
destroyed() { },
methods: {
//
verify() {
this.model.verify_id = ''
this.model.verify_code = ''
verify().then(res => {
this.model.verify_id = res.data.verify_id
this.verify_src = res.data.verify_src
this.verify_switch = res.data.verify_switch
captcha() {
this.model.captcha_id = ''
this.model.captcha_code = ''
captcha().then(res => {
this.model.captcha_id = res.data.captcha_id
this.captcha_src = res.data.captcha_src
this.captcha_switch = res.data.captcha_switch
})
},
//

View File

@ -10,22 +10,54 @@
</el-row>
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height+80" style="width: 100%" row-key="admin_menu_id" border stripe>
<el-table v-loading="loading" :data="data" :height="height+50" style="width: 100%" row-key="admin_menu_id" border stripe>
<el-table-column prop="menu_name" label="菜单名称" min-width="220" show-overflow-tooltip fixed="left" />
<el-table-column prop="menu_url" label="菜单链接" min-width="250" show-overflow-tooltip />
<el-table-column prop="menu_url" label="菜单链接(roles)" min-width="225" show-overflow-tooltip />
<el-table-column prop="menu_sort" label="排序" min-width="60" />
<el-table-column prop="admin_menu_id" label="菜单ID" min-width="65" />
<el-table-column prop="menu_pid" label="PID" min-width="65" />
<el-table-column prop="create_time" label="添加时间" min-width="160" />
<el-table-column prop="update_time" label="修改时间" min-width="160" />
<el-table-column prop="is_disable" label="是否禁用" min-width="80" align="center">
<el-table-column prop="menu_pid" label="PID" min-width="60" />
<el-table-column prop="create_time" label="添加时间" min-width="155" />
<el-table-column prop="update_time" label="修改时间" min-width="155" />
<el-table-column prop="is_disable" label="是否禁用" min-width="95" align="center">
<template slot="header">
<span>是否禁用 </span>
<el-tooltip placement="top">
<div slot="content">
开启后无法访问<br>
</div>
<i class="el-icon-info" title="" />
</el-tooltip>
</template>
<template slot-scope="scope">
<el-switch v-if="scope.row.menu_url" v-model="scope.row.is_disable" :active-value="1" :inactive-value="0" @change="isProhibit(scope.row)" />
<el-switch v-if="scope.row.menu_url" v-model="scope.row.is_disable" :active-value="1" :inactive-value="0" @change="disable(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="is_unauth" label="无需权限" min-width="80" align="center">
<el-table-column prop="is_unauth" label="无需权限" min-width="95" align="center">
<template slot="header">
<span>无需权限 </span>
<el-tooltip placement="top">
<div slot="content">
开启后不用分配权限也可以访问<br>
</div>
<i class="el-icon-info" title="" />
</el-tooltip>
</template>
<template slot-scope="scope">
<el-switch v-if="scope.row.menu_url" v-model="scope.row.is_unauth" :active-value="1" :inactive-value="0" @change="isUnauth(scope.row)" />
<el-switch v-if="scope.row.menu_url" v-model="scope.row.is_unauth" :active-value="1" :inactive-value="0" @change="unauth(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="is_unlogin" label="无需登录" min-width="95" align="center">
<template slot="header">
<span>无需登录 </span>
<el-tooltip placement="top">
<div slot="content">
开启后不用登录就可以访问如验证码登录等<br>
</div>
<i class="el-icon-info" title="" />
</el-tooltip>
</template>
<template slot-scope="scope">
<el-switch v-if="scope.row.menu_url" v-model="scope.row.is_unlogin" :active-value="1" :inactive-value="0" @change="unlogin(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" min-width="345" align="right" fixed="right">
@ -40,7 +72,7 @@
</el-table>
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="菜单父级" prop="menu_pid">
<el-cascader
v-model="model.menu_pid"
@ -126,7 +158,7 @@
import screenHeight from '@/utils/screen-height'
import Pagination from '@/components/Pagination'
import permission from '@/directive/permission/index.js' //
import { list, info, add, edit, dele, disable, unauth, role, roleRemove, user, userRemove } from '@/api/admin-menu'
import { list, info, add, edit, dele, disable, unauth, unlogin, role, roleRemove, user, userRemove } from '@/api/admin-menu'
export default {
name: 'Menu',
@ -279,7 +311,7 @@ export default {
this.list()
},
//
isProhibit(row) {
disable(row) {
this.loading = true
disable({
admin_menu_id: row.admin_menu_id,
@ -288,11 +320,12 @@ export default {
this.list()
this.$message.success(res.msg)
}).catch(() => {
this.list()
this.loading = false
})
},
//
isUnauth(row) {
unauth(row) {
this.loading = true
unauth({
admin_menu_id: row.admin_menu_id,
@ -301,9 +334,46 @@ export default {
this.list()
this.$message.success(res.msg)
}).catch(() => {
this.list()
this.loading = false
})
},
//
unlogin(row) {
if (row.is_unlogin === 1) {
this.$confirm(
'确定要设置菜单 <span style="color:red">' + row.menu_name + ' </span>为无需登录吗?<br>开启后不用登录就可以访问!请根据需求设置!',
'无需登录:' + row.admin_menu_id,
{ type: 'warning', dangerouslyUseHTMLString: true }
).then(() => {
this.loading = true
unlogin({
admin_menu_id: row.admin_menu_id,
is_unlogin: row.is_unlogin
}).then(res => {
this.list()
this.$message.success(res.msg)
}).catch(() => {
this.list()
this.loading = false
})
}).catch(() => {
this.list()
})
} else {
this.loading = true
unlogin({
admin_menu_id: row.admin_menu_id,
is_unlogin: row.is_unlogin
}).then(res => {
this.list()
this.$message.success(res.msg)
}).catch(() => {
this.list()
this.loading = false
})
}
},
//
pidChange(value) {
if (value) {

View File

@ -39,7 +39,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+'px'}">
<el-form-item label="名称" prop="role_name">
<el-input v-model="model.role_name" placeholder="请输入角色名称" clearable />
</el-form-item>
@ -70,6 +70,10 @@
<el-button v-if="data.children[0]" type="text" size="mini" @click="() => menuChildrenAllCheck(data, true)">反选</el-button>
<i v-if="data.menu_url" class="el-icon-link" style="margin-left:10px;" :title="data.menu_url" />
<i v-else class="el-icon-link" style="margin-left:10px;color:#fff" />
<i v-if="data.is_unauth" class="el-icon-unlock" style="margin-left:10px;" title="无需权限" />
<i v-else class="el-icon-unlock" style="margin-left:10px;color:#fff" />
<i v-if="data.is_unlogin" class="el-icon-user" style="margin-left:10px;" title="无需登录" />
<i v-else class="el-icon-user" style="margin-left:10px;color:#fff" />
</span>
</span>
</el-tree>
@ -125,7 +129,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
dialog: false,
dialogTitle: '',
@ -281,7 +285,8 @@ export default {
this.list()
this.$message.success(res.msg)
}).catch(() => {
this.loading = true
this.list()
this.loading = false
})
},
//

View File

@ -1,16 +1,21 @@
<template>
<el-card class="box-card">
<el-form ref="ref" :model="model" label-width="120px">
<el-form-item label="缓存类型" prop="type">
<el-input v-model="model.type" />
</el-form-item>
<el-form-item label="" prop="">
<span>手动清除所有缓存后台登录状态不会清除</span>
</el-form-item>
<el-form-item label="">
<el-button :loading="loading" type="primary" title="清除缓存" @click="submit()">清除</el-button>
</el-form-item>
</el-form>
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" label-width="120px">
<el-form-item label="" prop="">
<span>手动清除所有缓存后台登录状态不会清除</span>
</el-form-item>
<el-form-item label="缓存类型" prop="type">
<el-input v-model="model.type" />
</el-form-item>
<el-form-item label="">
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" title="清除缓存" @click="submit()">清除</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
@ -39,6 +44,19 @@ export default {
this.model = res.data
})
},
//
refresh() {
this.loading = true
cacheInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {

View File

@ -1,18 +1,28 @@
<template>
<el-card class="box-card">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="Token有效时间" prop="token_exp">
<el-input v-model="model.token_exp" type="number">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="" prop="">
<span>后台登录状态有效时间过期需重新登录</span>
</el-form-item>
<el-form-item>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="Token名称" prop="token_name">
<el-input v-model="model.token_name" type="text" style="width:90%" />
<i class="el-icon-warning-outline" title="必须与前端设置一致否则Token验证失败。" />
</el-form-item>
<el-form-item label="Token密钥" prop="token_key">
<el-input v-model="model.token_key" type="text" style="width:90%" />
<i class="el-icon-warning-outline" title="修改后所有用户登录状态失效,需重新登录。" />
</el-form-item>
<el-form-item label="Token有效时间" prop="token_exp">
<el-input v-model="model.token_exp" type="number">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
@ -26,6 +36,8 @@ export default {
return {
loading: false,
model: {
token_name: '',
token_key: '',
token_exp: 12
},
rules: {}
@ -41,6 +53,19 @@ export default {
this.model = res.data
})
},
//
refresh() {
this.loading = true
tokenInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
@ -51,7 +76,6 @@ export default {
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.info()
this.loading = false
})
}

View File

@ -1,60 +0,0 @@
<template>
<el-card class="box-card">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="验证码开关" prop="verify_switch">
<el-switch v-model="model.verify_switch" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item label="" prop="">
<span>开启后后台登录需要输入验证码</span>
</el-form-item>
<el-form-item>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import { verifyInfo, verifyEdit } from '@/api/admin-setting'
export default {
name: 'Verify',
components: {},
data() {
return {
loading: false,
model: {
verify_switch: 0
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
verifyInfo().then(res => {
this.model = res.data
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
verifyEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.info()
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -2,31 +2,19 @@
<div class="app-container">
<el-tabs v-model="actTabName" @tab-click="tabClick">
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/cacheInfo'])" label="缓存设置" name="cache">
<el-row :gutter="8">
<el-col :xs="24" :sm="12">
<div class="filter-container">
<Cache v-if="cache" />
</div>
</el-col>
</el-row>
<Cache v-if="cache" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/tokenInfo'])" label="Token设置" name="token">
<el-row :gutter="8">
<el-col :xs="24" :sm="12">
<div class="filter-container">
<Token v-if="token" />
</div>
</el-col>
</el-row>
<Token v-if="token" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/verifyInfo'])" label="验证码设置" name="verify">
<el-row :gutter="8">
<el-col :xs="24" :sm="12">
<div class="filter-container">
<Verify v-if="verify" />
</div>
</el-col>
</el-row>
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/captchaInfo'])" label="验证码设置" name="captcha">
<Captcha v-if="captcha" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/logInfo'])" label="日志设置" name="log">
<Log v-if="log" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminSetting/apiInfo'])" label="接口设置" name="api">
<Api v-if="api" />
</el-tab-pane>
</el-tabs>
</div>
@ -37,17 +25,21 @@ import checkPermission from '@/utils/permission' // 权限判断函数
import permission from '@/directive/permission/index.js' //
import Cache from './components/Cache'
import Token from './components/Token'
import Verify from './components/Verify'
import Captcha from './components/Captcha'
import Log from './components/Log'
import Api from './components/Api'
export default {
name: 'Setting',
directives: { permission },
components: { Cache, Token, Verify },
components: { Cache, Token, Captcha, Log, Api },
data() {
return {
cache: true,
token: false,
verify: false,
captcha: false,
log: false,
api: false,
actTabName: 'cache'
}
},

View File

@ -17,7 +17,6 @@
:before-upload="uploadBefore"
:action="uploadAction"
:headers="uploadHeaders"
:data="uploadData"
:on-success="uploadSuccess"
:on-error="uploadError"
>
@ -32,7 +31,7 @@
</template>
<script>
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
import store from '@/store'
@ -43,8 +42,7 @@ export default {
return {
loading: false,
uploadAction: process.env.VUE_APP_BASE_API + '/admin/AdminUserCenter/avatar',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadData: { admin_user_id: getAdminUserId() }
uploadHeaders: { AdminToken: getAdminToken() }
}
},
computed: {

View File

@ -28,7 +28,6 @@
</template>
<script>
import { getAdminUserId } from '@/utils/auth'
import { info, edit } from '@/api/admin-user-center'
import store from '@/store'
@ -39,7 +38,6 @@ export default {
return {
loading: false,
model: {
admin_user_id: getAdminUserId(),
username: '',
nickname: '',
phone: '',

View File

@ -45,7 +45,6 @@
</template>
<script>
import { getAdminUserId } from '@/utils/auth'
import { info } from '@/api/admin-user-center'
export default {
@ -55,7 +54,6 @@ export default {
return {
loading: false,
model: {
admin_user_id: getAdminUserId(),
username: '',
nickname: '',
phone: '',

View File

@ -27,7 +27,7 @@
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height-50" style="width: 100%" border @sort-change="sort">
<el-table-column prop="admin_user_log_id" label="ID" min-width="100" sortable="custom" fixed="left" />
<el-table-column prop="admin_user_log_id" label="日志ID" min-width="100" sortable="custom" fixed="left" />
<el-table-column prop="menu_url" label="菜单链接" min-width="250" />
<el-table-column prop="menu_name" label="菜单名称" min-width="150" />
<el-table-column prop="request_method" label="请求方式 " min-width="110" />
@ -57,7 +57,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
}
}
},

View File

@ -22,7 +22,6 @@
</template>
<script>
import { getAdminUserId } from '@/utils/auth'
import { pwd } from '@/api/admin-user-center'
export default {
@ -32,7 +31,6 @@ export default {
return {
loading: false,
model: {
admin_user_id: getAdminUserId(),
password_old: '',
password_new: ''
},

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container dialog-body" :style="{height:height+120+'px'}">
<el-card v-loading="loadNum" class="box-card">
<el-row :gutter="10">
<el-col :sm="4">
@ -8,7 +8,7 @@
<span>总计</span>
</div>
<div class="text color-tot">
{{ number.total }}
{{ num.total }}
</div>
</el-card>
</el-col>
@ -18,7 +18,7 @@
<span>今天</span>
</div>
<div class="text">
{{ number.today }}
{{ num.today }}
</div>
</el-card>
</el-col>
@ -28,7 +28,7 @@
<span>昨天</span>
</div>
<div class="text">
{{ number.yesterday }}
{{ num.yesterday }}
</div>
</el-card>
</el-col>
@ -38,7 +38,7 @@
<span>本周</span>
</div>
<div class="text">
{{ number.thisweek }}
{{ num.thisweek }}
</div>
</el-card>
</el-col>
@ -48,7 +48,7 @@
<span>上周</span>
</div>
<div class="text">
{{ number.lastweek }}
{{ num.lastweek }}
</div>
</el-card>
</el-col>
@ -58,7 +58,7 @@
<span>本月</span>
</div>
<div class="text">
{{ number.thismonth }}
{{ num.thismonth }}
</div>
</el-card>
</el-col>
@ -68,7 +68,7 @@
<span>上月</span>
</div>
<div class="text">
{{ number.lastmonth }}
{{ num.lastmonth }}
</div>
</el-card>
</el-col>
@ -91,7 +91,7 @@
</el-row>
<el-row :gutter="0">
<el-col :sm="24">
<div id="echartDate" :style="{height:height+'px'}" />
<div id="echartDate" :style="{height:height-100+'px'}" />
</el-col>
</el-row>
</el-card>
@ -99,30 +99,30 @@
<el-row :gutter="0">
<el-col :sm="24">
<el-date-picker
v-model="region.date"
v-model="field.date"
type="daterange"
range-separator="-"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="max-width:280px"
@change="echartRegionChange()"
@change="echartFieldChange()"
/>
<el-select v-model="regionValue" placeholder="请选择" @change="echartRegionChange()">
<el-option v-for="item in regionType" :key="item.value" :label="item.label" :value="item.value" />
<el-select v-model="fieldValue" placeholder="请选择" @change="echartFieldChange()">
<el-option v-for="item in fieldType" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
</el-row>
<el-divider />
<el-row v-loading="loadRegion" :gutter="0">
<el-row v-loading="loadField" :gutter="0">
<el-col :sm="24">
<div id="echartRegionLine" :style="{height:height+'px'}" />
<div id="echartFieldLine" :style="{height:height+'px'}" />
</el-col>
</el-row>
<el-divider />
<el-row v-loading="loadRegion" :gutter="0">
<el-row v-loading="loadField" :gutter="0">
<el-col :sm="24">
<div id="echartRegionPie" :style="{height:height+'px'}" />
<div id="echartFieldPie" :style="{height:height+'px'}" />
</el-col>
</el-row>
</el-card>
@ -144,6 +144,7 @@ import { CanvasRenderer } from 'echarts/renderers'
//
echarts.use([LegendComponent, TitleComponent, TooltipComponent, GridComponent, LineChart, BarChart, PieChart, CanvasRenderer])
import screenHeight from '@/utils/screen-height'
import BackToTop from '@/components/BackToTop'
import { stat } from '@/api/admin-user-log'
@ -155,8 +156,8 @@ export default {
height: 600,
loadNum: false,
loadDate: false,
loadRegion: false,
number: {
loadField: false,
num: {
total: '--',
today: '--',
yesterday: '--',
@ -170,12 +171,12 @@ export default {
y_data: [],
date: []
},
region: {
field: {
x_data: [],
y_data: [],
date: []
},
regionType: [
fieldType: [
{
value: 'country',
label: '国家'
@ -191,10 +192,14 @@ export default {
{
value: 'isp',
label: 'ISP'
},
{
value: 'user',
label: '用户'
}
],
regionValue: 'city',
regionLabel: '城市',
fieldValue: 'user',
fieldLabel: '用户',
cardBodyStyle: {
padding: '10px 0px 0px 0px'
}
@ -202,6 +207,7 @@ export default {
},
computed: {},
created() {
this.height = screenHeight()
this.stat()
},
mounted() {},
@ -209,12 +215,12 @@ export default {
stat() {
this.loadNum = true
stat().then(res => {
this.number = res.data.number
this.num = res.data.num
this.date = res.data.date
this.region = res.data.region
this.field = res.data.field
this.echartDate(res.data.date)
this.echartRegionLine(res.data.region)
this.echartRegionPie(res.data.region)
this.echartFieldLine(res.data.field)
this.echartFieldPie(res.data.field)
this.loadNum = false
}).catch(() => {
this.loadNum = false
@ -232,18 +238,18 @@ export default {
this.loadDate = false
})
},
echartRegionChange() {
this.loadRegion = true
echartFieldChange() {
this.loadField = true
stat({
type: 'region',
date: this.region.date,
region: this.regionValue
type: 'field',
date: this.field.date,
field: this.fieldValue
}).then(res => {
this.echartRegionLine(res.data.region)
this.echartRegionPie(res.data.region)
this.loadRegion = false
this.echartFieldLine(res.data.field)
this.echartFieldPie(res.data.field)
this.loadField = false
}).catch(() => {
this.loadRegion = false
this.loadField = false
})
},
echartDate(data) {
@ -281,8 +287,8 @@ export default {
}
echart.setOption(option)
},
echartRegionLine(data) {
var echart = echarts.init(document.getElementById('echartRegionLine'))
echartFieldLine(data) {
var echart = echarts.init(document.getElementById('echartFieldLine'))
var option = {
title: {
text: ''
@ -303,11 +309,7 @@ export default {
xAxis: [
{
type: 'category',
boundaryGap: false,
data: data.x_data,
axisTick: {
alignWithLabel: true
}
data: data.x_data
}
],
yAxis: [
@ -317,17 +319,15 @@ export default {
],
series: [
{
name: '',
type: 'bar',
barWidth: '60%',
data: data.y_data
}
]
}
echart.setOption(option)
},
echartRegionPie(data) {
var echart = echarts.init(document.getElementById('echartRegionPie'))
echartFieldPie(data) {
var echart = echarts.init(document.getElementById('echartFieldPie'))
var option = {
title: {
text: ''

View File

@ -27,7 +27,7 @@
</el-col>
<el-col :xs="24" :sm="3" style="text-align:right;">
<el-button v-permission="['admin/AdminUserLog/clear']" class="filter-item" title="日志清除" @click="clear()">清除</el-button>
<el-button v-permission="['admin/AdminUserLog/stat']" class="filter-item" type="primary" title="日志统计" @click="stat">统计</el-button>
<el-button v-permission="['admin/AdminUserLog/stat']" class="filter-item" type="primary" title="日志管理统计" @click="stat">统计</el-button>
</el-col>
</el-row>
</div>
@ -52,10 +52,10 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="lists" />
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 详情 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+'px'}">
<el-form-item label="用户ID" prop="admin_user_id">
<el-col :span="10">
<el-input v-model="model.admin_user_id" />
@ -122,12 +122,18 @@
<el-form-item label="用户ID" prop="admin_user_id">
<el-input v-model="clearModel.admin_user_id" type="number" clearable />
</el-form-item>
<el-form-item label="用户账号" prop="username">
<el-input v-model="clearModel.username" type="text" clearable />
</el-form-item>
<el-form-item label="菜单ID" prop="admin_menu_id">
<el-input v-model="clearModel.admin_menu_id" type="number" clearable />
</el-form-item>
<el-form-item label="日期范围" prop="clear_date">
<el-form-item label="菜单链接" prop="menu_url">
<el-input v-model="clearModel.menu_url" type="text" clearable />
</el-form-item>
<el-form-item label="日期范围" prop="date_range">
<el-date-picker
v-model="clearModel.clear_date"
v-model="clearModel.date_range"
type="daterange"
class="filter-item"
range-separator="-"
@ -168,7 +174,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
dialog: false,
dialogTitle: '',
@ -178,19 +184,21 @@ export default {
clearDialogTitle: '',
clearModel: {
admin_user_id: '',
username: '',
admin_menu_id: '',
clear_date: []
menu_url: '',
date_range: []
},
clearRules: {}
}
},
created() {
this.height = screenHeight()
this.lists()
this.list()
},
methods: {
//
lists() {
list() {
this.loading = true
list(this.query).then(res => {
this.data = res.data.list
@ -217,15 +225,15 @@ export default {
//
dele(row) {
this.$confirm(
'确定要删除日志管理 <span style="color:red">' + row.admin_user_log_id + ' </span>吗?',
'删除日志管理' + row.admin_user_log_id,
'确定要删除日志ID<span style="color:red">' + row.admin_user_log_id + ' </span>吗?',
'删除日志' + row.admin_user_log_id,
{ type: 'warning', dangerouslyUseHTMLString: true }
).then(() => {
this.loading = true
dele({
admin_user_log_id: row.admin_user_log_id
}).then(res => {
this.lists()
this.list()
this.reset()
this.$message.success(res.msg)
}).catch(() => {
@ -254,12 +262,12 @@ export default {
//
search() {
this.query.page = 1
this.lists()
this.list()
},
//
refresh() {
this.query = this.$options.data().query
this.lists()
this.list()
},
//
sort(sort) {
@ -267,11 +275,11 @@ export default {
this.query.sort_type = ''
if (sort.order === 'ascending') {
this.query.sort_type = 'asc'
this.lists()
this.list()
}
if (sort.order === 'descending') {
this.query.sort_type = 'desc'
this.lists()
this.list()
}
},
//
@ -285,8 +293,9 @@ export default {
clearSubmit() {
this.loading = true
clear(this.clearModel).then(res => {
this.lists()
this.list()
this.clearDialog = false
this.clearModel = this.$options.data().clearModel
this.$message.success('已清除日志记录 ' + res.data.count + ' 条')
}).catch(() => {
this.loading = false

View File

@ -48,7 +48,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :model="model" :rules="rules" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="ref" :model="model" :rules="rules" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item v-if="model.admin_user_id && model.avatar" label="头像" prop="avatar">
<el-col :span="10">
<el-avatar shape="circle" fit="contain" :size="100" :src="model.avatar" />
@ -126,7 +126,7 @@
</el-dialog>
<!-- 分配权限 -->
<el-dialog :title="'用户分配权限:'+model.admin_user_id" :visible.sync="ruleDialog" top="1vh" width="50%">
<el-form ref="roleRef" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="roleRef" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="账号">
<el-col :span="10">
<el-input v-model="model.username" disabled />
@ -162,6 +162,10 @@
<i v-if="data.is_menu" class="el-icon-menu" style="margin-left:10px" title="按菜单" />
<i v-if="data.menu_url" class="el-icon-link" style="margin-left:10px" :title="data.menu_url" />
<i v-else class="el-icon-link" style="margin-left:10px;color:#fff" />
<i v-if="data.is_unauth" class="el-icon-unlock" style="margin-left:10px;" title="无需权限" />
<i v-else class="el-icon-unlock" style="margin-left:10px;color:#fff" />
<i v-if="data.is_unlogin" class="el-icon-user" style="margin-left:10px;" title="无需登录" />
<i v-else class="el-icon-user" style="margin-left:10px;color:#fff" />
</span>
</span>
</el-tree>
@ -174,7 +178,7 @@
</el-dialog>
<!-- 重置密码 -->
<el-dialog :title="'用户重置密码:'+model.admin_user_id" :visible.sync="pwdDialog" top="1vh" width="50%">
<el-form ref="pwdRef" :rules="pwdRules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="pwdRef" :rules="pwdRules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="账号">
<el-input v-model="model.username" clearable disabled />
</el-form-item>
@ -196,7 +200,7 @@
<script>
import screenHeight from '@/utils/screen-height'
import Pagination from '@/components/Pagination'
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
import { list, info, add, edit, dele, issuper, disable, rule, pwd } from '@/api/admin-user'
export default {
@ -210,7 +214,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
dialog: false,
dialogTitle: '',
@ -234,7 +238,7 @@ export default {
update_time: ''
},
uploadAction: process.env.VUE_APP_BASE_API + '/admin/AdminUser/avatar',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadHeaders: { AdminToken: getAdminToken() },
uploadData: { admin_user_id: '' },
ruleDialog: false,
roleData: [],

View File

@ -7,21 +7,27 @@
<el-form ref="ref" :model="model" :rules="rules" label-width="100px">
<el-form-item label="比特(b)">
<el-input v-model="model.b" type="number" clearable @input="value('b')" />
<el-button icon="el-icon-document-copy" @click="copy(model.b, $event)" />
</el-form-item>
<el-form-item label="字节(B)">
<el-input v-model="model.B" type="number" clearable @input="value('B')" />
<el-button icon="el-icon-document-copy" @click="copy(model.B, $event)" />
</el-form-item>
<el-form-item label="千字节(KB)">
<el-input v-model="model.KB" type="number" clearable @input="value('KB')" />
<el-button icon="el-icon-document-copy" @click="copy(model.KB, $event)" />
</el-form-item>
<el-form-item label="兆字节(MB)">
<el-input v-model="model.MB" type="number" clearable @input="value('MB')" />
<el-button icon="el-icon-document-copy" @click="copy(model.MB, $event)" />
</el-form-item>
<el-form-item label="吉字节(GB)">
<el-input v-model="model.GB" type="number" clearable @input="value('GB')" />
<el-button icon="el-icon-document-copy" @click="copy(model.GB, $event)" />
</el-form-item>
<el-form-item label="太字节(TB)">
<el-input v-model="model.TB" type="number" clearable @input="value('TB')" />
<el-button icon="el-icon-document-copy" @click="copy(model.TB, $event)" />
</el-form-item>
<el-form-item>
<el-button @click="clear()">清空</el-button>
@ -33,6 +39,7 @@
</template>
<script>
import clip from '@/utils/clipboard'
import { bytetran } from '@/api/admin-utils'
export default {
@ -73,10 +80,18 @@ export default {
})
}
})
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请转换字节')
}
}
}
}
</script>
<style scoped>
.el-input{width: 90%;}
</style>

View File

@ -7,21 +7,27 @@
<el-form ref="ref" :model="model" :rules="rules" label-width="100px">
<el-form-item label="IP">
<el-input v-model="model.ip" type="text" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.ip, $event)" />
</el-form-item>
<el-form-item label="国家">
<el-input v-model="model.country" type="text" />
<el-button icon="el-icon-document-copy" @click="copy(model.country, $event)" />
</el-form-item>
<el-form-item label="省份">
<el-input v-model="model.province" type="text" />
<el-button icon="el-icon-document-copy" @click="copy(model.province, $event)" />
</el-form-item>
<el-form-item label="城市">
<el-input v-model="model.city" type="text" />
<el-button icon="el-icon-document-copy" @click="copy(model.city, $event)" />
</el-form-item>
<el-form-item label="区县">
<el-input v-model="model.area" type="text" />
<el-button icon="el-icon-document-copy" @click="copy(model.area, $event)" />
</el-form-item>
<el-form-item label="运营商">
<el-input v-model="model.isp" type="text" />
<el-button icon="el-icon-document-copy" @click="copy(model.isp, $event)" />
</el-form-item>
<el-form-item>
<el-button @click="clear()">清空</el-button>
@ -33,6 +39,7 @@
</template>
<script>
import clip from '@/utils/clipboard'
import { ipinfo } from '@/api/admin-utils'
export default {
@ -66,10 +73,18 @@ export default {
})
}
})
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请查询IP')
}
}
}
}
</script>
<style scoped>
.el-input{width: 90%;}
</style>

View File

@ -10,11 +10,7 @@
</el-form-item>
<el-form-item id="qrcode" label="二维码" prop="value" style="margin-bottom: 0;">
<qrcode-vue v-if="model.value" v-model="model.value" :size="model.size" />
<el-image v-else style="width: 200px; height: 200px">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
<div v-else style="width:215px;height:215px" />
</el-form-item>
<el-form-item>
<el-button @click="clear()">清空</el-button>

View File

@ -146,7 +146,6 @@ import { server } from '@/api/admin-utils'
export default {
name: 'Server',
components: {},
data() {
return {
loading: false,

View File

@ -70,13 +70,6 @@ export default {
}
this.model.lens = lens
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请生成随机字符串')
}
},
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
@ -88,6 +81,13 @@ export default {
})
}
})
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请生成随机字符串')
}
}
}
}

View File

@ -10,18 +10,23 @@
</el-form-item>
<el-form-item label="长度" prop="len">
<el-input v-model="model.len" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.len, $event)" />
</el-form-item>
<el-form-item label="小写" prop="lower">
<el-input v-model="model.lower" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.lower, $event)" />
</el-form-item>
<el-form-item label="大写" prop="upper">
<el-input v-model="model.upper" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.upper, $event)" />
</el-form-item>
<el-form-item label="反转" prop="rev">
<el-input v-model="model.rev" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.rev, $event)" />
</el-form-item>
<el-form-item label="MD5" prop="md5">
<el-input v-model="model.md5" clearable />
<el-button icon="el-icon-document-copy" @click="copy(model.md5, $event)" />
</el-form-item>
<el-form-item>
<el-button @click="clear()">清空</el-button>
@ -33,6 +38,7 @@
</template>
<script>
import clip from '@/utils/clipboard'
import { strtran } from '@/api/admin-utils'
export default {
@ -66,10 +72,18 @@ export default {
})
}
})
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请转换字符串')
}
}
}
}
</script>
<style scoped>
.el-input{width: 90%;}
</style>

View File

@ -7,9 +7,11 @@
<el-form ref="ref" :model="model" :rules="rules" label-width="100px">
<el-form-item label="时间戳">
<el-input v-model="model.timestamp" type="number" prefix-icon="el-icon-stopwatch" placeholder="请输入时间戳" clearable @input="value('timestamp')" />
<el-button icon="el-icon-document-copy" @click="copy(model.datetime, $event)" />
</el-form-item>
<el-form-item label="日期时间">
<el-date-picker v-model="model.datetime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择日期时间" clearable @change="value('datetime')" />
<el-button icon="el-icon-document-copy" @click="copy(model.datetime, $event)" />
</el-form-item>
<el-form-item>
<el-button @click="clear()">清空</el-button>
@ -21,6 +23,7 @@
</template>
<script>
import clip from '@/utils/clipboard'
import { timestamp } from '@/api/admin-utils'
export default {
@ -50,10 +53,18 @@ export default {
timestamp(this.model).then((res) => {
this.model = res.data
})
},
copy(text, event) {
if (text) {
clip(text, event)
} else {
this.$message.error('请转换时间戳')
}
}
}
}
</script>
<style scoped>
.el-input{width: 90%;}
</style>

View File

@ -61,7 +61,7 @@
</el-row>
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminUtils/server'])" label="服务器" name="server">
<el-row :gutter="8">
<el-row :gutter="8" class="dialog-body" :style="{height:height+60+'px'}">
<el-col :sm="24" :md="24">
<div class="filter-container">
<Server v-if="server" />
@ -69,11 +69,21 @@
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/AdminUtils/toollu'])" label="在线工具" name="toollu">
<el-row :gutter="8" class="dialog-body" :style="{height:height+60+'px'}">
<el-col :sm="24" :md="24">
<div class="filter-container">
<Toollu v-if="toollu" />
</div>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import screenHeight from '@/utils/screen-height'
import checkPermission from '@/utils/permission' //
import permission from '@/directive/permission/index.js' //
import Strtran from './components/Strtran'
@ -84,13 +94,15 @@ import Byte from './components/Byte'
import Ip from './components/Ip'
import Map from './components/Map'
import Server from './components/Server'
import Toollu from './components/Toollu'
export default {
name: 'Utils',
directives: { permission },
components: { Strtran, Strrand, Timestamp, Qrcode, Byte, Ip, Map, Server },
components: { Strtran, Strrand, Timestamp, Qrcode, Byte, Ip, Map, Server, Toollu },
data() {
return {
height: 680,
str: true,
timestamp: false,
qrcode: false,
@ -98,10 +110,13 @@ export default {
ip: false,
map: false,
server: false,
toollu: false,
actTabName: 'str'
}
},
created() { },
created() {
this.height = screenHeight()
},
methods: {
checkPermission,
tabClick(tab) {

View File

@ -55,7 +55,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+'px'}">
<el-form-item label="名称" prop="env_name">
<el-input v-model="model.env_name" placeholder="请输入名称" clearable />
</el-form-item>
@ -104,7 +104,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
model: {
api_env_id: '',

View File

@ -10,7 +10,7 @@
</el-row>
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height+80" style="width: 100%" row-key="api_id" border>
<el-table v-loading="loading" :data="data" :height="height+50" style="width: 100%" row-key="api_id" border>
<el-table-column prop="api_name" label="接口名称" min-width="200" fixed="left" />
<el-table-column prop="api_url" label="接口链接" min-width="260" show-overflow-tooltip />
<el-table-column prop="api_sort" label="接口排序" min-width="90" />
@ -18,14 +18,32 @@
<el-table-column prop="api_pid" label="PID" min-width="80" />
<el-table-column prop="create_time" label="添加时间" min-width="160" />
<el-table-column prop="update_time" label="修改时间" min-width="160" />
<el-table-column prop="is_disable" label="是否禁用" min-width="80" align="center">
<el-table-column prop="is_disable" label="是否禁用" min-width="95" align="center">
<template slot="header">
<span>是否禁用 </span>
<el-tooltip placement="top">
<div slot="content">
开启后无法访问<br>
</div>
<i class="el-icon-info" title="" />
</el-tooltip>
</template>
<template slot-scope="scope">
<el-switch v-if="scope.row.api_url" v-model="scope.row.is_disable" :active-value="1" :inactive-value="0" @change="disable(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="is_unauth" label="无需权限" min-width="80" align="center">
<el-table-column prop="is_unlogin" label="无需登录" min-width="95" align="center">
<template slot="header">
<span>无需登录 </span>
<el-tooltip placement="top">
<div slot="content">
开启后不用登录也可以访问如登录注册等<br>
</div>
<i class="el-icon-info" title="" />
</el-tooltip>
</template>
<template slot-scope="scope">
<el-switch v-if="scope.row.api_url" v-model="scope.row.is_unauth" :active-value="1" :inactive-value="0" @change="unauth(scope.row)" />
<el-switch v-if="scope.row.api_url" v-model="scope.row.is_unlogin" :active-value="1" :inactive-value="0" @change="unlogin(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" min-width="210" align="right" fixed="right">
@ -37,8 +55,8 @@
</el-table-column>
</el-table>
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" width="65%" top="1vh" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-dialog :title="dialogTitle" :visible.sync="dialog" width="50%" top="1vh" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="接口父级" prop="api_pid">
<el-cascader
v-model="model.api_pid"
@ -55,19 +73,16 @@
<el-input v-model="model.api_name" placeholder="请输入接口名称" clearable />
</el-form-item>
<el-form-item label="接口链接" prop="api_url">
<el-input v-model="model.api_url" />
<el-input v-model="model.api_url" placeholder="应用/控制器/操作,区分大小写" />
</el-form-item>
<el-form-item label="接口排序" prop="api_sort">
<el-input v-model="model.api_sort" type="number" placeholder="200" />
</el-form-item>
<el-form-item v-if="model.api_id" label="添加时间" prop="create_time">
<el-col :span="10">
<el-input v-model="model.create_time" disabled />
</el-col>
<el-col class="line" :span="4" style="text-align:center">修改时间</el-col>
<el-col :span="10">
<el-input v-model="model.update_time" disabled />
</el-col>
<el-input v-model="model.create_time" disabled />
</el-form-item>
<el-form-item v-if="model.api_id" label="修改时间" prop="update_time">
<el-input v-model="model.update_time" disabled />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -81,7 +96,7 @@
<script>
import screenHeight from '@/utils/screen-height'
import permission from '@/directive/permission/index.js' //
import { list, info, add, edit, dele, disable, unauth } from '@/api/api'
import { list, info, add, edit, dele, disable, unlogin } from '@/api/api'
export default {
name: 'Api',
@ -230,12 +245,12 @@ export default {
this.loading = false
})
},
//
unauth(row) {
//
unlogin(row) {
this.loading = true
unauth({
unlogin({
api_id: row.api_id,
is_unauth: row.is_unauth
is_unlogin: row.is_unlogin
}).then(res => {
this.list()
this.$message.success(res.msg)

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container dialog-body" :style="{height:height+120+'px'}">
<el-card v-loading="loadNum" class="box-card">
<el-row :gutter="10">
<el-col :sm="4">
@ -8,7 +8,7 @@
<span>总计</span>
</div>
<div class="text color-tot">
{{ number.total }}
{{ num.total }}
</div>
</el-card>
</el-col>
@ -18,7 +18,7 @@
<span>今天</span>
</div>
<div class="text">
{{ number.today }}
{{ num.today }}
</div>
</el-card>
</el-col>
@ -28,7 +28,7 @@
<span>昨天</span>
</div>
<div class="text">
{{ number.yesterday }}
{{ num.yesterday }}
</div>
</el-card>
</el-col>
@ -38,7 +38,7 @@
<span>本周</span>
</div>
<div class="text">
{{ number.thisweek }}
{{ num.thisweek }}
</div>
</el-card>
</el-col>
@ -48,7 +48,7 @@
<span>上周</span>
</div>
<div class="text">
{{ number.lastweek }}
{{ num.lastweek }}
</div>
</el-card>
</el-col>
@ -58,7 +58,7 @@
<span>本月</span>
</div>
<div class="text">
{{ number.thismonth }}
{{ num.thismonth }}
</div>
</el-card>
</el-col>
@ -68,7 +68,7 @@
<span>上月</span>
</div>
<div class="text">
{{ number.lastmonth }}
{{ num.lastmonth }}
</div>
</el-card>
</el-col>
@ -91,7 +91,7 @@
</el-row>
<el-row :gutter="0">
<el-col :sm="24">
<div id="echartDate" :style="{height:height+'px'}" />
<div id="echartDate" :style="{height:height-100+'px'}" />
</el-col>
</el-row>
</el-card>
@ -99,34 +99,33 @@
<el-row :gutter="0">
<el-col :sm="24">
<el-date-picker
v-model="region.date"
v-model="field.date"
type="daterange"
range-separator="-"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="max-width:280px"
@change="echartRegionChange()"
@change="echartFieldChange()"
/>
<el-select v-model="regionValue" placeholder="请选择" @change="echartRegionChange()">
<el-option v-for="item in regionType" :key="item.value" :label="item.label" :value="item.value" />
<el-select v-model="fieldValue" placeholder="请选择" @change="echartFieldChange()">
<el-option v-for="item in fieldType" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
</el-row>
<el-divider />
<el-row v-loading="loadRegion" :gutter="0">
<el-row v-loading="loadField" :gutter="0">
<el-col :sm="24">
<div id="echartRegionLine" :style="{height:height+'px'}" />
<div id="echartFieldLine" :style="{height:height+'px'}" />
</el-col>
</el-row>
<el-divider />
<el-row v-loading="loadRegion" :gutter="0">
<el-row v-loading="loadField" :gutter="0">
<el-col :sm="24">
<div id="echartRegionPie" :style="{height:height+'px'}" />
<div id="echartFieldPie" :style="{height:height+'px'}" />
</el-col>
</el-row>
</el-card>
<back-to-top transition-name="fade" />
</div>
</template>
@ -144,6 +143,7 @@ import { CanvasRenderer } from 'echarts/renderers'
//
echarts.use([LegendComponent, TitleComponent, TooltipComponent, GridComponent, LineChart, BarChart, PieChart, CanvasRenderer])
import screenHeight from '@/utils/screen-height'
import BackToTop from '@/components/BackToTop'
import { stat } from '@/api/member-log'
@ -155,8 +155,8 @@ export default {
height: 600,
loadNum: false,
loadDate: false,
loadRegion: false,
number: {
loadField: false,
num: {
total: '--',
today: '--',
yesterday: '--',
@ -170,12 +170,12 @@ export default {
y_data: [],
date: []
},
region: {
field: {
x_data: [],
y_data: [],
date: []
},
regionType: [
fieldType: [
{
value: 'country',
label: '国家'
@ -191,28 +191,33 @@ export default {
{
value: 'isp',
label: 'ISP'
},
{
value: 'member',
label: '会员'
}
],
regionValue: 'city',
regionLabel: '城市',
fieldValue: 'member',
fieldLabel: '会员',
cardBodyStyle: {
padding: '10px 0px 0px 0px'
}
}
},
created() {
this.height = screenHeight()
this.stat()
},
methods: {
stat() {
this.loadNum = true
stat().then(res => {
this.number = res.data.number
this.num = res.data.num
this.date = res.data.date
this.region = res.data.region
this.field = res.data.field
this.echartDate(res.data.date)
this.echartRegionLine(res.data.region)
this.echartRegionPie(res.data.region)
this.echartFieldLine(res.data.field)
this.echartFieldPie(res.data.field)
this.loadNum = false
}).catch(() => {
this.loadNum = false
@ -229,18 +234,18 @@ export default {
this.loadDate = false
})
},
echartRegionChange(value) {
this.loadRegion = true
echartFieldChange(value) {
this.loadField = true
stat({
type: 'region',
date: this.region.date,
region: this.regionValue
type: 'field',
date: this.field.date,
field: this.fieldValue
}).then(res => {
this.echartRegionLine(res.data.region)
this.echartRegionPie(res.data.region)
this.loadRegion = false
this.echartFieldLine(res.data.field)
this.echartFieldPie(res.data.field)
this.loadField = false
}).catch(() => {
this.loadRegion = false
this.loadField = false
})
},
echartDate(data) {
@ -277,8 +282,8 @@ export default {
}
echart.setOption(option)
},
echartRegionLine(data) {
var echart = echarts.init(document.getElementById('echartRegionLine'))
echartFieldLine(data) {
var echart = echarts.init(document.getElementById('echartFieldLine'))
var option = {
title: {
text: ''
@ -299,11 +304,7 @@ export default {
xAxis: [
{
type: 'category',
boundaryGap: false,
data: data.x_data,
axisTick: {
alignWithLabel: true
}
data: data.x_data
}
],
yAxis: [
@ -313,17 +314,15 @@ export default {
],
series: [
{
name: '',
type: 'bar',
barWidth: '60%',
data: data.y_data
}
]
}
echart.setOption(option)
},
echartRegionPie(data) {
var echart = echarts.init(document.getElementById('echartRegionPie'))
echartFieldPie(data) {
var echart = echarts.init(document.getElementById('echartFieldPie'))
var option = {
title: {
text: ''

View File

@ -3,13 +3,13 @@
<!-- 查询 -->
<div class="filter-container">
<el-row :gutter="0">
<el-col :xs="24" :sm="22">
<el-col :xs="24" :sm="21">
<el-select v-model="query.log_type" class="filter-item" style="width:110px;" placeholder="日志类型" clearable>
<el-option :value="1" label="注册日志" />
<el-option :value="2" label="登录日志" />
<el-option :value="3" label="操作日志" />
</el-select>
<el-input v-model="query.member_keyword" class="filter-item" style="width: 135px;" placeholder="账号/昵称" clearable />
<el-input v-model="query.member_keyword" class="filter-item" style="width: 135px;" placeholder="会员账号/昵称" clearable />
<el-input v-model="query.api_keyword" class="filter-item" style="width: 235px;" placeholder="接口链接/名称" clearable />
<el-input v-model="query.request_keyword" class="filter-item" style="width: 155px;" placeholder="请求IP/地区/ISP" clearable />
<el-date-picker
@ -25,7 +25,8 @@
<el-button class="filter-item" type="primary" @click="search()">查询</el-button>
<el-button class="filter-item" @click="refresh()">刷新</el-button>
</el-col>
<el-col :xs="24" :sm="2" style="text-align:right;">
<el-col :xs="24" :sm="3" style="text-align:right;">
<el-button v-permission="['admin/MemberLog/clear']" class="filter-item" title="日志清除" @click="clear()">清除</el-button>
<el-button v-permission="['admin/MemberLog/stat']" class="filter-item" type="primary" title="日志统计" @click="stat">统计</el-button>
</el-col>
</el-row>
@ -33,10 +34,10 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height" style="width: 100%" border @sort-change="sort">
<el-table-column prop="member_log_id" label="日志ID" min-width="100" sortable="custom" fixed="left" />
<el-table-column prop="username" label="账号" min-width="110" show-overflow-tooltip />
<el-table-column prop="api_url" label="接口链接" min-width="240" show-overflow-tooltip />
<el-table-column prop="username" label="会员账号" min-width="110" show-overflow-tooltip />
<el-table-column prop="api_url" label="接口链接" min-width="220" show-overflow-tooltip />
<el-table-column prop="api_name" label="接口名称" min-width="130" show-overflow-tooltip />
<el-table-column prop="request_method" label="请求方式 " min-width="110" />
<el-table-column prop="request_method" label="请求方式 " min-width="100" />
<el-table-column prop="request_ip" label="请求IP" min-width="130" />
<el-table-column prop="request_region" label="请求地区" min-width="150" show-overflow-tooltip />
<el-table-column prop="request_isp" label="请求ISP" min-width="110" />
@ -54,7 +55,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 详情 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+'px'}">
<el-form-item label="会员ID" prop="member_id">
<el-col :span="10">
<el-input v-model="model.member_id" />
@ -64,7 +65,7 @@
<el-input v-model="model.nickname" />
</el-col>
</el-form-item>
<el-form-item label="账号" prop="username">
<el-form-item label="会员账号" prop="username">
<el-input v-model="model.username" />
</el-form-item>
<el-form-item label="接口ID" prop="api_id">
@ -115,6 +116,43 @@
<el-button type="primary" @click="submit">确定</el-button>
</div>
</el-dialog>
<!-- 清除 -->
<el-dialog :title="clearDialogTitle" :visible.sync="clearDialog" :before-close="clearCancel">
<el-form ref="clearRef" :rules="clearRules" :model="clearModel" label-width="100px" class="dialog-body">
<el-form-item label="会员ID" prop="member_id">
<el-input v-model="clearModel.member_id" type="number" clearable />
</el-form-item>
<el-form-item label="会员账号" prop="username">
<el-input v-model="clearModel.username" type="text" clearable />
</el-form-item>
<el-form-item label="接口ID" prop="api_id">
<el-input v-model="clearModel.api_id" type="number" clearable />
</el-form-item>
<el-form-item label="接口链接" prop="api_url">
<el-input v-model="clearModel.api_url" type="text" clearable />
</el-form-item>
<el-form-item label="日期范围" prop="date_range">
<el-date-picker
v-model="clearModel.date_range"
type="daterange"
class="filter-item"
range-separator="-"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<el-form-item label="">
<p>*清除后不可恢复</p>
<p>*根据填写的条件清除</p>
<p>*不填写清除条件将清空所有</p>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="clearCancel()">取消</el-button>
<el-button type="primary" @click="clearSubmit()">确定</el-button>
</div>
</el-dialog>
</div>
</template>
@ -122,7 +160,7 @@
import screenHeight from '@/utils/screen-height'
import Pagination from '@/components/Pagination'
import permission from '@/directive/permission/index.js' //
import { list, info, dele } from '@/api/member-log'
import { list, info, dele, clear } from '@/api/member-log'
export default {
name: 'MemberLog',
@ -136,12 +174,22 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
dialog: false,
dialogTitle: '',
model: {},
rules: {}
rules: {},
clearDialog: false,
clearDialogTitle: '',
clearModel: {
member_id: '',
username: '',
api_id: '',
api_url: '',
date_range: []
},
clearRules: {}
}
},
created() {
@ -177,7 +225,7 @@ export default {
//
dele(row) {
this.$confirm(
'确定要删除会员日志 <span style="color:red">' + row.member_log_id + ' </span>吗?',
'确定要删除会员日志ID <span style="color:red">' + row.member_log_id + ' </span>吗?',
'删除会员日志:' + row.member_log_id,
{ type: 'warning', dangerouslyUseHTMLString: true }
).then(() => {
@ -230,6 +278,25 @@ export default {
this.list()
}
},
//
clear() {
this.clearDialog = true
this.clearDialogTitle = '会员日志清除'
},
clearCancel() {
this.clearDialog = false
},
clearSubmit() {
this.loading = true
clear(this.clearModel).then(res => {
this.list()
this.clearDialog = false
this.clearModel = this.$options.data().clearModel
this.$message.success('已清除日志记录 ' + res.data.count + ' 条')
}).catch(() => {
this.loading = false
})
},
//
stat() {
this.$router.push('/members/member-log-stat')

View File

@ -70,7 +70,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :model="model" :rules="rules" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="ref" :model="model" :rules="rules" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item v-if="model.member_id" label="头像" prop="avatar">
<el-avatar shape="circle" fit="contain" :size="100" :src="model.avatar" />
<el-upload
@ -137,7 +137,7 @@
</el-dialog>
<!-- 重置密码 -->
<el-dialog :title="pwdDialogTitle" :visible.sync="pwdDialog" top="1vh" :before-close="pwdCancel">
<el-form ref="refPwd" :rules="pwdRules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+30+'px'}">
<el-form ref="refPwd" :rules="pwdRules" :model="model" label-width="100px" class="dialog-body" :style="{height:height+'px'}">
<el-form-item label="账号">
<el-input v-model="model.username" clearable disabled />
</el-form-item>
@ -159,7 +159,7 @@
<script>
import screenHeight from '@/utils/screen-height'
import Pagination from '@/components/Pagination'
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
import { list as regionList } from '@/api/region'
import { list, info, add, edit, dele, pwd, disable } from '@/api/member'
@ -174,7 +174,7 @@ export default {
count: 0,
query: {
page: 1,
limit: 13
limit: 12
},
dialog: false,
dialogTitle: '',
@ -202,7 +202,7 @@ export default {
label: 'region_name'
},
uploadAction: process.env.VUE_APP_BASE_API + '/admin/Member/avatar',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadHeaders: { AdminToken: getAdminToken() },
uploadData: { member_id: '' },
pwdDialog: false,
pwdDialogTitle: '',

View File

@ -29,7 +29,7 @@
</el-row>
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height+80" style="width: 100%" border @sort-change="sort">
<el-table v-loading="loading" :data="data" :height="height" style="width: 100%" border @sort-change="sort">
<el-table-column prop="news_category_id" label="分类ID" min-width="100" sortable="custom" />
<el-table-column prop="category_name" label="分类名称" min-width="250" show-overflow-tooltip />
<el-table-column prop="category_sort" label="分类排序" min-width="110" sortable="custom" />
@ -51,7 +51,7 @@
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel" @opened="dialogOpened()" @closed="dialogClosed()" @close-on-click-modal="false">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="分类名称" prop="category_name">
<el-input v-model="model.category_name" clearable placeholder="请输入分类名称" />
</el-form-item>
@ -91,7 +91,7 @@ export default {
loading: false,
query: {
page: 1,
limit: 13
limit: 12
},
data: [],
count: 0,
@ -117,6 +117,7 @@ export default {
this.loading = true
list(this.query).then(res => {
this.data = res.data.list
this.count = res.data.count
this.loading = false
}).catch(() => {
this.loading = false

View File

@ -11,7 +11,7 @@
<el-option v-for="item in newsCategory" :key="item.news_category_id" :label="item.category_name" :value="item.news_category_id" />
</el-select>
<el-select v-model="query.date_type" class="filter-item" style="width:110px;" placeholder="时间类型" clearable>
<el-option value="time" label="时间" />
<el-option value="time" label="发布时间" />
<el-option value="create_time" label="添加时间" />
<el-option value="update_time" label="修改时间" />
</el-select>
@ -34,9 +34,9 @@
</el-row>
</div>
<!-- 列表 -->
<el-table v-loading="loading" :data="data" :height="height+80" style="width: 100%" border @sort-change="sort">
<el-table v-loading="loading" :data="data" :height="height" style="width: 100%" border @sort-change="sort">
<el-table-column prop="news_id" label="新闻ID" min-width="90" sortable="custom" />
<el-table-column prop="image" label="图片" min-width="80" align="center">
<el-table-column prop="image" label="图片" min-width="70" align="center">
<template slot-scope="scope">
<el-image
v-if="scope.row.img_url"
@ -47,9 +47,8 @@
/>
</template>
</el-table-column>
<el-table-column prop="title" label="标题" min-width="240" show-overflow-tooltip />
<el-table-column prop="category_name" label="分类" min-width="90" show-overflow-tooltip />
<el-table-column prop="time" label="时间" min-width="155" sortable="custom" />
<el-table-column prop="title" label="标题" min-width="230" show-overflow-tooltip />
<el-table-column prop="category_name" label="分类" min-width="95" show-overflow-tooltip />
<el-table-column prop="hits" label="点击量" min-width="90" sortable="custom" />
<el-table-column prop="sort" label="排序" min-width="80" sortable="custom" />
<el-table-column prop="is_top" label="置顶" min-width="80" sortable="custom" align="center">
@ -72,6 +71,7 @@
<el-switch v-model="scope.row.is_hide" :active-value="1" :inactive-value="0" @change="ishide(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="time" label="发布时间" min-width="155" sortable="custom" />
<el-table-column prop="create_time" label="添加时间" min-width="155" sortable="custom" />
<el-table-column prop="update_time" label="修改时间" min-width="155" sortable="custom" />
<el-table-column label="操作" min-width="145" align="right" fixed="right">
@ -84,8 +84,8 @@
<!-- 分页 -->
<pagination v-show="count > 0" :total="count" :page.sync="query.page" :limit.sync="query.limit" @pagination="list" />
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="65%" :before-close="cancel" @opened="dialogOpened()" @closed="dialogClosed()" @close-on-click-modal="false">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-dialog :title="dialogTitle" :visible.sync="dialog" width="50%" top="1vh" :before-close="cancel" @opened="dialogOpened()" @closed="dialogClosed()" @close-on-click-modal="false">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="图片" prop="img">
<el-col :span="10">
<el-image shape="circle" fit="contain" style="height: 100px" :src="model.img_url">
@ -105,7 +105,7 @@
:on-success="uploadSuccess"
:on-error="uploadError"
>
<el-button>上传图片</el-button>
<el-button size="mini">上传图片</el-button>
</el-upload>
<span>jpgpnggif图片小于200KB宽高1:1</span>
</el-col>
@ -113,6 +113,17 @@
<el-form-item label="标题" prop="title">
<el-input v-model="model.title" clearable placeholder="请输入标题" />
</el-form-item>
<el-form-item label="发布时间" prop="time">
<el-date-picker
v-model="model.time"
type="datetime"
class="filter-item"
style="width: 240px;"
range-separator="-"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择发布时间"
/>
</el-form-item>
<el-form-item label="分类">
<el-select v-model="model.news_category_id" clearable placeholder="请选择">
<el-option
@ -129,29 +140,18 @@
<el-form-item label="作者" prop="author">
<el-input v-model="model.author" clearable placeholder="" />
</el-form-item>
<el-form-item label="时间" prop="time">
<el-date-picker
v-model="model.time"
type="datetime"
class="filter-item"
style="width: 240px;"
range-separator="-"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择发布时间"
/>
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input v-model="model.source" clearable placeholder="" />
</el-form-item>
<el-form-item label="来源链接" prop="source_url">
<el-input v-model="model.source_url" clearable placeholder="" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="model.sort" clearable placeholder="" />
</el-form-item>
<el-form-item label="内容" prop="content">
<div id="content" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="model.sort" clearable placeholder="" />
</el-form-item>
<el-form-item v-if="model.news_id" label="添加时间" prop="create_time">
<el-col :span="10">
<el-input v-model="model.create_time" disabled />
@ -174,7 +174,7 @@
import screenHeight from '@/utils/screen-height'
import Pagination from '@/components/Pagination'
import permission from '@/directive/permission/index.js' //
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
import { list, category, info, add, edit, dele, istop, ishot, isrec, ishide } from '@/api/news'
import E from 'wangeditor'
@ -188,7 +188,7 @@ export default {
loading: false,
query: {
page: 1,
limit: 13
limit: 12
},
data: [],
count: 0,
@ -209,11 +209,10 @@ export default {
content: ''
},
uploadAction: process.env.VUE_APP_BASE_API + '/admin/News/upload',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadHeaders: { AdminToken: getAdminToken() },
uploadData: { type: 'image' },
editor: null,
rules: {
img: [{ required: true, message: '请上传图片', trigger: 'blur' }],
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
time: [{ required: true, message: '请选择发布时间', trigger: 'blur' }],
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
@ -232,6 +231,7 @@ export default {
this.loading = true
list(this.query).then(res => {
this.data = res.data.list
this.count = res.data.count
this.loading = false
}).catch(() => {
this.loading = false

View File

@ -4,7 +4,7 @@
<div class="filter-container">
<el-row>
<el-col :xm="24" :sm="22">
<el-input v-model="query.region_id" class="filter-item" style="width: 200px;" placeholder="ID" clearable />
<el-input v-model="query.region_id" class="filter-item" style="width: 200px;" placeholder="地区ID" clearable />
<el-input v-model="query.region_name" class="filter-item" style="width: 200px;" placeholder="名称" clearable />
<el-input v-model="query.region_pinyin" class="filter-item" style="width: 200px;" placeholder="拼音" clearable />
<el-button class="filter-item" type="primary" @click="search()">查询</el-button>
@ -19,7 +19,7 @@
<el-table
v-loading="loading"
:data="data"
:height="height+80"
:height="height+50"
style="width: 100%"
row-key="region_id"
border
@ -46,7 +46,7 @@
</el-table>
<!-- 添加修改 -->
<el-dialog :title="dialogTitle" :visible.sync="dialog" top="1vh" width="50%" :before-close="cancel">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+30+'px'}">
<el-form ref="ref" :rules="rules" :model="model" class="dialog-body" label-width="100px" :style="{height:height+'px'}">
<el-form-item label="父级" prop="region_pid">
<el-cascader
v-model="model.region_pid"

View File

@ -2,10 +2,16 @@
<div class="app-container">
<el-tabs v-model="actTabName" @tab-click="tabClick">
<el-tab-pane v-if="checkPermission(['admin/Setting/tokenInfo'])" label="Token设置" name="token">
<token v-if="token" />
<Token v-if="token" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/Setting/verifyInfo'])" label="验证码设置" name="verify">
<verify v-if="verify" />
<el-tab-pane v-if="checkPermission(['admin/Setting/captchaInfo'])" label="验证码设置" name="captcha">
<Captcha v-if="captcha" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/Setting/logInfo'])" label="日志设置" name="log">
<Log v-if="log" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/Setting/apiInfo'])" label="接口设置" name="api">
<Api v-if="api" />
</el-tab-pane>
</el-tabs>
</div>
@ -14,19 +20,26 @@
<script>
import checkPermission from '@/utils/permission' //
import Token from './components/Token'
import Verify from './components/Verify'
import Captcha from './components/Captcha'
import Log from './components/Log'
import Api from './components/Api'
export default {
name: 'Base',
components: { Token, Verify },
components: { Token, Captcha, Log, Api },
data() {
return {
height: 600,
token: true,
verify: false,
captcha: false,
log: false,
api: false,
actTabName: 'token'
}
},
created() { },
created() {
},
methods: {
checkPermission,
tabClick(tab) {

View File

@ -0,0 +1,86 @@
<template>
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="" prop="">
<span>次数/时间3/13次1秒次数设置为 0 则不限制</span>
</el-form-item>
<el-form-item label="接口速率">
<el-col :span="11">
<el-input v-model="model.api_rate_num" type="number" placeholder="次数" />
</el-col>
<el-col class="line" :span="2" style="text-align:center">/</el-col>
<el-col :span="11">
<el-input v-model="model.api_rate_time" type="number" placeholder="时间">
<template slot="append"></template>
</el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
<script>
import { apiInfo, apiEdit } from '@/api/setting'
export default {
name: 'Api',
components: {},
data() {
return {
loading: false,
model: {
api_rate_num: 3,
api_rate_time: 1
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
apiInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
apiInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
apiEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -0,0 +1,78 @@
<template>
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="注册验证码" prop="captcha_register">
<el-switch v-model="model.captcha_register" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item label="登录验证码" prop="captcha_login">
<el-switch v-model="model.captcha_login" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</el-card>
</template>
<script>
import { captchaInfo, captchaEdit } from '@/api/setting'
export default {
name: 'Captcha',
components: {},
data() {
return {
loading: false,
model: {
captcha_register: 0,
captcha_login: 0
},
rules: {}
}
},
created() {
this.info()
},
methods: {
//
info() {
captchaInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
captchaInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
captchaEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>

View File

@ -3,13 +3,14 @@
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="注册验证码" prop="verify_register">
<el-switch v-model="model.verify_register" :active-value="1" :inactive-value="0" />
<el-form-item label="" prop="">
<span>开启后会记录前台会员日志</span>
</el-form-item>
<el-form-item label="登录验证码" prop="verify_login">
<el-switch v-model="model.verify_login" :active-value="1" :inactive-value="0" />
<el-form-item label="日志记录" prop="log_switch">
<el-switch v-model="model.log_switch" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
@ -19,17 +20,16 @@
</template>
<script>
import { verifyInfo, verifyEdit } from '@/api/setting'
import { logInfo, logEdit } from '@/api/admin-setting'
export default {
name: 'Verify',
name: 'Log',
components: {},
data() {
return {
loading: false,
model: {
verify_register: 0,
verify_login: 0
log_switch: 0
},
rules: {}
}
@ -40,21 +40,33 @@ export default {
methods: {
//
info() {
verifyInfo().then(res => {
logInfo().then(res => {
this.model = res.data
})
},
//
refresh() {
this.loading = true
logInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
if (valid) {
this.loading = true
verifyEdit(this.model).then(res => {
logEdit(this.model).then(res => {
this.info()
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.info()
this.loading = false
})
}

View File

@ -3,15 +3,21 @@
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="120px">
<el-form-item label="Token名称" prop="token_name">
<el-input v-model="model.token_name" type="text" style="width:90%" />
<i class="el-icon-warning-outline" title="必须与前端设置一致否则Token验证失败。" />
</el-form-item>
<el-form-item label="Token密钥" prop="token_key">
<el-input v-model="model.token_key" type="text" style="width:90%" />
<i class="el-icon-warning-outline" title="修改后所有会员登录状态失效,需重新登录。" />
</el-form-item>
<el-form-item label="Token有效时间" prop="token_exp">
<el-input v-model="model.token_exp" type="number">
<template slot="append">小时</template>
</el-input>
</el-form-item>
<el-form-item label="" prop="">
<span>会员登录有效时间过期需重新登录</span>
</el-form-item>
<el-form-item>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
@ -30,6 +36,8 @@ export default {
return {
loading: false,
model: {
token_name: '',
token_key: '',
token_exp: 720
},
rules: {}
@ -45,6 +53,19 @@ export default {
this.model = res.data
})
},
//
refresh() {
this.loading = true
tokenInfo()
.then((res) => {
this.model = res.data
this.loading = false
this.$message.success(res.msg)
})
.catch(() => {
this.loading = false
})
},
//
submit() {
this.$refs['ref'].validate(valid => {
@ -55,7 +76,6 @@ export default {
this.loading = false
this.$message.success(res.msg)
}).catch(() => {
this.info()
this.loading = false
})
}

View File

@ -1,5 +1,5 @@
<template>
<el-card v-loading="loading" class="box-card">
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="130px">
@ -35,8 +35,8 @@
<el-input v-model="model.appsecret" />
</el-form-item>
<el-form-item>
<el-button @click="refresh()">刷新</el-button>
<el-button type="primary" @click="submit()">提交</el-button>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
@ -46,7 +46,7 @@
<script>
import { miniInfo, miniEdit } from '@/api/setting-wechat'
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
export default {
components: {},
@ -62,7 +62,7 @@ export default {
qrcode_url: ''
},
uploadAction: process.env.VUE_APP_BASE_API + '/admin/SettingWechat/qrcode',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadHeaders: { AdminToken: getAdminToken() },
uploadData: { type: 'mini' },
rules: {
appid: [{ required: true, message: '请输入appid', trigger: 'blur' }],

View File

@ -1,5 +1,5 @@
<template>
<el-card v-loading="loading" class="box-card">
<el-card class="box-card">
<el-row :gutter="0">
<el-col :xs="24" :sm="12">
<el-form ref="ref" :model="model" :rules="rules" label-width="130px">
@ -49,8 +49,8 @@
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button @click="refresh()">刷新</el-button>
<el-button type="primary" @click="submit()">提交</el-button>
<el-button :loading="loading" @click="refresh()">刷新</el-button>
<el-button :loading="loading" type="primary" @click="submit()">提交</el-button>
</el-form-item>
</el-form>
</el-col>
@ -60,7 +60,7 @@
<script>
import { offiInfo, offiEdit } from '@/api/setting-wechat'
import { getAdminUserId, getAdminToken } from '@/utils/auth'
import { getAdminToken } from '@/utils/auth'
export default {
components: {},
@ -85,7 +85,7 @@ export default {
qrcode_url: ''
},
uploadAction: process.env.VUE_APP_BASE_API + '/admin/SettingWechat/qrcode',
uploadHeaders: { AdminUserId: getAdminUserId(), AdminToken: getAdminToken() },
uploadHeaders: { AdminToken: getAdminToken() },
uploadData: { type: 'offi' },
rules: {
appid: [{ required: true, message: '请输入appid', trigger: 'blur' }],

View File

@ -2,16 +2,17 @@
<div class="app-container">
<el-tabs v-model="actTabName" @tab-click="tabClick">
<el-tab-pane v-if="checkPermission(['admin/SettingWechat/offiInfo'])" label="公众号" name="WechatOffi">
<wechat-offi v-if="WechatOffi" />
<WechatOffi v-if="WechatOffi" class="dialog-body" :style="{height:height+50+'px'}" />
</el-tab-pane>
<el-tab-pane v-if="checkPermission(['admin/SettingWechat/miniInfo'])" label="小程序" name="WechatMini">
<wechat-mini v-if="WechatMini" />
<WechatMini v-if="WechatMini" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import screenHeight from '@/utils/screen-height'
import checkPermission from '@/utils/permission' //
import WechatOffi from './components/WechatOffi'
import WechatMini from './components/WechatMini'
@ -26,7 +27,9 @@ export default {
actTabName: 'WechatOffi'
}
},
created() { },
created() {
this.height = screenHeight()
},
methods: {
checkPermission,
tabClick(tab) {

View File

@ -16,6 +16,8 @@ const name = defaultSettings.title || 'yylAdmin' // 页面标题
const port = process.env.port || process.env.npm_config_port || 9527 // 开发端口
// 所有配置项说明都可以在这里找到https://cli.vuejs.org/config/
const publicPath = process.env.VUE_APP_PUBLICPATH ? process.env.VUE_APP_PUBLICPATH : '/'
const outputDir = process.env.VUE_APP_OUTPUTDIR ? process.env.VUE_APP_OUTPUTDIR : 'dist'
module.exports = {
/**
* 如果计划在子路径下部署站点则需要设置publicPath
@ -24,8 +26,8 @@ module.exports = {
* 在大多数情况下请使用/
* 详细信息https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
outputDir: 'dist',
publicPath: publicPath,
outputDir: outputDir,
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,