Commit a45ee0d4 authored by 罗超's avatar 罗超

初始化项目

parent 1ed0205b
Pipeline #85 canceled with stages
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
/dist
/src-bex/www
/src-capacitor
/src-cordova
/.quasar
/node_modules
module.exports = {
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
// This option interrupts the configuration hierarchy at this file
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
root: true,
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},
env: {
browser: true
},
// Rules order is important, please avoid shuffling them
extends: [
// Base ESLint recommended rules
// 'eslint:recommended',
// Uncomment any of the lines below to choose desired strictness,
// but leave only one uncommented!
// See https://eslint.vuejs.org/rules/#available-rules
'plugin:vue/essential', // Priority A: Essential (Error Prevention)
// 'plugin:vue/strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
// 'plugin:vue/recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
'standard'
],
plugins: [
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
// required to lint *.vue files
'vue',
],
globals: {
ga: true, // Google Analytics
cordova: true,
__statics: true,
process: true,
Capacitor: true,
chrome: true
},
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow paren-less arrow functions
'arrow-parens': 'off',
'one-var': 'off',
'import/first': 'off',
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'prefer-promise-reject-errors': 'off',
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
.DS_Store
.thumbs.db
node_modules
# Quasar core related directories
.quasar
/dist
# Cordova related directories and files
/src-cordova/node_modules
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www
# Capacitor related directories and files
/src-capacitor/www
/src-capacitor/node_modules
# BEX related directories and files
/src-bex/www
/src-bex/js/core
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
yarn.lock
package-lock.json
.vscode/
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: [
// to edit target browsers: use "browserslist" field in package.json
require('autoprefixer')
]
}
module.exports = {
presets: [
'@quasar/babel-preset-app'
]
}
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"src/*": [
"src/*"
],
"app/*": [
"*"
],
"components/*": [
"src/components/*"
],
"layouts/*": [
"src/layouts/*"
],
"pages/*": [
"src/pages/*"
],
"assets/*": [
"src/assets/*"
],
"boot/*": [
"src/boot/*"
],
"vue$": [
"node_modules/vue/dist/vue.esm.js"
]
}
},
"exclude": [
"dist",
".quasar",
"node_modules"
]
}
\ No newline at end of file
{
"name": "minister",
"version": "0.0.1",
"description": "jiahe japen school system",
"productName": "甲鹤教育集团",
"author": "alex",
"private": true,
"scripts": {
"lint": "eslint --ext .js,.vue ./",
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"@quasar/extras": "^1.0.0",
"@riophae/vue-treeselect": "^0.4.0",
"ali-oss": "^6.12.0",
"axios": "^0.18.1",
"co": "^4.6.0",
"core-js": "^3.6.5",
"cos-js-sdk-v5": "^1.1.5",
"element-ui": "^2.14.1",
"html2canvas": "^1.0.0-rc.7",
"js-md5": "^0.7.3",
"lockr": "^0.8.5",
"mavon-editor": "^2.9.1",
"quasar": "^1.0.0",
"relation-graph": "^1.0.8",
"v-viewer": "^1.5.1",
"vue-i18n": "^8.0.0",
"vue-inline-svg": "^2.0.0"
},
"devDependencies": {
"@quasar/app": "^2.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.1.2"
},
"browserslist": [
"ie >= 11",
"last 10 Chrome versions",
"last 10 Firefox versions",
"last 4 Edge versions",
"last 7 Safari versions",
"last 8 Android versions",
"last 8 ChromeAndroid versions",
"last 8 FirefoxAndroid versions",
"last 10 iOS versions",
"last 5 Opera versions"
],
"engines": {
"node": ">= 10.18.1",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}
/*
* This file runs in a Node context (it's NOT transpiled by Babel), so use only
* the ES6 features that are supported by your Node version. https://node.green/
*/
// Configuration for your app
// https://quasar.dev/quasar-cli/quasar-conf-js
/* eslint-env node */
module.exports = function (ctx) {
return {
// https://quasar.dev/quasar-cli/supporting-ts
supportTS: false,
// https://quasar.dev/quasar-cli/prefetch-feature
// preFetch: true,
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://quasar.dev/quasar-cli/boot-files
boot: [
'i18n',
'axios',
'permission',
'inline-svg'
],
// https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
css: [
'app.sass'
],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
// 'ionicons-v4',
// 'mdi-v5',
// 'fontawesome-v5',
// 'eva-icons',
// 'themify',
// 'line-awesome',
// 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
'roboto-font', // optional, you are not bound to it
'material-icons' // optional, you are not bound to it
],
// Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
build: {
vueRouterMode: 'hash', // available values: 'hash', 'history'
env: ctx.dev ? {
API: 'http://192.168.1.13:8085/api'
} : {
API: 'http://eduapi.oytour.com/api'
},
// transpile: false,
// Add dependencies for transpiling with Babel (Array of string/regex)
// (from node_modules, which are by default not transpiled).
// Applies only if "transpile" is set to true.
// transpileDependencies: [],
// rtl: false, // https://quasar.dev/options/rtl-support
// preloadChunks: true,
// showProgress: false,
// gzip: true,
// analyze: true,
// Options below are automatically set depending on the env, set them if you want to override
// extractCSS: false,
// https://quasar.dev/quasar-cli/handling-webpack
extendWebpack(cfg) {
// cfg.module.rules.push({
// enforce: 'pre',
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// exclude: /node_modules/
// })
}
},
// Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
devServer: {
https: false,
port: 8181,
open: true // opens browser window automatically
},
// https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
framework: {
iconSet: 'material-icons', // Quasar icon set
lang: 'en-us', // Quasar language pack
config: {},
// Possible values for "importStrategy":
// * 'auto' - (DEFAULT) Auto-import needed Quasar components & directives
// * 'all' - Manually specify what to import
importStrategy: 'auto',
// For special cases outside of where "auto" importStrategy can have an impact
// (like functional components as one of the examples),
// you can manually specify Quasar components/directives to be available everywhere:
//
components: [
'QLayout',
'QHeader',
'QDrawer',
'QPageContainer',
'QPage',
'QToolbar',
'QToolbarTitle',
'QBtn',
'QIcon',
'QList',
'QItem',
'QItemSection',
'QItemLabel',
'QTabs',
'QRouteTab',
'QAvatar',
'QBtnDropdown',
'QFooter',
'QMenu',
'QCarousel',
'QCarouselControl',
'QCarouselSlide',
'QInput',
'QDate',
'QPopupProxy',
'QBanner',
'QSeparator',
'QChip',
'QTab',
'QSelect',
'QVideo',
'QImg',
'QResizeObserver',
'QMarkupTable',
'QForm',
'QTable',
'QTh',
'QTr',
'QTd',
'QCard',
'QCheckbox',
'QTree',
'QOptionGroup',
'QRadio',
'QBtnGroup'
],
// directives: [],
// Quasar plugins
plugins: [
'Meta',
'Notify',
'Dialog',
'LoadingBar'
]
},
// animations: 'all', // --- includes all animations
// https://quasar.dev/options/animations
animations: [],
// https://quasar.dev/quasar-cli/developing-ssr/configuring-ssr
ssr: {
pwa: false
},
// https://quasar.dev/quasar-cli/developing-pwa/configuring-pwa
pwa: {
workboxPluginMode: 'GenerateSW', // 'GenerateSW' or 'InjectManifest'
workboxOptions: {}, // only for GenerateSW
manifest: {
name: 'com.viitto.confuius',
short_name: 'com.viitto.confuius',
description: 'jiahe japen school system',
display: 'standalone',
orientation: 'portrait',
background_color: '#ffffff',
theme_color: '#027be3',
icons: [{
src: 'icons/icon-128x128.png',
sizes: '128x128',
type: 'image/png'
},
{
src: 'icons/icon-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'icons/icon-256x256.png',
sizes: '256x256',
type: 'image/png'
},
{
src: 'icons/icon-384x384.png',
sizes: '384x384',
type: 'image/png'
},
{
src: 'icons/icon-512x512.png',
sizes: '512x512',
type: 'image/png'
}
]
}
},
// Full list of options: https://quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
cordova: {
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
},
// Full list of options: https://quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
capacitor: {
hideSplashscreen: true
},
// Full list of options: https://quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
electron: {
bundler: 'packager', // 'packager' or 'builder'
packager: {
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign: '',
// protocol: 'myapp://path',
// Windows only
// win32metadata: { ... }
},
builder: {
// https://www.electron.build/configuration/configuration
appId: 'confucius'
},
// More info: https://quasar.dev/quasar-cli/developing-electron-apps/node-integration
nodeIntegration: true,
extendWebpack( /* cfg */ ) {
// do something with Electron main process Webpack cfg
// chainWebpack also available besides this extendWebpack
}
}
}
}
<template>
<div id="q-app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_fnioszx4oyw.css');
html,
body,
#q-app {
min-height: 100vh;
min-width: 100%;
-webkit-font-smoothing: antialiased;
font-family: -apple-system,BlinkMacSystemFont,'pingfang','Microsoft YaHei',"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
color: #3f4254;
}
</style>
/**
登录数据访问层,用户接口不能通过页面直接调用,先注入Store全局管理
*/
import request from '../utils/request'
export function login({ Account, Password }) {
// headers: {
// 'Content-Type': 'application/json;charset=UTF-8'
// }, 申明Headers信息,不包含token ,token通过注入添加
return request({
url: '/login/login',
method: "post",
// header,
data: {
Account,
Password,
AccountType: 1
}
});
}
export function getInfo(token) {
return request({
url: '/user/info',
method: 'get',
data: {}
})
}
export function logout() {
return request({
url: '/logout',
method: 'post',
data: {}
})
}
\ No newline at end of file
import request from '../utils/request'
/**
* 获取学校分页列表
*
*/
export function TestApi(cmdStr,data) {
return request({
url: cmdStr,
method: 'post',
data
})
}
\ No newline at end of file
import request from '../../utils/request'
/**
* 重置用户密码信息
*/
export function resetPassword(data) {
//参数信息AccountType AccountId
return request({
url: '/user/ResetUserPassword',
method: 'post',
data
})
}
/**
* 获取员工列表
* @param {查询参数} data
*/
export function queryEmployee(data)
{
return request({
url: '/user/GetEmployeeList',
method: 'post',
data
})
}
/**
* 修改离职信息
* @param {查询参数} data
*/
export function UpdateEmployeeLeave(data)
{
return request({
url: '/User/UpdateEmployeeLeaveTime',
method: 'post',
data
})
}
/**
* 修改部门
* @param {查询参数} data
*/
export function UpdateEmployeeDept(data)
{
return request({
url: '/User/UpdateEmployeeDept',
method: 'post',
data
})
}
/**
* 修改岗位
* @param {查询参数} data
*/
export function UpdateEmployeePost(data)
{
return request({
url: '/User/UpdateEmployeePost',
method: 'post',
data
})
}
/**
* 重置密码
* @param {查询参数} data
*/
export function BatchResetUserPassword(data)
{
return request({
url: '/User/BatchResetUserPassword',
method: 'post',
data
})
}
/**
* 获取部门Id
*/
export function getEmployeeAddrBook(data)
{
return request({
url: '/User/GetEmployeeAddrBook',
method: 'post',
data
})
}
/* @font-face {
font-family: 'pingfang';
src: url('../font/PingFang2.ttf');
} */
@font-face {
font-family: 'pingfang';
src: url('../font/PingFangMedium.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'pingfang-b';
src: url('../font/PingFangBold.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.pingfang-b{
font-family: 'pingfang-b';
}
\ No newline at end of file
This diff is collapsed.
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Erpindex from '../utils/erpindex'
import axios from 'axios'
import 'vue-easytable/libs/themes-base/index.css'
import {VTable,VPagination} from 'vue-easytable'
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer' //权限编码JS
Vue.http = Vue.prototype.$http = axios
// 时间扩展格式化
Date.prototype.Format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds() //秒
};
if (/(y+)/.test(fmt)){ //根据y的长度来截取年
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o){
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
return fmt;
};
Vue.use(ElementUI)
Vue.use(Erpindex)
Vue.use(Viewer);
Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination)
Vue.prototype.$axios = axios
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import messages from 'src/i18n'
import '../../public/static/UE/ueditor.config.js'
import '../../public/static/UE/ueditor.all.js'
import '../../public/static/UE/lang/zh-cn/zh-cn.js'
import '../../public/static/UE/ueditor.parse.min.js'
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: 'zh-CN',
// fallbackLocale: 'en-us',
messages:{
'zh-CN': require('../i18n/zh-cn/index'), // 中文语言包
}
})
export default ({ app }) => {
// Set i18n instance on app
app.i18n = i18n
}
export { i18n }
import Vue from "vue";
import { InlineSvgPlugin } from "vue-inline-svg";
Vue.use(InlineSvgPlugin);
import router from "../router/index";
import store from "../store/index";
import { LoadingBar, Notify } from "quasar";
import { getAuth } from "../utils/auth"; // 验权
LoadingBar.setDefaults({
color: "primary",
size: "5px",
position: "bottom"
});
let loadAsyncRouter = false;
const whiteList = ["/login", "/"]; // 不重定向白名单
router.beforeEach((to, from, next) => {
localStorage.setItem("routerBefore", from.path);
LoadingBar.start();
/** 请求头包含授权信息 并且 页面必须授权 直接进入 */
if (getAuth()) {
//debugger;
// if (to.path === "/login" || to.path === "/") {
// next({
// path: "/index"
// });
// LoadingBar.stop();
// } else {
// if (!loadAsyncRouter) {
// // 判断当前用户是否获取权限
// loadAsyncRouter = true;
// if (store.getters.allAuth) {
// store.dispatch("GenerateRoutes", store.getters.allAuth).then(() => {
// // 根据auths权限生成可访问的路由表
// //router.addRoutes(store.getters.addRouters); // 动态添加可访问路由表
// if (to.path === "/404") {
// next({
// path: to.redirectedFrom || "/",
// replace: true
// });
// } else {
// next({
// ...to,
// replace: true
// });
// LoadingBar.stop();
// }
// });
// } else {
// store
// .dispatch("getAuth")
// .then(auths => {
// // 拉取user_info
// store.dispatch("GenerateRoutes", auths).then(() => {
// // 根据auths权限生成可访问的路由表
// router.addRoutes(store.getters.addRouters); // 动态添加可访问路由表
// if (to.path === "/404") {
// next({
// path: to.redirectedFrom || "/",
// replace: true
// });
// LoadingBar.stop();
// } else {
// next({
// ...to,
// replace: true
// });
// LoadingBar.stop();
// }
// });
// })
// .catch(err => {
// loadAsyncRouter = false;
// store.dispatch("LogOut").then(() => {
// Notify.create({
// icon: "error",
// color: "negative",
// message: err.msg || "获取用户信息失败",
// position: "top"
// });
// next({
// path: "/"
// });
// });
// });
// }
// } else {
// next();
// }
// next();
// }
next();
} else {
if (whiteList.indexOf(to.path) !== -1) {
next();
} else {
next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
LoadingBar.stop();
}
}
});
router.afterEach(() => {
LoadingBar.stop(); // 结束Progress
});
router.onError(error => {
const pattern = /Loading chunk (\d)+ failed/g;
const isChunkLoadFailed = error.message.match(pattern);
const targetPath = router.history.pending.fullPath;
if (isChunkLoadFailed) {
router.replace(targetPath);
}
});
\ No newline at end of file
<template>
<q-item
clickable
tag="a"
target="_blank"
:href="link"
>
<q-item-section
v-if="icon"
avatar
>
<q-icon :name="icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ title }}</q-item-label>
<q-item-label caption>
{{ caption }}
</q-item-label>
</q-item-section>
</q-item>
</template>
<script>
export default {
name: 'EssentialLink',
props: {
title: {
type: String,
required: true
},
caption: {
type: String,
default: ''
},
link: {
type: String,
default: '#'
},
icon: {
type: String,
default: ''
}
}
}
</script>
// app global css in Sass form
// Quasar Sass (& SCSS) Variables
// --------------------------------------------------
// To customize the look and feel of this app, you can override
// the Sass/SCSS variables found in Quasar's source Sass/SCSS files.
// Check documentation for full list of Quasar variables
// Your own variables (that are declared here) and Quasar's own
// ones will be available out of the box in your .vue/.scss/.sass files
// It's highly recommended to change the default colors
// to match your app's branding.
// Tip: Use the "Theme Builder" on Quasar's documentation website.3fc4ff
$primary : #2961fe
$secondary : #1bc5bd
$accent : #232125
$dark : #111
$positive : #21ba45
$negative : #f5576c
$info : #31CCEC
$warning : #F2C037
$infobg : #eeeeee
$infotwo : #1296db
\ No newline at end of file
// This is just an example,
// so you can safely delete all default props below
export default {
failed: 'Action failed',
success: 'Action was successful'
}
import enUS from './en-us'
export default {
'en-us': enUS
}
// This is just an example,
// so you can safely delete all default props below
export default {
failed: 'Action failed',
success: 'Action was successful'
}
<!DOCTYPE html>
<html>
<head>
<title><%= productName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="icon" type="image/ico" href="favicon.ico">
</head>
<body>
<!-- DO NOT touch the following DIV -->
<div id="q-app"></div>
</body>
</html>
<template>
<q-layout view="lHh Lpr lFf">
<!--<q-header elevated>
<q-toolbar>
<q-btn
flat
dense
round
icon="menu"
aria-label="Menu"
@click="leftDrawerOpen = !leftDrawerOpen"
/>
<q-toolbar-title>
Quasar App
</q-toolbar-title>
<div>Quasar v{{ $q.version }}</div>
</q-toolbar>
</q-header>
<q-drawer
v-model="leftDrawerOpen"
show-if-above
bordered
content-class="bg-grey-1"
>
<q-list>
<q-item-label
header
class="text-grey-8"
>
Essential Links
</q-item-label>
<EssentialLink
v-for="link in essentialLinks"
:key="link.title"
v-bind="link"
/>
</q-list>
</q-drawer>-->
<q-page-container>
<router-view />
</q-page-container>
</q-layout>
</template>
<script>
import EssentialLink from 'components/EssentialLink.vue'
const linksData = [
{
title: 'Docs',
caption: 'quasar.dev',
icon: 'school',
link: 'https://quasar.dev'
},
{
title: 'Github',
caption: 'github.com/quasarframework',
icon: 'code',
link: 'https://github.com/quasarframework'
},
{
title: 'Discord Chat Channel',
caption: 'chat.quasar.dev',
icon: 'chat',
link: 'https://chat.quasar.dev'
},
{
title: 'Forum',
caption: 'forum.quasar.dev',
icon: 'record_voice_over',
link: 'https://forum.quasar.dev'
},
{
title: 'Twitter',
caption: '@quasarframework',
icon: 'rss_feed',
link: 'https://twitter.quasar.dev'
},
{
title: 'Facebook',
caption: '@QuasarFramework',
icon: 'public',
link: 'https://facebook.quasar.dev'
},
{
title: 'Quasar Awesome',
caption: 'Community Quasar projects',
icon: 'favorite',
link: 'https://awesome.quasar.dev'
}
];
export default {
name: 'MainLayout',
components: { EssentialLink },
data () {
return {
leftDrawerOpen: false,
essentialLinks: linksData
}
}
}
</script>
<template>
<div class="fullscreen bg-blue text-white text-center q-pa-md flex flex-center">
<div>
<div style="font-size: 30vh">
404
</div>
<div class="text-h2" style="opacity:.4">
Oops. Nothing here...
</div>
<q-btn
class="q-mt-xl"
color="white"
text-color="blue"
unelevated
to="/"
label="Go Home"
no-caps
/>
</div>
</div>
</template>
<script>
export default {
name: 'Error404'
}
</script>
<template>
<div class="jiahe">
<div class="jnavs absolute-top-left">
<div class="row items-center full-height">
<div class="col">
<img style="height:61px" src="../assets/images/logo.png" />
</div>
<div class="col">
<q-tabs
v-model="tab"
class="text-dark"
active-color="dark"
align="justify"
narrow-indicator
dense
>
<q-tab name="home" label="甲鹤教育" content-class="items-nav" />
<q-tab name="japan" label="日语培训" content-class="items-nav" />
<q-tab name="liuxue" label="留学服务" content-class="items-nav" />
<q-tab name="jiuye" label="就业服务" content-class="items-nav" />
<q-tab name="news" label="媒体中心" content-class="items-nav" />
<q-tab name="about" label="关于我们" content-class="items-nav" />
<q-tab name="join" label="加入我们" content-class="items-nav" />
</q-tabs>
</div>
</div>
</div>
<div class="relative-position banner-box">
<div class="absolute-top-left fit bg-dark">
<q-carousel
v-model="slide"
swipeable
animated
navigation-position="right"
navigation
height="100%"
infinite
>
<q-carousel-slide name="first" img-src="../assets/images/banner.png"/>
</q-carousel>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PageIndex',
data() {
return {
slide:"first",
tab:"home"
}
},
}
</script>
<style>
.jiahe{
height:100vh
}
.jiahe .banner-box{
width:100%;padding-top:57.39%
}
.jiahe .jnavs{
margin-top:61px;
height: 61px;
z-index: 1;
left:58px;
right: 58px;
}
.jiahe .jnavs .items-nav .q-tab__label{
font-size: 16px !important;
font-family: 'pingfang-b' !important;
}
</style>
\ No newline at end of file
<template>
<div class="CMD">
<table class="cmdTable">
<thead>
<tr>
<td colspan="2">
&nbsp;&nbsp;请求参数
</td>
</tr>
<tr>
<td class="tdLeft">
命令:
</td>
<td class="tdRight">
<textarea :rows="1" :cols="50" v-model="ActionStr" placeholder="请输入命令"></textarea>
</td>
</tr>
<tr>
<td class="tdLeft">
参数列表:
</td>
<td class="tdRight">
<table class="parameterList">
<tr v-for="(item,index) in parameterList">
<td>
参数名:
</td>
<td>
<input type="text" v-model="item.Name" />
</td>
<td>
参数值:
</td>
<td>
<input type="text" v-model="item.Value" />
</td>
<td>
<a style="cursor:pointer;color:blue;" @click="AddParameter()">新增</a>&nbsp;
<a v-if="index!=0" style="cursor:pointer;color:red;" @click="DeleteParameter(index)">删除</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<input type="button" @click="Test()" value="执行" />
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;&nbsp;返回结果
</td>
</tr>
<tr>
<td class="tdLeft">
请求命令:
</td>
<td class="tdRight">
{{ActionStr}}
</td>
</tr>
<tr>
<td class="tdLeft">
请求参数:
</td>
<td class="tdRight">
{{ShowMsg}}
</td>
</tr>
<tr>
<td class="tdLeft">
返回结果:
</td>
<td class="tdRight">
{{Result}}
</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
import {
TestApi
} from '../api/testapi'
export default {
meta: {
title: '测试 - 麦子教育系统',
},
data() {
return {
ActionStr: "",
parameterList: [{
Name: "",
Value: ""
}],
ShowMsg: "",
Result: "",
};
},
created() {
},
mounted() {
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
methods: {
//新增参数
AddParameter() {
this.parameterList.push({
Name: "",
Value: ""
});
},
//删除参数
DeleteParameter(index) {
this.parameterList.splice(index, 1);
},
ClearMsg(str) {
//去掉空格
var result = str.replace(/\ +/g, "");
//去掉回车
result = result.replace(/[\r\n]/g, "");
return result;
},
Test() {
this.Result = "";
this.ShowMsg = "";
if (this.ActionStr && this.ActionStr != '') {
var data = {};
var tempStr = "";
if (this.parameterList && this.parameterList.length > 0) {
this.parameterList.forEach(item => {
if (item.Name && item.Name != '') {
tempStr += ',' + '"' + item.Name + '":"' + item.Value + '"';
}
})
}
if (tempStr && tempStr != '') {
tempStr = "{" + tempStr.substring(1, tempStr.length) + "}";
data = JSON.parse(tempStr);
}
var tempMsg = {
Msg: data
};
this.ShowMsg = JSON.parse(JSON.stringify(tempMsg));
TestApi(this.ActionStr, data).then(res => {
this.Result = JSON.stringify(res);
})
}
}
},
};
</script>
<style scoped>
.CMD {
background: #f5f6f7;
}
.CMD .cmdTable {
width: 100%;
max-width: 100%;
border-collapse: collapse;
border-spacing: 0;
}
.CMD .cmdTable tr td {
border: 1px solid rgba(0, 0, 0, 0.12);
line-height: 35px;
min-height: 35px;
}
.CMD .tdLeft {
width: 15%;
font-size: 14px;
font-weight: 400;
text-align: right;
padding-right: 20px;
}
.CMD .tdRight {
width: 70%;
font-size: 14px;
font-weight: 400;
}
.CMD .parameterList {
border: none;
border-collapse: collapse;
}
.CMD .parameterList tr td {
border: none;
border-collapse: collapse;
}
</style>
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
/*
* If not building with SSR mode, you can
* directly export the Router instantiation;
*
* The function below can be async too; either use
* async/await or return a Promise which resolves
* with the Router instance.
*/
// export default function (/* { store, ssrContext } */) {
// const Router = new VueRouter({
// scrollBehavior: () => ({ x: 0, y: 0 }),
// routes,
// // Leave these as they are and change in quasar.conf.js instead!
// // quasar.conf.js -> build -> vueRouterMode
// // quasar.conf.js -> build -> publicPath
// mode: process.env.VUE_ROUTER_MODE,
// base: process.env.VUE_ROUTER_BASE
// })
// return Router
// }
export default new VueRouter({
scrollBehavior: () => ({
x: 0,
y: 0
}),
routes,
// Leave these as they are and change in quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
// quasar.conf.js -> build -> publicPath
mode: process.env.VUE_ROUTER_MODE,
base: process.env.VUE_ROUTER_BASE
})
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
const routes = [
{
path: '/',
component: () => import('layouts/MainLayout.vue'),
children: [
{ path: '', component: () => import('pages/Index.vue') }
]
},
// Always leave this as last one,
// but you can also remove it
{
path: '*',
component: () => import('pages/Error404.vue')
}
]
export default routes
const getters = {
userInfo: state => state.user.userInfo,
logo: state => {
// if (state.app.name) {
// return state.app.name
// }
// return require('../assets/images/logo.png')
return ""
},
name: state => {
if (state.app.name) {
return state.app.name
}
return '甲鹤日语'
},
// 权限
allAuth: state => state.user.allAuth,
}
export default getters
\ No newline at end of file
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import permission from './modules/permission'
import app from './modules/app'
import getters from './getters'
Vue.use(Vuex)
// export default function( /* { ssrContext } */ ) {
// const Store = new Vuex.Store({
// modules: {
// // example
// user,
// permission
// },
// getters,
// // enable strict mode (adds overhead!)
// // for dev mode only
// })
// return Store
// }
const store = new Vuex.Store({
modules: {
user,
permission,
app
},
getters,
strict: process.env.DEV
})
export default store
\ No newline at end of file
export function someAction (/* context */) {
}
export function someGetter (/* state */) {
}
import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'
export default {
namespaced: true,
getters,
mutations,
actions,
state
}
export function someMutation (/* state */) {
}
export default function () {
return {
//
}
}
import Lockr from 'lockr'
/** 记录 侧边索引 */
const app = {
state: {
logo: '',
name: '',
currentNavs: 0
},
mutations: {
SET_APPLOGO: (state, logo) => {
state.logo = logo
},
SET_APPNAME: (state, name) => {
state.name = name
},
SET_CURRENTNAVS: (state, nav) => {
state.currentNavs = nav
}
},
actions: {
// 登录
SystemLogoAndName({
commit
}, { GroupName, GroupLogo }) {
commit('SET_APPNAME', GroupName)
commit('SET_APPLOGO', GroupLogo)
Lockr.set('systemLogo', GroupName)
Lockr.set('systemName', GroupLogo)
},
SystemNavsChange({ commit }, nav) {
commit('SET_CURRENTNAVS', nav)
}
}
}
export default app
\ No newline at end of file
import Vue from 'vue'
/**
*
* @param {*} router
* @param {*} authInfo
*/
function checkAuth(router, authInfo) {
// 判断当前路由在权限数组中是否存在
if (router.meta) {
const metaInfo = router.meta
if (!metaInfo.requiresAuth) {
return true
} else {
if (metaInfo.index == 0) {
return !!authInfo[metaInfo.type]
} else if (metaInfo.index == 1) {
if (authInfo[metaInfo.type]) {
return !!authInfo[metaInfo.type][metaInfo.subType]
}
return false
} else {
var typeAuth = authInfo[metaInfo.type]
for (let index = 0; index < metaInfo.subType.length; index++) {
const field = metaInfo.subType[index]
typeAuth = typeAuth[field]
if (typeAuth && metaInfo.subType.length - 1 == index) {
return true
} else if (!typeAuth) {
return false
}
}
}
}
}
return true
}
/**
*
* @param {*} routers
* @param {*} authInfo
*/
const filterAsyncRouter = function(routers, authInfo) {
const res = []
routers.forEach(router => {
const tmp = {
...router
}
if (checkAuth(tmp, authInfo)) {
if (tmp.children) {
tmp.children = filterAsyncRouter(tmp.children, authInfo)
}
res.push(tmp)
}
})
return res
}
const permission = {
state: {
addRouters: []
},
mutations: {
SET_ROUTERS: (state, routers) => {
state.addRouters = routers
}
},
actions: {
GenerateRoutes({
commit
}, data) {
return new Promise(resolve => {
// TODO 实现权限验证
resolve()
})
}
}
}
export default permission
\ No newline at end of file
import { login, logout } from "../../api/login";
// import { adminUsersRead } from "../../api/personCenter/personCenter";
import { addAuth, removeAuth } from "../../utils/auth";
import Lockr from "lockr";
const user = {
state: {
userInfo: null, // 用户信息
//TODO 用户权限
allAuth: ['/home', '/school/manager'],
actionList:[]
},
mutations: {
SET_USERINFO: (state, userInfo) => {
state.userInfo = userInfo;
},
SET_ALLAUTH: (state, allAuth) => {
state.allAuth = allAuth
}
//TODO 用户权限
},
actions: {
// 登录
Login({ commit }, userInfo) {
userInfo.Account = userInfo.Account.trim();
return new Promise((resolve, reject) => {
login(userInfo)
.then(data => {
let r = data.Data
let token = r.Token
delete r.Token
Lockr.set("Token", token);
Lockr.set("loginUserInfo", r);
//Lockr.set("authList", data.auth);
addAuth(token);
commit("SET_USERINFO", r);
// commit('SET_ALLAUTH', data.auth)
// TODO 完成登录 读取权限
resolve(data);
})
.catch(error => {
reject(error);
});
});
},
// 获取权限
getAuth({ commit }) {
return new Promise((resolve, reject) => {
//TODO 处理权限方法
});
},
// 获取用户信息
GetUserInfo({ commit, state }) {
return new Promise((resolve, reject) => {
// adminUsersRead()
// .then(response => {
// let r = response.Data
// delete r.Token
// commit("SET_USERINFO", r);
// resolve(response);
// })
// .catch(error => {
// reject(error);
// });
});
},
// 登出
LogOut({ commit }) {
return new Promise((resolve, reject) => {
// logout()
// .then(() => {
// /** flush 清空localStorage .rm('authKey') 按照key清除 */
// })
// .catch(error => {
// reject(error);
// });
removeAuth();
resolve();
});
}
}
};
export default user;
\ No newline at end of file
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
import "quasar/dist/types/feature-flag";
declare module "quasar/dist/types/feature-flag" {
interface QuasarFeatureFlags {
store: true;
}
}
import axios from 'axios'
import cache from './cache'
import Lockr from 'lockr'
import store from '../store'
/** 移除授权信息 */
export function removeAuth() {
return new Promise((resolve, reject) => {
cache.rmAxiosCache()
//store.commit('SET_ALLAUTH', null)
delete axios.defaults.headers['Token']
resolve(true)
})
}
/** 注入授权信息 */
export function addAuth(adminToken) {
return new Promise((resolve, reject) => {
axios.defaults.headers['Token'] = adminToken
resolve(true)
})
}
/** 获取授权信息 */
export function getAuth() {
if (Lockr.get('Token') && !axios.defaults.headers['Token']) {
cache.updateAxiosCache()
}
if (axios.defaults.headers['Token']) {
return true
}
return false
}
\ No newline at end of file
import store from '../store'
import Lockr from 'lockr'
import axios from 'axios'
const cache = {
/**
* 载入全部登陆信息
*/
loadingCache: function() {
if (Lockr.get('Token') && !axios.defaults.headers['Token']) {
/** 将用户信息放入缓存 */
const userInfo = Lockr.get('loginUserInfo')
if (userInfo) {
store.commit('SET_USERINFO', userInfo)
}
}
store.commit('SET_APPNAME', Lockr.get('systemName'))
store.commit('SET_APPLOGO', Lockr.get('systemLogo'))
store.dispatch('SystemLogoAndName')
},
/**
* 请求和更新登录缓存
*/
updateAxiosCache: function() {
axios.defaults.headers['Token'] = Lockr.get('Token')
//TODO 更新用户信息
store.dispatch('GetUserInfo')
},
/**
* 移除登录信息
* @param {*}
*/
rmAxiosCache: function() {
Lockr.rm('Token')
Lockr.rm('loginUserInfo')
}
}
export default cache
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
import Vue from 'vue'
export default new Vue;
\ No newline at end of file
import axios from "axios";
import {
removeAuth
} from "../utils/auth";
import qs from "qs";
import {
Dialog,
Notify
} from 'quasar'
var showLoginMessageBox = false;
axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8"; //application/x-www-form-urlencoded;charset=UTF-8
const service = axios.create({
baseURL: process.env.API,
timeout: 15000
});
// request拦截器
service.interceptors.request.use(
config => {
if (config.headers["responseType"] == "arraybuffer") {
config.responseType = "arraybuffer";
}
const flag =
config.headers["Content-Type"] &&
config.headers["Content-Type"].indexOf("application/json") !== -1;
if (!flag) {
const mult =
config.headers["Content-Type"] &&
config.headers["Content-Type"].indexOf("multipart/form-data") !== -1;
if (mult) {
config.data = config.data;
} else {
config.data = qs.stringify(config.data);
}
} else {
config.data = {
"Msg": config.data
}
}
return config;
},
error => {
//TODO 新增网络请求异常处理业务
return Promise.reject(error);
}
);
// response 拦截器
service.interceptors.response.use(
response => {
const res = response.data;
// TODO 确定后台的CODE码
if (response.status === 200 && response.config.responseType === "arraybuffer") {
// 文件类型特殊处理
return response;
} else if (res.Code != 1) {
// TODO 确定后台的CODE码
if (res.Code == 10000) {
if (!showLoginMessageBox) {
showLoginMessageBox = true;
Dialog.create({
title: "登出",
message: "抱歉,你的账户信息已失效,你需要重新登录使用",
persistent: true
}).onOk(() => {
removeAuth()
.then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
})
.catch(() => {
location.reload();
});
});
}
} else {
if (res.Message) {
Notify.create({
icon: "error",
color: "negative",
message: res.Message,
position: "top"
});
}
}
return Promise.reject(res);
} else {
return res;
}
},
error => {
Notify.create({
icon: "error",
color: "negative",
message: "网络请求失败,请稍候再试",
position: "top"
});
return Promise.reject(error);
}
);
export default service;
/**
* 类型判断工具
*/
export function isString(obj) {
return Object.prototype.toString.call(obj) === '[object String]'
}
export function isObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
export function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]'
}
\ No newline at end of file
/**
* 验证工具类
*/
/* 合法uri*/
export function validateURL(textval) {
const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return urlregex.test(textval)
}
/* 小写字母*/
export function validateLowerCase(str) {
const reg = /^[a-z]+$/
return reg.test(str)
}
/* 大写字母*/
export function validateUpperCase(str) {
const reg = /^[A-Z]+$/
return reg.test(str)
}
/* 大小写字母*/
export function validatAlphabets(str) {
const reg = /^[A-Za-z]+$/
return reg.test(str)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment