diff --git a/client/src/api/user.js b/client/src/api/user.js index d03a874..95d0f65 100644 --- a/client/src/api/user.js +++ b/client/src/api/user.js @@ -32,11 +32,10 @@ export function logout() { }) } -export function getInfo(token) { +export function getInfo() { return request({ url: '/system/user/info/', method: 'get', - params: { token } }) } diff --git a/server/apps/ability/migrations/0017_auto_20201230_1626.py b/server/apps/ability/migrations/0017_auto_20201230_1626.py new file mode 100644 index 0000000..748eb68 --- /dev/null +++ b/server/apps/ability/migrations/0017_auto_20201230_1626.py @@ -0,0 +1,38 @@ +# Generated by Django 3.0.7 on 2020-12-30 08:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ability', '0016_qualification_ssbm'), + ] + + operations = [ + migrations.AlterField( + model_name='cnas', + name='bzbh', + field=models.TextField(blank=True, null=True, verbose_name='标准编号'), + ), + migrations.AlterField( + model_name='cnas', + name='bzmc', + field=models.TextField(blank=True, null=True, verbose_name='标准名称'), + ), + migrations.AlterField( + model_name='cnas', + name='bztk', + field=models.TextField(blank=True, null=True, verbose_name='标准条款'), + ), + migrations.AlterField( + model_name='cnas', + name='lbmc', + field=models.TextField(blank=True, null=True, verbose_name='类别名称'), + ), + migrations.AlterField( + model_name='cnas', + name='xmmc', + field=models.TextField(blank=True, null=True, verbose_name='项目名称'), + ), + ] diff --git a/server/apps/ability/models.py b/server/apps/ability/models.py index 0ecf3fb..68c0f8a 100644 --- a/server/apps/ability/models.py +++ b/server/apps/ability/models.py @@ -1,9 +1,18 @@ +from datetime import MAXYEAR from django.db import models +from django.db.models.fields import related from utils.model import BaseModel -from apps.system.models import Organization +from apps.system.models import Organization, User # Create your models here. +# class GetRecord(BaseModel): +# user = models.ForeignKey(User, related_name='record_user', on_delete=models.CASCADE) +# path = models.CharField('访问地址', max_length=100) +# ip = models.CharField('IP地址', max_length=100) +# method = models.CharField('方法', max_length=100, default='GET') + + class CMA(BaseModel): """ CMA检测能力表 @@ -47,11 +56,11 @@ class CNAS(BaseModel): """ CNAS检测能力表 """ - lbmc = models.CharField('类别名称', max_length=200,null=True,blank=True) - xmmc = models.CharField('项目名称', max_length=200,null=True,blank=True) - bzmc = models.CharField('标准名称', max_length=400,null=True,blank=True) - bzbh = models.CharField('标准编号', max_length=400,null=True,blank=True) - bztk = models.CharField('标准条款', max_length=400,null=True,blank=True) + lbmc = models.TextField('类别名称', null=True,blank=True) + xmmc = models.TextField('项目名称', null=True,blank=True) + bzmc = models.TextField('标准名称', null=True,blank=True) + bzbh = models.TextField('标准编号', null=True,blank=True) + bztk = models.TextField('标准条款', null=True,blank=True) sszx = models.TextField('所属中心',null=True,blank=True) class Qualification(BaseModel): diff --git a/server/apps/ability/views.py b/server/apps/ability/views.py index 2c7bc8b..bc4216a 100644 --- a/server/apps/ability/views.py +++ b/server/apps/ability/views.py @@ -13,7 +13,22 @@ from openpyxl import Workbook, load_workbook from django.db.models import Count from utils.pagination import PageOrNot # Create your views here. -class CMAViewSet(ModelViewSet): +import json + +class RecordMixin(): + def perform_authentication(self, request): + """ + Perform authentication on the incoming request. + + Note that if you override this and simply 'pass', then authentication + will instead be performed lazily, the first time either + `request.user` or `request.auth` is accessed. + """ + user = request.user + if request.method == 'GET': + print(json.dumps(request.query_params), request.method, request.path) + +class CMAViewSet(RecordMixin, ModelViewSet): """ CMA检测能力:增删改查 """