# 政务通——区块链助力政府办公
## 1.项目简介
区块链具有不可篡改性以及可追溯性,因此对于一些重要信息区块链更能够保障信息的安全。基于区块链的这两大特点,本篇将介绍如何将区块链应用于政府办公,实现**协同办公**,**数据脱敏上链**,以及**数据溯源**打破数据孤岛等功能。以小程序为载体,体现区块链在实际生活中的具体作用。总体设计分为四个模块。具体如表1.1所示,
**表1.1 功能模块分析**
| 功能模块 | 技术特点 |
| :------------------ | :----------------------------------------------------------: |
| 1. **用户管理模块** | 注册时候对用户信息进行**资产数字化处理**,用户密码等关键信息脱敏上链。存储的是通过sha256运算后的哈希值,保障了用户的安全。用户登录时,输入密码进行一次哈希运算,与链上比对,即完成“**确权**”,验证一致才可登陆。 |
| 2. **建言献策模块** | 用户留言内容记录上链,同时对留言内容**调用外部api**,如果留言内容涉及敏感词,则扣除用户信用积分。**打造一个好的社会信用生态** |
| **3巡检模块** | 用户打卡记录上链,涉及“数据溯源” |
| **4.政务合作模块** | 体现联盟链的**“多方协作”**特点. |
## 2 项目优势
区块链技术的去中心化、不可篡改、可信任、可溯源等特点,使得区块链技术不仅在数据安全领域有所作为,在政务服务系统中也可大展身手。通过对大量数据信息 的分析和快速处理,区块链应用开发技术可以迅速将有效信息传递至各部门,为扁平 化管理创造了条件。因此本项目有如下特点与优势。
1、区块链技术可在政府部门间构建起分布式对等网络,让政府组织结构的信息传 递更加直接高效,部门间可运用区块链技术直接进行点对点信息传递。
2、区块链分布式的模式特点可以实现多部门间的数据同享,可使得政务管理层级 减少,部门与部门间、上级与下级间的沟通会更顺畅,对于人员的需求也会相应减少。 政府部门可利用区块链技术打造高效的行政系统,推动政府治理和公共服务模式创新。
3、每个在区块链上获取数据的主体是平等关系,需要共同承担管理责任。数据的 变动和更改会同步在整个网络节点上更新,这种变动需要每个参与者确认,即使部分 数据库系统出现失灵或错误,其他节点数据依然完整,数据库系统依旧可以正常有效 运转。
4、公共服务部门利用区块链技术可以降低成本、保证数据安全、增加信任、透明 度和可靠性。区块链的特性使得数据可以追根溯源,数据安全性提升且不能随意变动, 有助于建立权威数据库,进而建立更安全、开放、包容高效的公共服务平台。
## 3.系统实现
区块链部分基于`FISCO BCOS` 开发。`FISCO BCOS` 是由国内企业主导研发、对外开源、安全可控的企业级金融联盟链底层平台。另外通过微信小程序作为媒介,客户端由小程序和后台管理网站通过`https` 请求,经过 `nginx` 进行负载均衡。后台采用 django,将用户的 `access_token `等存储在` redis` 缓存服务器中,进行定时刷新。 前端采用小程序的原生框架,采用 `WXML + WXSS + JS` 进行原生开发与布局。
### 3.1用户管理模块
该模块包含用户注册登陆以及管理员对用户信用积分的管理。登录功能是可确权登录的操作手段,以此实现用户的操作安全性,确保用户的账 号数据安全为用户本人操作。用户在正确登录小程序后,后台会获取登录用户的身份, 根据身份给予该用户不同的权限进行操作。
#### 3.1.1 合约代码
**1.功能说明:**本合约实现功能主要为:1.用户注册2.用户登录3.查看用户信息
- `activateUser(string memory _userid,string memory _username,string memory _userpassword, string memory _usertype)`:用户实现注册,传入用户的ID号、名字、密码,用户身份类别。
- `Login(string memory _userid,string memory _userpassword)`用户的ID、用户的密码
- `getUserRecordArray(string userid)`用户的ID
```solidity
pragma solidity ^0.4.25;
pragma experimental ABIEncoderV2;
import "../lib/SafeMath.sol";
import "../utils/TimeUtil.sol";
import "../utils/StringUtil.sol";
import "../utils/TypeConvertUtil.sol";
import "./TableDefTools.sol";
contract UserControl is TableDefTools{
/******* 引入库 *******/
using TimeUtil for *;
using SafeMath for *;
using TypeConvertUtil for *;
using StringUtil for *;
/*
* 构造函数,初始化使用到的表结构
*
* @param 无
*
* @return 无
*/
constructor() public{
//初始化需要用到的表。用户信息表
initTableStruct(t_user_struct, TABLE_USER_NAME, TABLE_USER_PRIMARYKEY, TABLE_USER_FIELDS);
}
// 事件
event REGISTER_USER_EVENT(string userid,string usertype,string activatetime); //注册用户事件.记录注册人身份,类型,注册时间
event DEL_CREDITPOINT_EVENT(string user_id,string grade,string time); //扣分时间,扣分人id、扣分数、扣分时间
event ADD_CREDITPOINT_EVENT(string user_id,string grade,string time);
/*
* 1.用户注册
*
* @param _userid 用户id
* @param _fields 用户信息表各字段值拼接成的字符串(除最后三个字段;用逗号分隔。最后三个字段分别是注册时间【根据注册时间生成】,注册状态
注册后这个值默认为1,信用积分默认为100分),包括如下:
* 用户ID(主键)
* 用户名
* 登陆密码
* 注册时间
* 注册状态[1代表已注册,0代表为注册]
* 信用积分
*
* @return 执行状态码
*
* 测试举例 参数一:"191867345212322"
* 参数二:"江会文","123456","个人"
*注册成功返回SUCCESS否则返回错误码,错误码对应的问题请参考DB
*/
function activateUser(string memory _userid,string memory _username,string memory _userpassword, string memory _usertype) public returns(int8){
// 获得当前的时间
string memory _passwordhash=TypeConvertUtil.bytes32ToString(sha256(abi.encode(_userid,_userpassword)));
string memory nowDate = TimeUtil.getNowDate();
string memory firstFiveParams=StringUtil.strConcat7(_username,',',_passwordhash,',',nowDate,',',_usertype);
string memory lastTwoParams = "1,100";
string memory storeFields = StringUtil.strConcat3(firstFiveParams,',',lastTwoParams);
emit REGISTER_USER_EVENT(StringUtil.strConcat2("注册人的ID为:",_userid),StringUtil.strConcat2("注册人身份为:",_usertype),StringUtil.strConcat2("注册时间为:",nowDate));
return insertOneRecord(t_user_struct,_userid,storeFields,false);//最后的false代表主键下记录不可重复
}
/*
* 2.用户登陆
*
* @param userid 用户id
* @param userpassword 用户密码
* @return 用户所有信息并以JSON格式返回
*
* 测试举例 参数一:"191867345212322,123456"
*/
function Login(string memory _userid,string memory _userpassword) public view returns (int8,string) {
string memory _passwordhash=TypeConvertUtil.bytes32ToString(sha256(abi.encode(_userid,_userpassword)));
return loginInToJson(t_user_struct,_userid,_passwordhash);
}
/*
* 3.查询用户
没有合适的资源?快使用搜索试试~ 我知道了~
基于fisco-bcos联盟链的政府办公小程序源码+详细文档+全部资料(毕业设计)
共2000个文件
py:1577个
html:123个
js:117个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 163 浏览量
2024-04-15
17:26:02
上传
评论
收藏 22.93MB ZIP 举报
温馨提示
【资源说明】 基于fisco-bcos联盟链的政府办公小程序源码+详细文档+全部资料(毕业设计).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕设项目、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 3、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于fisco-bcos联盟链的政府办公小程序源码+详细文档+全部资料(毕业设计) (2000个子文件)
responsive.css 18KB
select2.css 17KB
base.css 16KB
select2.min.css 15KB
widgets.css 10KB
autocomplete.css 8KB
forms.css 8KB
changelists.css 6KB
rtl.css 3KB
nav_sidebar.css 2KB
responsive_rtl.css 2KB
login.css 1KB
ol3.css 657B
fonts.css 423B
dashboard.css 380B
~$政务通文档.docx 162B
gui-64.exe 74KB
cli-32.exe 64KB
cli.exe 64KB
technical_500.html 17KB
default_urlconf.html 16KB
tabular.html 4KB
base.html 4KB
change_list.html 3KB
change_form.html 3KB
technical_404.html 2KB
delete_confirmation.html 2KB
stacked.html 2KB
change_password.html 2KB
delete_selected_confirmation.html 2KB
password_change_form.html 2KB
login.html 2KB
openlayers.html 2KB
model_detail.html 2KB
index.html 2KB
fieldset.html 2KB
template_filter_index.html 2KB
view_index.html 2KB
template_tag_index.html 2KB
app_list.html 2KB
change_list_results.html 2KB
related_widget_wrapper.html 1KB
object_history.html 1KB
openlayers.html 1KB
password_reset_confirm.html 1KB
index.html 1KB
model_index.html 1KB
bookmarklets.html 1KB
actions.html 1KB
submit_line.html 1KB
template_detail.html 1KB
search_form.html 1KB
password_reset_form.html 988B
view_detail.html 928B
missing_docutils.html 784B
password_change_done.html 695B
password_reset_done.html 691B
clearable_file_input.html 618B
password_reset_email.html 612B
500.html 551B
pagination.html 549B
password_reset_complete.html 521B
date_hierarchy.html 518B
clearable_file_input.html 511B
clearable_file_input.html 511B
multiple_input.html 462B
invalid_setup.html 447B
multiple_input.html 431B
logged_out.html 425B
change_form_object_tools.html 403B
app_index.html 389B
select.html 384B
change_list_object_tools.html 378B
openlayers-osm.html 378B
select.html 365B
foreign_key_raw_id.html 341B
filter.html 338B
popup_response.html 327B
add_form.html 320B
base_site.html 316B
404.html 282B
nav_sidebar.html 276B
split_datetime.html 238B
input_option.html 219B
input_option.html 219B
url.html 218B
prepopulated_fields_js.html 214B
object_delete_summary.html 192B
input.html 189B
read_only_password_hash.html 185B
attrs.html 172B
attrs.html 172B
input.html 172B
textarea.html 145B
textarea.html 145B
select_option.html 127B
multiwidget.html 117B
osm.html 111B
select_option.html 110B
multiwidget.html 86B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
不走小道
- 粉丝: 3217
- 资源: 5113
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功