no message
This commit is contained in:
parent
ce4912273c
commit
01eeb6db39
@ -5,6 +5,8 @@ const APP_CONFIG = {
|
||||
APP_NAME: "寄托天下",
|
||||
//主题设置
|
||||
THEMESETTING: false,
|
||||
// Cookie name
|
||||
SESSIONNAME: 'miucms_session',
|
||||
// 主题页头
|
||||
// THEMEHEADER: false,
|
||||
//布局 默认:default | 通栏:header | 经典:menu | 功能坞:dock
|
||||
|
15
src/api/model/app.js
Normal file
15
src/api/model/app.js
Normal file
@ -0,0 +1,15 @@
|
||||
import http from "@/utils/request"
|
||||
export default {
|
||||
index: {
|
||||
get: async function() {
|
||||
return await http.get('/system/index');
|
||||
}
|
||||
},
|
||||
table: {
|
||||
get: async function(name = '', config = {}) {
|
||||
return await http.get('/system/table/get', {
|
||||
name
|
||||
}, config);
|
||||
}
|
||||
},
|
||||
}
|
@ -1,10 +1,8 @@
|
||||
import http from "@/utils/request"
|
||||
export default {
|
||||
token: {
|
||||
url: `/api/login`,
|
||||
name: "登录获取TOKEN",
|
||||
post: async function(data={}){
|
||||
return await http.post(this.url, data);
|
||||
}
|
||||
}
|
||||
token: {
|
||||
post: async function(data = {}) {
|
||||
return await http.post('/api/login', data);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,48 +1,13 @@
|
||||
import http from "@/utils/request"
|
||||
|
||||
export default {
|
||||
upload: {
|
||||
url: `/app/upload`,
|
||||
name: "文件上传",
|
||||
post: async function(data, config={}){
|
||||
return await http.post(this.url, data, config);
|
||||
}
|
||||
},
|
||||
uploadFile: {
|
||||
url: `/app/upload?type=file`,
|
||||
name: "附件上传",
|
||||
post: async function(data, config={}){
|
||||
return await http.post(this.url, data, config);
|
||||
}
|
||||
},
|
||||
exportFile: {
|
||||
url: `/fileExport`,
|
||||
name: "导出附件",
|
||||
get: async function(data, config={}){
|
||||
return await http.get(this.url, data, config);
|
||||
}
|
||||
},
|
||||
importFile: {
|
||||
url: `/fileImport`,
|
||||
name: "导入附件",
|
||||
post: async function(data, config={}){
|
||||
return await http.post(this.url, data, config);
|
||||
}
|
||||
},
|
||||
file: {
|
||||
menu: {
|
||||
url: `/file/menu`,
|
||||
name: "获取文件分类",
|
||||
get: async function(){
|
||||
return await http.get(this.url);
|
||||
}
|
||||
},
|
||||
list: {
|
||||
url: `/file/list`,
|
||||
name: "获取文件列表",
|
||||
get: async function(params){
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
upload: {
|
||||
post: async function(data, config = {}) {
|
||||
return await http.post('/app/upload', data, config);
|
||||
}
|
||||
},
|
||||
uploadFile: {
|
||||
post: async function(data, config = {}) {
|
||||
return await http.post('/app/upload?type=file', data, config);
|
||||
}
|
||||
},
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
import http from "@/utils/request"
|
||||
|
||||
export default {
|
||||
ver: {
|
||||
url: `/demo/ver`,
|
||||
name: "获取最新版本号",
|
||||
get: async function(params){
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
},
|
||||
post: {
|
||||
url: `/demo/post`,
|
||||
name: "分页列表",
|
||||
post: async function(data){
|
||||
return await http.post(this.url, data, {
|
||||
headers: {
|
||||
//'response-status': 401
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
page: {
|
||||
url: `/demo/page`,
|
||||
name: "分页列表",
|
||||
get: async function(params){
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
},
|
||||
list: {
|
||||
url: `/demo/list`,
|
||||
name: "数据列表",
|
||||
get: async function(params){
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
},
|
||||
menu: {
|
||||
url: `/demo/menu`,
|
||||
name: "普通用户菜单",
|
||||
get: async function(){
|
||||
return await http.get(this.url);
|
||||
}
|
||||
},
|
||||
status: {
|
||||
url: `/demo/status`,
|
||||
name: "模拟无权限",
|
||||
get: async function(code){
|
||||
return await http.get(this.url, {}, {
|
||||
headers: {
|
||||
"response-status": code
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -5,97 +5,11 @@ export default {
|
||||
return await http.get('/system/index');
|
||||
}
|
||||
},
|
||||
dic: {
|
||||
tree: {
|
||||
url: `/system/dic/tree`,
|
||||
name: "获取字典树",
|
||||
get: async function() {
|
||||
return await http.get(this.url);
|
||||
}
|
||||
},
|
||||
list: {
|
||||
url: `/system/dic/lists`,
|
||||
name: "字典明细",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
},
|
||||
get: {
|
||||
url: `/system/dic/get`,
|
||||
name: "获取字典数据",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
role: {
|
||||
list: {
|
||||
url: `/system/role/list2`,
|
||||
name: "获取角色列表",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
dept: {
|
||||
list: {
|
||||
url: `/system/dept/lists`,
|
||||
name: "获取部门列表",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
user: {
|
||||
list: {
|
||||
url: `/system/user/lists`,
|
||||
name: "获取用户列表",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
app: {
|
||||
list: {
|
||||
url: `/system/app/lists`,
|
||||
name: "应用列表",
|
||||
get: async function() {
|
||||
return await http.get(this.url);
|
||||
}
|
||||
}
|
||||
},
|
||||
log: {
|
||||
list: {
|
||||
url: `/system/log/lists`,
|
||||
name: "日志列表",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
},
|
||||
table: {
|
||||
list: {
|
||||
url: `/system/table/lists`,
|
||||
name: "表格列管理列表",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
},
|
||||
info: {
|
||||
url: `/system/table/info`,
|
||||
name: "表格列管理详情",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
get: async function(name = '', config = {}) {
|
||||
return await http.get('/system/table/get', {
|
||||
name
|
||||
}, config);
|
||||
}
|
||||
},
|
||||
tasks: {
|
||||
list: {
|
||||
url: `/system/tasks/lists`,
|
||||
name: "系统任务管理",
|
||||
get: async function(params) {
|
||||
return await http.get(this.url, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -95,7 +95,7 @@
|
||||
</el-link>
|
||||
</template>
|
||||
<template v-else-if="item.component=='formtable'">
|
||||
<sc-form-table ref="videostable" v-bind="item.options"> </sc-form-table>
|
||||
<sc-form-table ref="videostable" v-model="data[item.name]" v-bind="item.options"> </sc-form-table>
|
||||
</template>
|
||||
<!-- noComponent -->
|
||||
<template v-else>
|
||||
|
40
src/components/xUpdate/index.vue
Normal file
40
src/components/xUpdate/index.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<!--
|
||||
* @Descripttion: 编辑
|
||||
-->
|
||||
<template>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding:0 20px 20px 20px">
|
||||
<sc-form ref="formref" :config="config" v-model="data" :loading="loading"> </sc-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible=false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
modelValue: { type: Object, default: () => {} },
|
||||
config: { type: Object, default: () => {} },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
data: this.modelValue,
|
||||
isSaveing: false
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
modelValue(){
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.data = this.modelValue
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
@ -26,6 +26,9 @@ const DEFAULT_CONFIG = {
|
||||
//TokenName
|
||||
TOKEN_NAME: "Authorization",
|
||||
|
||||
// Cookie Name
|
||||
SESSIONNAME: "X-PHPSSESSION",
|
||||
|
||||
//Token前缀,注意最后有个空格,如不需要需设置空字符串
|
||||
TOKEN_PREFIX: "",
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import API from "@/api";
|
||||
// import API from "@/api";
|
||||
|
||||
//字典选择器配置
|
||||
|
||||
export default {
|
||||
dicApiObj: API.system.dic.get, //获取字典接口对象
|
||||
// dicApiObj: API.system.dic.get, //获取字典接口对象
|
||||
parseData: function (res) {
|
||||
return {
|
||||
data: res.data, //分析行数据字段结构
|
||||
|
@ -39,7 +39,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start()
|
||||
//动态标题
|
||||
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}`
|
||||
let token = tool.cookie.get('X-PHPSSESSION');
|
||||
let token = tool.cookie.get(config.SESSIONNAME);
|
||||
if (to.path === "/login") {
|
||||
//删除路由(替换当前layout路由)
|
||||
router.addRoute(routes[0])
|
||||
|
@ -11,7 +11,7 @@ axios.defaults.timeout = sysConfig.TIMEOUT
|
||||
// HTTP request 拦截器
|
||||
axios.interceptors.request.use(
|
||||
(config) => {
|
||||
let token = tool.cookie.get('X-PHPSSESSION');
|
||||
let token = tool.cookie.get(sysConfig.SESSIONNAME);
|
||||
if (token) {
|
||||
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
|
||||
}
|
||||
@ -59,7 +59,9 @@ axios.interceptors.response.use(
|
||||
}).then(() => {
|
||||
router.replace({
|
||||
path: '/login',
|
||||
query: { redirect: router.currentRoute.fullPath }
|
||||
query: {
|
||||
redirect: router.currentRoute.fullPath
|
||||
}
|
||||
});
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
@ -212,15 +212,8 @@
|
||||
this.selection = selection;
|
||||
},
|
||||
//本地更新数据
|
||||
async handleSuccess(data, o){
|
||||
|
||||
var res = await api.post('attachmentSubmit', data)
|
||||
if (res.code==200) {
|
||||
o.close();
|
||||
this.$message.success("操作成功")
|
||||
return ;
|
||||
}
|
||||
this.$alert(res.message, "提示", {type: 'error'})
|
||||
async handleSuccess(){
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@
|
||||
var res = await api.post('submit', {info:this.info,id:this.id,token:this.token})
|
||||
if (res.code==200) {
|
||||
this.close();
|
||||
this.$emit('success', this.info, this.mode);
|
||||
this.$message.success("操作成功")
|
||||
return ;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@
|
||||
return false
|
||||
}
|
||||
|
||||
this.$tool.cookie.set('X-PHPSSESSION', user.data.token, {
|
||||
this.$tool.cookie.set(this.$config.SESSIONNAME, user.data.token, {
|
||||
expires: 86400*360
|
||||
})
|
||||
|
||||
|
@ -107,7 +107,7 @@
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
this.$tool.cookie.remove('X-PHPSSESSION')
|
||||
this.$tool.cookie.remove(this.$config.SESSIONNAME)
|
||||
this.$tool.data.remove("user")
|
||||
this.$tool.data.remove("menu")
|
||||
this.$tool.data.remove("permissions")
|
||||
@ -144,7 +144,7 @@
|
||||
}else if(res.code==200){
|
||||
|
||||
this.showWechatLogin = false
|
||||
this.$tool.cookie.set('X-PHPSSESSION', res.data.token, {
|
||||
this.$tool.cookie.set(this.$config.SESSIONNAME, res.data.token, {
|
||||
expires: 86400*360
|
||||
})
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
||||
loaddata(){
|
||||
//判断是否开启自定义列
|
||||
if(this.statName) {
|
||||
this.$http.get('system/stat/get', { name: this.statName,date:this.date }).then((res) => {
|
||||
this.$http.get('app/stat/get', { name: this.statName,date:this.date }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
Object.assign(this.$data, res.data);
|
||||
this.dateType = '';
|
||||
|
@ -100,7 +100,7 @@
|
||||
mounted() {
|
||||
//判断是否开启自定义列
|
||||
if(this.$route.meta.tablename) {
|
||||
this.$http.get('system/table/get', { name: this.$route.meta.tablename }, { cache: this.$route.meta.tablecache || 0 }).then((res) => {
|
||||
this.$api.system.table.get(this.$route.meta.tablename, { cache: this.$route.meta.tablecache || 0 }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
Object.assign(this.$data, res.data);
|
||||
}
|
||||
|
@ -1,14 +1,6 @@
|
||||
<template>
|
||||
<el-drawer :title="titleMap[mode]" v-model="visible" :size="960" destroy-on-close @closed="$emit('closed')">
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding:0 20px 20px 20px">
|
||||
<sc-form ref="formref" :config="config" v-model="info" :loading="loading"> </sc-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible=false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
<x-update v-model="info" :config="config"></x-update>
|
||||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
@ -26,6 +18,12 @@
|
||||
edit: '编辑'
|
||||
},
|
||||
info: {},
|
||||
config: {
|
||||
formItems : this.column,
|
||||
labelPosition : "right",
|
||||
labelWidth : "120px",
|
||||
size : "medium",
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
}
|
||||
@ -36,12 +34,12 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.config = {
|
||||
formItems : this.column,
|
||||
labelPosition : "right",
|
||||
labelWidth : "120px",
|
||||
size : "medium",
|
||||
}
|
||||
// this.config = {
|
||||
// formItems : this.column,
|
||||
// labelPosition : "right",
|
||||
// labelWidth : "120px",
|
||||
// size : "medium",
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
|
2
src/x.js
2
src/x.js
@ -20,6 +20,7 @@ import xDialog from './components/xDialog'
|
||||
import scForm from './components/scForm'
|
||||
import XItem from './components/scForm/item'
|
||||
import xUser from './components/xUser'
|
||||
import xUpdate from './components/xUpdate'
|
||||
import scTitle from './components/scTitle'
|
||||
import scWaterMark from './components/scWaterMark'
|
||||
import scQrCode from './components/scQrCode'
|
||||
@ -46,6 +47,7 @@ export default {
|
||||
//注册全局组件
|
||||
app.component('XItem', XItem);
|
||||
app.component('xUser', xUser);
|
||||
app.component('xUpdate', xUpdate);
|
||||
app.component('scTable', scTable);
|
||||
app.component('scTableColumn', scTableColumn);
|
||||
app.component('scFilterBar', scFilterBar);
|
||||
|
Loading…
Reference in New Issue
Block a user