功能变化: 登录bug;消息中心配置
This commit is contained in:
@@ -5,6 +5,7 @@ from datetime import datetime, timedelta
|
||||
from captcha.views import CaptchaStore, captcha_image
|
||||
from django.contrib import auth
|
||||
from django.contrib.auth import login
|
||||
from django.contrib.auth.hashers import make_password, check_password
|
||||
from django.shortcuts import redirect
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from drf_yasg import openapi
|
||||
@@ -108,7 +109,7 @@ class LoginView(TokenObtainPairView):
|
||||
except:
|
||||
return DetailResponse(msg='该账号未注册')
|
||||
# 获得用户后,校验密码并签发token
|
||||
if not user.check_password(password):
|
||||
if check_password(password,user.password):
|
||||
return DetailResponse(msg='密码错误')
|
||||
result = {
|
||||
"name":user.name,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.0.10",
|
||||
"@fast-crud/fast-crud": "^1.9.0",
|
||||
"@fast-crud/fast-extends": "^1.9.0",
|
||||
"@fast-crud/ui-element": "^1.9.0",
|
||||
"@vitejs/plugin-vue-jsx": "^3.0.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
|
||||
@@ -6,7 +6,9 @@ import { setLogger } from '@fast-crud/fast-crud';
|
||||
// element
|
||||
import ui from '@fast-crud/ui-element';
|
||||
import { request } from '/@/utils/service';
|
||||
|
||||
//扩展包
|
||||
import {FsExtendsEditor} from "@fast-crud/fast-extends";
|
||||
import "@fast-crud/fast-extends/dist/style.css";
|
||||
export default {
|
||||
async install(app: any, options: any) {
|
||||
// 先安装ui
|
||||
@@ -52,6 +54,12 @@ export default {
|
||||
};
|
||||
},
|
||||
});
|
||||
//富文本
|
||||
app.use(FsExtendsEditor,{
|
||||
wangEditor:{
|
||||
width:300,
|
||||
}
|
||||
})
|
||||
setLogger({ level: 'error' });
|
||||
// 设置自动染色
|
||||
const dictComponentList = ['dict-cascader', 'dict-checkbox', 'dict-radio', 'dict-select', 'dict-switch', 'dict-tree'];
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { request } from '/@/utils/service';
|
||||
import { PageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
|
||||
|
||||
export const apiPrefix = '/api/system/dept/';
|
||||
export const apiPrefix = '/api/system/message_center/';
|
||||
export function GetList(query: PageQuery) {
|
||||
return request({
|
||||
url: apiPrefix,
|
||||
method: 'get',
|
||||
data: query,
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
export function GetObj(id: InfoReq) {
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
import * as api from "./api";
|
||||
import { dict, PageQuery, AddReq, DelReq, EditReq, CrudExpose, CrudOptions, } from "@fast-crud/fast-crud";
|
||||
import { request } from "/@/utils/service";
|
||||
import { dictionary } from "/@/utils/dictionary";
|
||||
import {dict, compute, PageQuery, AddReq, DelReq, EditReq, CrudExpose, CrudOptions,} from "@fast-crud/fast-crud";
|
||||
import {request} from "/@/utils/service";
|
||||
import {dictionary} from "/@/utils/dictionary";
|
||||
|
||||
interface CreateCrudOptionsTypes {
|
||||
crudOptions: CrudOptions;
|
||||
}
|
||||
|
||||
export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExpose }): CreateCrudOptionsTypes {
|
||||
export const createCrudOptions = function ({crudExpose}: { crudExpose: CrudExpose }): CreateCrudOptionsTypes {
|
||||
const pageRequest = async (query: PageQuery) => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
const editRequest = async ({ form, row }: EditReq) => {
|
||||
const editRequest = async ({form, row}: EditReq) => {
|
||||
form.id = row.id;
|
||||
return await api.UpdateObj(form);
|
||||
};
|
||||
const delRequest = async ({ row }: DelReq) => {
|
||||
const delRequest = async ({row}: DelReq) => {
|
||||
return await api.DelObj(row.id);
|
||||
};
|
||||
const addRequest = async ({ form }: AddReq) => {
|
||||
const addRequest = async ({form}: AddReq) => {
|
||||
return await api.AddObj(form);
|
||||
};
|
||||
return {
|
||||
@@ -31,7 +32,7 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
|
||||
columns: {
|
||||
_index: {
|
||||
title: '序号',
|
||||
form: { show: false },
|
||||
form: {show: false},
|
||||
column: {
|
||||
//type: 'index',
|
||||
align: 'center',
|
||||
@@ -45,6 +46,199 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
|
||||
},
|
||||
},
|
||||
},
|
||||
id: {
|
||||
title: 'id',
|
||||
form: {
|
||||
show:false
|
||||
}
|
||||
|
||||
},
|
||||
title: {
|
||||
title: '标题',
|
||||
search: {
|
||||
disabled: false
|
||||
},
|
||||
type: ["text", "colspan"],
|
||||
form: {
|
||||
rules: [ // 表单校验规则
|
||||
{
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
],
|
||||
component: {span: 24, placeholder: '请输入标题'}
|
||||
}
|
||||
},
|
||||
is_read: {
|
||||
title: '是否已读',
|
||||
type: 'dict-select',
|
||||
column:{
|
||||
show:false
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{label: '已读', value: true, color: 'success'},
|
||||
{label: '未读', value: false, color: 'danger'}
|
||||
]
|
||||
}),
|
||||
form: {
|
||||
show:false
|
||||
}
|
||||
},
|
||||
target_type: {
|
||||
title: '目标类型',
|
||||
type: ['dict-radio','colspan'],
|
||||
width: 120,
|
||||
// show() {
|
||||
// return vm.tabActivted === 'send'
|
||||
// },
|
||||
dict: dict({
|
||||
data: [{value: 0, label: '按用户'}, {value: 1, label: '按角色'}, {
|
||||
value: 2,
|
||||
label: '按部门'
|
||||
}, {value: 3, label: '通知公告'}]
|
||||
}),
|
||||
form: {
|
||||
component: {
|
||||
optionName: "el-radio-button"
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '必选项',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
target_user: {
|
||||
title: '目标用户',
|
||||
search: {
|
||||
disabled: true
|
||||
},
|
||||
width: 130,
|
||||
type: 'table-selector',
|
||||
disabled: true,
|
||||
dict: dict({
|
||||
cache: false,
|
||||
url: '/api/system/user/',
|
||||
value: 'id', // 数据字典中value字段的属性名
|
||||
label: 'name', // 数据字典中label字段的属性名
|
||||
}),
|
||||
form: {
|
||||
show:compute(({ form })=>{
|
||||
return form.target_type === 0
|
||||
}),
|
||||
rules: [ // 表单校验规则
|
||||
{
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
],
|
||||
|
||||
},
|
||||
component: {
|
||||
name: 'manyToMany',
|
||||
valueBinding: 'user_info',
|
||||
children: 'name'
|
||||
}
|
||||
},
|
||||
target_role: {
|
||||
title: '目标角色',
|
||||
search: {
|
||||
disabled: true
|
||||
},
|
||||
disabled: true,
|
||||
width: 130,
|
||||
type: 'table-selector',
|
||||
dict: {
|
||||
cache: false,
|
||||
url: '/api/system/role/',
|
||||
value: 'id', // 数据字典中value字段的属性名
|
||||
label: 'name', // 数据字典中label字段的属性名
|
||||
},
|
||||
form: {
|
||||
show:compute(({ form })=>{
|
||||
return form.target_type === 1
|
||||
}),
|
||||
rules: [ // 表单校验规则
|
||||
{
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
]
|
||||
},
|
||||
component: {
|
||||
name: 'manyToMany',
|
||||
valueBinding: 'role_info',
|
||||
children: 'name'
|
||||
}
|
||||
},
|
||||
target_dept: {
|
||||
title: '目标部门',
|
||||
search: {
|
||||
disabled: true
|
||||
},
|
||||
width: 130,
|
||||
type: 'table-selector',
|
||||
dict: {
|
||||
cache: false,
|
||||
url: '/api/system/dept/all_dept/',
|
||||
isTree: true,
|
||||
value: 'id', // 数据字典中value字段的属性名
|
||||
label: 'name', // 数据字典中label字段的属性名
|
||||
children: 'children', // 数据字典中children字段的属性名
|
||||
},
|
||||
disabled: true,
|
||||
form: {
|
||||
show:compute(({ form })=>{
|
||||
return form.target_type === 2
|
||||
}),
|
||||
rules: [ // 表单校验规则
|
||||
{
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
],
|
||||
itemProps: {
|
||||
class: {yxtInput: true}
|
||||
}
|
||||
},
|
||||
component: {
|
||||
name: 'manyToMany',
|
||||
valueBinding: 'dept_info',
|
||||
children: 'name'
|
||||
}
|
||||
},
|
||||
content: {
|
||||
title: '内容',
|
||||
column: {
|
||||
width: 300,
|
||||
show: false
|
||||
},
|
||||
type: ["editor-wang5", "colspan"],
|
||||
form: {
|
||||
rules: [ // 表单校验规则
|
||||
{
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
],
|
||||
component: {
|
||||
disabled: compute(({form}) => {
|
||||
return form.disabled;
|
||||
}),
|
||||
id: "1", // 当同一个页面有多个editor时,需要配置不同的id
|
||||
config: {},
|
||||
uploader: {
|
||||
type: "form",
|
||||
buildUrl(res) {
|
||||
return res.url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
1149
web/yarn.lock
1149
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user