diff --git a/public/config.js b/public/config.js
index f3b1027..40b863a 100644
--- a/public/config.js
+++ b/public/config.js
@@ -5,6 +5,8 @@ const APP_CONFIG = {
APP_NAME: "寄托天下",
//主题设置
THEMESETTING: false,
+ // Cookie name
+ SESSIONNAME: 'miucms_session',
// 主题页头
// THEMEHEADER: false,
//布局 默认:default | 通栏:header | 经典:menu | 功能坞:dock
diff --git a/src/api/model/app.js b/src/api/model/app.js
new file mode 100644
index 0000000..86af86f
--- /dev/null
+++ b/src/api/model/app.js
@@ -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);
+ }
+ },
+}
\ No newline at end of file
diff --git a/src/api/model/auth.js b/src/api/model/auth.js
index 01a6616..94d943a 100644
--- a/src/api/model/auth.js
+++ b/src/api/model/auth.js
@@ -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);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/model/common.js b/src/api/model/common.js
index 2821f79..5648c05 100644
--- a/src/api/model/common.js
+++ b/src/api/model/common.js
@@ -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);
+ }
+ },
+}
\ No newline at end of file
diff --git a/src/api/model/demo.js b/src/api/model/demo.js
deleted file mode 100644
index 085dd5e..0000000
--- a/src/api/model/demo.js
+++ /dev/null
@@ -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
- }
- });
- }
- }
-}
diff --git a/src/api/model/system.js b/src/api/model/system.js
index 287fa00..86af86f 100644
--- a/src/api/model/system.js
+++ b/src/api/model/system.js
@@ -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);
- }
- }
- }
}
\ No newline at end of file
diff --git a/src/components/scForm/item.vue b/src/components/scForm/item.vue
index 33dd9b3..6f67c53 100644
--- a/src/components/scForm/item.vue
+++ b/src/components/scForm/item.vue
@@ -95,7 +95,7 @@
-
+
diff --git a/src/components/xUpdate/index.vue b/src/components/xUpdate/index.vue
new file mode 100644
index 0000000..bd3c9e0
--- /dev/null
+++ b/src/components/xUpdate/index.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+ 保存
+ 取消
+
+
+
+
+
\ No newline at end of file
diff --git a/src/config/index.js b/src/config/index.js
index 20971f1..f68c258 100644
--- a/src/config/index.js
+++ b/src/config/index.js
@@ -26,6 +26,9 @@ const DEFAULT_CONFIG = {
//TokenName
TOKEN_NAME: "Authorization",
+ // Cookie Name
+ SESSIONNAME: "X-PHPSSESSION",
+
//Token前缀,注意最后有个空格,如不需要需设置空字符串
TOKEN_PREFIX: "",
diff --git a/src/config/select.js b/src/config/select.js
index ce71587..a30de7e 100644
--- a/src/config/select.js
+++ b/src/config/select.js
@@ -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, //分析行数据字段结构
diff --git a/src/router/index.js b/src/router/index.js
index d6136e7..c1a1a6b 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -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])
diff --git a/src/utils/request.js b/src/utils/request.js
index 3b7c978..15799f9 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -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(() => {})
}
diff --git a/src/views/app/apartment/index.vue b/src/views/app/apartment/index.vue
index 5266480..ff3cc72 100644
--- a/src/views/app/apartment/index.vue
+++ b/src/views/app/apartment/index.vue
@@ -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()
}
}
}
diff --git a/src/views/app/apartment/update.vue b/src/views/app/apartment/update.vue
index 6321b68..1a1c557 100644
--- a/src/views/app/apartment/update.vue
+++ b/src/views/app/apartment/update.vue
@@ -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 ;
}
diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue
index 3470bc1..1fefc38 100644
--- a/src/views/login/components/passwordForm.vue
+++ b/src/views/login/components/passwordForm.vue
@@ -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
})
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index ab3f9c4..84ee333 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -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
})
diff --git a/src/views/system/stat/index.vue b/src/views/system/stat/index.vue
index 499d832..ec54520 100644
--- a/src/views/system/stat/index.vue
+++ b/src/views/system/stat/index.vue
@@ -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 = '';
diff --git a/src/views/system/table/index.vue b/src/views/system/table/index.vue
index 4c28d3e..5b5a9f5 100644
--- a/src/views/system/table/index.vue
+++ b/src/views/system/table/index.vue
@@ -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);
}
diff --git a/src/views/system/table/save.vue b/src/views/system/table/save.vue
index 2034843..3aad491 100644
--- a/src/views/system/table/save.vue
+++ b/src/views/system/table/save.vue
@@ -1,14 +1,6 @@
-
-
-
-
-
- 保存
- 取消
-
-
+