├── .gitignore ├── README.md ├── api接口文档.md ├── app.js ├── config ├── default.json └── ueditor.config.js ├── dao ├── AttributeDAO.js ├── DAO.js ├── GoodAttributeDAO.js ├── ManagerDAO.js └── PermissionAPIDAO.js ├── db └── mydb.sql ├── models ├── AttributeModel.js ├── CategoryModel.js ├── GoodAttributeModel.js ├── GoodModel.js ├── GoodPicModel.js ├── ManagerModel.js ├── OrderGoodModel.js ├── OrderModel.js ├── PermissionAPIModel.js ├── PermissionModel.js ├── ReportOneModel.js ├── ReportTwoModel.js └── RoleModel.js ├── modules ├── Logistics.js ├── authorization.js ├── database.js ├── logger.js ├── passport.js ├── resextra.js └── ueditor.js ├── package.json ├── public └── ueditor │ ├── dialogs │ ├── anchor │ │ └── anchor.html │ ├── attachment │ │ ├── attachment.css │ │ ├── attachment.html │ │ ├── attachment.js │ │ ├── fileTypeImages │ │ │ ├── icon_chm.gif │ │ │ ├── icon_default.png │ │ │ ├── icon_doc.gif │ │ │ ├── icon_exe.gif │ │ │ ├── icon_jpg.gif │ │ │ ├── icon_mp3.gif │ │ │ ├── icon_mv.gif │ │ │ ├── icon_pdf.gif │ │ │ ├── icon_ppt.gif │ │ │ ├── icon_psd.gif │ │ │ ├── icon_rar.gif │ │ │ ├── icon_txt.gif │ │ │ └── icon_xls.gif │ │ └── images │ │ │ ├── alignicon.gif │ │ │ ├── alignicon.png │ │ │ ├── bg.png │ │ │ ├── file-icons.gif │ │ │ ├── file-icons.png │ │ │ ├── icons.gif │ │ │ ├── icons.png │ │ │ ├── image.png │ │ │ ├── progress.png │ │ │ ├── success.gif │ │ │ └── success.png │ ├── background │ │ ├── background.css │ │ ├── background.html │ │ ├── background.js │ │ └── images │ │ │ ├── bg.png │ │ │ └── success.png │ ├── charts │ │ ├── chart.config.js │ │ ├── charts.css │ │ ├── charts.html │ │ ├── charts.js │ │ └── images │ │ │ ├── charts0.png │ │ │ ├── charts1.png │ │ │ ├── charts2.png │ │ │ ├── charts3.png │ │ │ ├── charts4.png │ │ │ └── charts5.png │ ├── emotion │ │ ├── emotion.css │ │ ├── emotion.html │ │ ├── emotion.js │ │ └── images │ │ │ ├── 0.gif │ │ │ ├── bface.gif │ │ │ ├── cface.gif │ │ │ ├── fface.gif │ │ │ ├── jxface2.gif │ │ │ ├── neweditor-tab-bg.png │ │ │ ├── tface.gif │ │ │ ├── wface.gif │ │ │ └── yface.gif │ ├── gmap │ │ └── gmap.html │ ├── help │ │ ├── help.css │ │ ├── help.html │ │ └── help.js │ ├── image │ │ ├── image.css │ │ ├── image.html │ │ ├── image.js │ │ └── images │ │ │ ├── alignicon.jpg │ │ │ ├── bg.png │ │ │ ├── icons.gif │ │ │ ├── icons.png │ │ │ ├── image.png │ │ │ ├── progress.png │ │ │ ├── success.gif │ │ │ └── success.png │ ├── insertframe │ │ └── insertframe.html │ ├── internal.js │ ├── link │ │ └── link.html │ ├── map │ │ ├── map.html │ │ └── show.html │ ├── music │ │ ├── music.css │ │ ├── music.html │ │ └── music.js │ ├── preview │ │ └── preview.html │ ├── scrawl │ │ ├── images │ │ │ ├── addimg.png │ │ │ ├── brush.png │ │ │ ├── delimg.png │ │ │ ├── delimgH.png │ │ │ ├── empty.png │ │ │ ├── emptyH.png │ │ │ ├── eraser.png │ │ │ ├── redo.png │ │ │ ├── redoH.png │ │ │ ├── scale.png │ │ │ ├── scaleH.png │ │ │ ├── size.png │ │ │ ├── undo.png │ │ │ └── undoH.png │ │ ├── scrawl.css │ │ ├── scrawl.html │ │ └── scrawl.js │ ├── searchreplace │ │ ├── searchreplace.html │ │ └── searchreplace.js │ ├── snapscreen │ │ └── snapscreen.html │ ├── spechars │ │ ├── spechars.html │ │ └── spechars.js │ ├── table │ │ ├── dragicon.png │ │ ├── edittable.css │ │ ├── edittable.html │ │ ├── edittable.js │ │ ├── edittd.html │ │ └── edittip.html │ ├── template │ │ ├── config.js │ │ ├── images │ │ │ ├── bg.gif │ │ │ ├── pre0.png │ │ │ ├── pre1.png │ │ │ ├── pre2.png │ │ │ ├── pre3.png │ │ │ └── pre4.png │ │ ├── template.css │ │ ├── template.html │ │ └── template.js │ ├── video │ │ ├── images │ │ │ ├── bg.png │ │ │ ├── center_focus.jpg │ │ │ ├── file-icons.gif │ │ │ ├── file-icons.png │ │ │ ├── icons.gif │ │ │ ├── icons.png │ │ │ ├── image.png │ │ │ ├── left_focus.jpg │ │ │ ├── none_focus.jpg │ │ │ ├── progress.png │ │ │ ├── right_focus.jpg │ │ │ ├── success.gif │ │ │ └── success.png │ │ ├── video.css │ │ ├── video.html │ │ └── video.js │ ├── webapp │ │ └── webapp.html │ └── wordimage │ │ ├── fClipboard_ueditor.swf │ │ ├── imageUploader.swf │ │ ├── tangram.js │ │ ├── wordimage.html │ │ └── wordimage.js │ ├── index.html │ ├── lang │ ├── en │ │ ├── en.js │ │ └── images │ │ │ ├── addimage.png │ │ │ ├── alldeletebtnhoverskin.png │ │ │ ├── alldeletebtnupskin.png │ │ │ ├── background.png │ │ │ ├── button.png │ │ │ ├── copy.png │ │ │ ├── deletedisable.png │ │ │ ├── deleteenable.png │ │ │ ├── listbackground.png │ │ │ ├── localimage.png │ │ │ ├── music.png │ │ │ ├── rotateleftdisable.png │ │ │ ├── rotateleftenable.png │ │ │ ├── rotaterightdisable.png │ │ │ ├── rotaterightenable.png │ │ │ └── upload.png │ └── zh-cn │ │ ├── images │ │ ├── copy.png │ │ ├── localimage.png │ │ ├── music.png │ │ └── upload.png │ │ └── zh-cn.js │ ├── themes │ ├── default │ │ ├── css │ │ │ ├── ueditor.css │ │ │ └── ueditor.min.css │ │ ├── dialogbase.css │ │ └── images │ │ │ ├── anchor.gif │ │ │ ├── arrow.png │ │ │ ├── arrow_down.png │ │ │ ├── arrow_up.png │ │ │ ├── button-bg.gif │ │ │ ├── cancelbutton.gif │ │ │ ├── charts.png │ │ │ ├── cursor_h.gif │ │ │ ├── cursor_h.png │ │ │ ├── cursor_v.gif │ │ │ ├── cursor_v.png │ │ │ ├── dialog-title-bg.png │ │ │ ├── filescan.png │ │ │ ├── highlighted.gif │ │ │ ├── icons-all.gif │ │ │ ├── icons.gif │ │ │ ├── icons.png │ │ │ ├── img-cracked.png │ │ │ ├── loaderror.png │ │ │ ├── loading.gif │ │ │ ├── lock.gif │ │ │ ├── neweditor-tab-bg.png │ │ │ ├── pagebreak.gif │ │ │ ├── scale.png │ │ │ ├── sortable.png │ │ │ ├── spacer.gif │ │ │ ├── sparator_v.png │ │ │ ├── table-cell-align.png │ │ │ ├── tangram-colorpicker.png │ │ │ ├── toolbar_bg.png │ │ │ ├── unhighlighted.gif │ │ │ ├── upload.png │ │ │ ├── videologo.gif │ │ │ ├── word.gif │ │ │ └── wordpaste.png │ └── iframe.css │ ├── third-party │ ├── SyntaxHighlighter │ │ ├── shCore.js │ │ └── shCoreDefault.css │ ├── codemirror │ │ ├── codemirror.css │ │ └── codemirror.js │ ├── highcharts │ │ ├── adapters │ │ │ ├── mootools-adapter.js │ │ │ ├── mootools-adapter.src.js │ │ │ ├── prototype-adapter.js │ │ │ ├── prototype-adapter.src.js │ │ │ ├── standalone-framework.js │ │ │ └── standalone-framework.src.js │ │ ├── highcharts-more.js │ │ ├── highcharts-more.src.js │ │ ├── highcharts.js │ │ ├── highcharts.src.js │ │ ├── modules │ │ │ ├── annotations.js │ │ │ ├── annotations.src.js │ │ │ ├── canvas-tools.js │ │ │ ├── canvas-tools.src.js │ │ │ ├── data.js │ │ │ ├── data.src.js │ │ │ ├── drilldown.js │ │ │ ├── drilldown.src.js │ │ │ ├── exporting.js │ │ │ ├── exporting.src.js │ │ │ ├── funnel.js │ │ │ ├── funnel.src.js │ │ │ ├── heatmap.js │ │ │ ├── heatmap.src.js │ │ │ ├── map.js │ │ │ ├── map.src.js │ │ │ ├── no-data-to-display.js │ │ │ └── no-data-to-display.src.js │ │ └── themes │ │ │ ├── dark-blue.js │ │ │ ├── dark-green.js │ │ │ ├── gray.js │ │ │ ├── grid.js │ │ │ └── skies.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ ├── snapscreen │ │ └── UEditorSnapscreen.exe │ ├── video-js │ │ ├── font │ │ │ ├── vjs.eot │ │ │ ├── vjs.svg │ │ │ ├── vjs.ttf │ │ │ └── vjs.woff │ │ ├── video-js.css │ │ ├── video-js.min.css │ │ ├── video-js.swf │ │ ├── video.dev.js │ │ └── video.js │ ├── webuploader │ │ ├── Uploader.swf │ │ ├── webuploader.css │ │ ├── webuploader.custom.js │ │ ├── webuploader.custom.min.js │ │ ├── webuploader.flashonly.js │ │ ├── webuploader.flashonly.min.js │ │ ├── webuploader.html5only.js │ │ ├── webuploader.html5only.min.js │ │ ├── webuploader.js │ │ ├── webuploader.min.js │ │ ├── webuploader.withoutimage.js │ │ └── webuploader.withoutimage.min.js │ └── zeroclipboard │ │ ├── ZeroClipboard.js │ │ ├── ZeroClipboard.min.js │ │ └── ZeroClipboard.swf │ ├── ueditor.all.js │ ├── ueditor.all.min.js │ ├── ueditor.config.js │ ├── ueditor.parse.js │ └── ueditor.parse.min.js ├── routes └── api │ └── private │ └── v1 │ ├── categories.js │ ├── goods.js │ ├── menus.js │ ├── orders.js │ ├── reports.js │ ├── rights.js │ ├── roles.js │ ├── upload.js │ └── users.js ├── services ├── AttributeService.js ├── CategoryService.js ├── GoodService.js ├── ManagerService.js ├── MenuService.js ├── OrderService.js ├── ReportsService.js ├── RightService.js ├── RoleService.js └── UserService.js └── test ├── api └── private │ ├── common │ └── common.js │ └── v1 │ ├── goods.test.js │ ├── login.test.js │ ├── roles.test.js │ └── users.test.js ├── app.js ├── configs └── config.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | package-lock.json 4 | tmp_uploads/ 5 | uploads/ 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # practise-vue-shop-server 2 | 3 | ### 介绍 4 | 5 | learnVue_shop 配套的服务器 API 项目 6 | 7 | **项目所有配置代码已做详细注释,请放心食用。** 8 | 9 | > 在食用本项目前,推荐先学习 node.js 和 express 框架,这两个东西很简单,一个下午随便找些文档和视频看就可以入门。**切勿急功近利** 10 | 11 | **前端 web 项目索引:[关于 element 的初级学习代码项目。 附全套学习资源和 vscode 配置](https://github.com/wangxinleo/learnVue_shop.git)** 12 | 13 | 黑马前端官方课程地址: 14 | 前端项目地址:[http://shop.liulongbin.top/](http://shop.liulongbin.top/) 15 | 16 | 后端接口地址:[https://www.liulongbin.top:8888/api/private/v1/](https://www.liulongbin.top:8888/api/private/v1/) 17 | 18 | API 接口文档:已部署至本项目根节点 19 | 20 | 全套课程下载:链接:[https://pan.baidu.com/s/1hBwZLR-Wbjt28YSEzVi6AQ](https://pan.baidu.com/s/1hBwZLR-Wbjt28YSEzVi6AQ) ,提取码是 2urn 21 | 22 | \_注:本后端服务器已设置必须带有 token 才能正常发送和接收请求。请注意请求头参数 23 | 24 | ### 项目环境 25 | 26 | - 本地环境 27 | 28 | ​ Node.js + Express + MySQL 29 | 30 | - 创建数据库 31 | 32 | ​ 数据库文件在:db -> mysdb.sql 33 | 34 | ​ 创建数据库 mydb,可通过新建查询执行 mysdb.sql 下的 SQL 语句建立数据库,数据库表 35 | 36 | **​ 数据库连接名:root 密码: 123456** 37 | 38 | ​ 可在 config -> default.json 修改 39 | 40 | ### 鸣谢 41 | 42 | b 站用户 : [洛天依保护协会](https://space.bilibili.com/132108522?spm_id_from=333.788.b_636f6d6d656e74.26)提供的公用后台 API 接口 43 | 44 | 用户名 : admin 密码 : 123456 45 | 46 | [洛天依保护协会](https://space.bilibili.com/132108522?spm_id_from=333.788.b_636f6d6d656e74.26)的项目示例地址 : [http://gl.timemeetyou.com](http://gl.timemeetyou.com) 47 | 48 | **万一接口失效了或者用户被删了可以私聊其恢复数据库** 49 | 50 | ### 安装 51 | 52 | ``` 53 | # 克隆项目 54 | git clone https://github.com/wangxinleo/vueShop_Server.git 55 | 56 | # 进入项目目录 57 | cd vueShop_Server 58 | 59 | # 安装依赖 60 | npm install 61 | 62 | # 本地开发 启动项目 63 | node ./app.js 64 | ``` 65 | 66 | ### 目录结构说明 67 | 68 | - `config` 配置文件目录 69 | - `default.json` 默认配置文件(其中包含数据库配置,jwt 配置) 70 | - `dao` 数据访问层,存放对数据库的增删改查操作 71 | - `DAO.js` 提供的公共访问数据库的方法 72 | - `models` 存放具体数据库 ORM 模型文件 73 | - `modules` 当前项目模块 74 | - `authorization.js` API 权限验证模块 75 | - `database.js` 数据库模块(数据库加载基于 nodejs-orm2 库加载) 76 | - `passport.js` 基于 passport 模块的登录搭建 77 | - `resextra.js` API 统一返回结果接口 78 | - `node_modules` 项目依赖的第三方模块 79 | - `routes` 统一路由 80 | - `api` 提供 api 接口 81 | - `mapp` 提供移动 APP 界面 82 | - `mweb` 提供移动 web 站点 83 | - `services` 服务层,业务逻辑代码在这一层编写,通过不同的接口获取的数据转换成统一的前端所需要的数据 84 | - `app.js` 主项目入口文件 85 | - `package.json` 项目配置文件 86 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | var express = require('express') 3 | var bodyParser = require('body-parser') 4 | var path = require('path') 5 | // 路由加载 6 | var mount = require('mount-routes') 7 | 8 | var app = express() 9 | 10 | 11 | /** 12 | * 13 | * 公共系统初始化 14 | * 15 | */ 16 | app.use(bodyParser.json()) 17 | app.use(bodyParser.urlencoded({ extended: true })) 18 | 19 | // 初始化数据库模块 20 | var database = require('./modules/database') 21 | database.initialize(app, function(err) { 22 | if (err) { 23 | console.error('连接数据库失败失败 %s', err) 24 | } 25 | }) 26 | 27 | /** 28 | * 29 | * 后台管理系统初始化 30 | * 31 | */ 32 | // 获取管理员逻辑模块 33 | var managerService = require(path.join(process.cwd(), 'services/ManagerService')) 34 | // 获取角色服务模块 35 | var roleService = require(path.join(process.cwd(), 'services/RoleService')) 36 | 37 | // 设置跨域和相应数据格式 38 | app.all('/api/*', function(req, res, next) { 39 | res.header('Access-Control-Allow-Origin', '*') 40 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, mytoken') 41 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, Authorization') 42 | res.setHeader('Content-Type', 'application/json;charset=utf-8') 43 | res.header('Access-Control-Allow-Headers', 'Content-Type,Content-Length, Authorization, Accept,X-Requested-With') 44 | res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS') 45 | res.header('X-Powered-By', ' 3.2.1') 46 | if (req.method == 'OPTIONS') res.send(200) 47 | /*让options请求快速返回*/ else next() 48 | }) 49 | 50 | // 初始化统一响应机制 51 | var resextra = require('./modules/resextra') 52 | app.use(resextra) 53 | 54 | // 初始化 后台登录 passport 策略 55 | admin_passport = require('./modules/passport') 56 | // 设置登录模块的登录函数衔接 passport 策略 57 | admin_passport.setup(app, managerService.login) 58 | // 设置 passport 登录入口点 59 | app.use('/api/private/v1/login', admin_passport.login) 60 | // 设置 passport 验证路径 61 | app.use('/api/private/v1/*', admin_passport.tokenAuth) 62 | 63 | // 获取验证模块 64 | var authorization = require(path.join(process.cwd(), '/modules/authorization')) 65 | 66 | // 设置全局权限 67 | authorization.setAuthFn(function(req, res, next, serviceName, actionName, passFn) { 68 | if (!req.userInfo || isNaN(parseInt(req.userInfo.rid))) return res.sendResult('无角色ID分配') 69 | // 验证权限 70 | roleService.authRight(req.userInfo.rid, serviceName, actionName, function(err, pass) { 71 | passFn(pass) 72 | }) 73 | }) 74 | 75 | /** 76 | * 77 | * 初始化路由 78 | * 79 | */ 80 | // 带路径的用法并且可以打印出路有表 81 | mount(app, path.join(process.cwd(), '/routes'), true) 82 | 83 | app.all('/ueditor/ue', function(req, res, next) { 84 | res.header('Access-Control-Allow-Origin', '*') 85 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, mytoken') 86 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, Authorization') 87 | res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With, X_Requested_With') 88 | res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS') 89 | res.header('X-Powered-By', ' 3.2.1') 90 | if (req.method == 'OPTIONS') res.send(200) 91 | /*让options请求快速返回*/ else next() 92 | }) 93 | 94 | // 富文本编辑器上传 95 | var ueditor = require(path.join(process.cwd(), '/modules/ueditor')) 96 | // 富文本控件处理qing q 97 | app.use('/ueditor/ue', ueditor) 98 | //. 设置富文本空间地址 99 | app.use('/ueditor', express.static('public/ueditor')) 100 | 101 | app.use('/tmp_uploads', express.static('tmp_uploads')) 102 | app.use('/x/common', express.static('uploads/common')) 103 | app.use('/uploads/goodspics', express.static('uploads/goodspics')) 104 | 105 | var upload_config = require('config').get('upload_config') 106 | app.use('/' + upload_config.get('upload_ueditor'), express.static(upload_config.get('upload_ueditor'))) 107 | 108 | const logistics = require('./modules/Logistics.js') 109 | app.get('/api/private/v1/kuaidi/:orderno', logistics.getLogisticsInfo) 110 | 111 | // 定义日志 112 | // var log4js = require('./modules/logger'); 113 | // log4js.use(app); 114 | 115 | /** 116 | * 117 | * 统一处理无响应 118 | * 119 | */ 120 | // 如果没有路径处理就返回 Not Found 121 | app.use(function(req, res, next) { 122 | res.sendResult(null, 404, 'Not Found') 123 | }) 124 | 125 | app.listen(8888) 126 | 127 | module.exports = app 128 | -------------------------------------------------------------------------------- /config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "config_name" : "develop", 3 | "jwt_config" : { 4 | "secretKey":"itcast", 5 | "expiresIn":86400 6 | }, 7 | "upload_config":{ 8 | "baseURL":"http://127.0.0.1:8888", 9 | "upload_ueditor":"uploads/ueditor", 10 | "simple_upload_redirect":"http://127.0.0.1/reload" 11 | }, 12 | "db_config" : { 13 | "protocol" : "mysql", 14 | "host" : "127.0.0.1", 15 | "database" : "mydb", 16 | "user" : "root", 17 | "password" : "root", 18 | "port" : 3306 19 | } 20 | } -------------------------------------------------------------------------------- /dao/AttributeDAO.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | daoModule = require("./DAO"); 3 | databaseModule = require(path.join(process.cwd(),"modules/database")); 4 | 5 | /** 6 | * 获取参数列表数据 7 | * 8 | * @param {[type]} cat_id 分类ID 9 | * @param {[type]} sel 类型 10 | * @param {Function} cb 回调函数 11 | */ 12 | module.exports.list = function(cat_id,sel,cb) { 13 | db = databaseModule.getDatabase(); 14 | sql = "SELECT * FROM sp_attribute WHERE cat_id = ? AND attr_sel = ? AND delete_time is NULL"; 15 | database.driver.execQuery( 16 | sql 17 | ,[cat_id,sel],function(err,attributes){ 18 | if(err) return cb("查询执行出错"); 19 | cb(null,attributes); 20 | }); 21 | } -------------------------------------------------------------------------------- /dao/GoodAttributeDAO.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | daoModule = require("./DAO"); 3 | databaseModule = require(path.join(process.cwd(),"modules/database")); 4 | 5 | 6 | module.exports.clearGoodAttributes = function(goods_id,cb) { 7 | db = databaseModule.getDatabase(); 8 | sql = "DELETE FROM sp_goods_attr WHERE goods_id = ?"; 9 | database.driver.execQuery( 10 | sql 11 | ,[goods_id],function(err){ 12 | if(err) return cb("删除出错"); 13 | cb(null); 14 | }); 15 | } 16 | 17 | module.exports.list = function(goods_id,cb) { 18 | db = databaseModule.getDatabase(); 19 | sql = "SELECT good_attr.goods_id,good_attr.attr_id,good_attr.attr_value,good_attr.add_price,attr.attr_name,attr.attr_sel,attr.attr_write,attr.attr_vals FROM sp_goods_attr as good_attr LEFT JOIN sp_attribute as attr ON attr.attr_id = good_attr.attr_id WHERE good_attr.goods_id = ?"; 20 | database.driver.execQuery( 21 | sql 22 | ,[goods_id],function(err,attrs){ 23 | if(err) return cb("删除出错"); 24 | cb(null,attrs); 25 | }); 26 | } -------------------------------------------------------------------------------- /dao/ManagerDAO.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | daoModule = require("./DAO"); 3 | databaseModule = require(path.join(process.cwd(),"modules/database")); 4 | 5 | /** 6 | * 创建管理员 7 | * 8 | * @param {[type]} obj 管理员信息 9 | * @param {Function} cb 回调函数 10 | */ 11 | module.exports.create = function(obj,cb) { 12 | daoModule.create("ManagerModel",obj,cb); 13 | } 14 | 15 | /** 16 | * 获取管理员列表 17 | * 18 | * @param {[type]} conditions 查询条件 19 | * @param {Function} cb 回调函数 20 | */ 21 | module.exports.list = function(conditions,cb) { 22 | daoModule.list("ManagerModel",conditions,function(err,models) { 23 | if(err) return cb(err,null); 24 | cb(null,models); 25 | }); 26 | } 27 | 28 | /** 29 | * 通过查询条件获取管理员对象 30 | * 31 | * @param {[type]} conditions 条件 32 | * @param {Function} cb 回调函数 33 | */ 34 | module.exports.findOne = function(conditions,cb) { 35 | daoModule.findOne("ManagerModel",conditions,cb); 36 | } 37 | 38 | /** 39 | * 通过关键词查询用户 40 | * 41 | * @param {[type]} key 关键词 42 | * @param {[type]} offset 43 | * @param {[type]} limit 44 | * @param {Function} cb 回调函数 45 | */ 46 | module.exports.findByKey = function(key,offset,limit,cb) { 47 | db = databaseModule.getDatabase(); 48 | sql = "SELECT * FROM sp_manager as mgr LEFT JOIN sp_role as role ON mgr.role_id = role.role_id"; 49 | 50 | if(key) { 51 | sql += " WHERE mg_name LIKE ? LIMIT ?,?"; 52 | database.driver.execQuery( 53 | sql 54 | ,["%" + key + "%",offset,limit],function(err,managers){ 55 | if(err) return cb("查询执行出错"); 56 | cb(null,managers); 57 | }); 58 | } else { 59 | sql += " LIMIT ?,? "; 60 | database.driver.execQuery(sql,[offset,limit],function(err,managers){ 61 | if(err) return cb("查询执行出错"); 62 | cb(null,managers); 63 | }); 64 | } 65 | } 66 | 67 | /** 68 | * 判断是否存在管理员 69 | * 70 | * @param {[type]} username 用户名 71 | * @param {Function} cb 回调函数 72 | * 73 | */ 74 | module.exports.exists = function(username,cb) { 75 | var db = databaseModule.getDatabase(); 76 | var Model = db.models.ManagerModel; 77 | Model.exists({"mg_name":username},function(err,isExists){ 78 | if(err) return cb("查询失败"); 79 | cb(null,isExists); 80 | }); 81 | } 82 | 83 | /** 84 | * 模糊查询用户数量 85 | * 86 | * @param {[type]} key 关键词 87 | * @param {Function} cb 回调函数 88 | */ 89 | module.exports.countByKey = function(key,cb) { 90 | db = databaseModule.getDatabase(); 91 | sql = "SELECT count(*) as count FROM sp_manager"; 92 | if(key) { 93 | sql += " WHERE mg_name LIKE ?"; 94 | database.driver.execQuery( 95 | sql 96 | ,["%" + key + "%"],function(err,result){ 97 | if(err) return cb("查询执行出错"); 98 | cb(null,result[0]["count"]); 99 | }); 100 | } else { 101 | database.driver.execQuery(sql,function(err,result){ 102 | if(err) return cb("查询执行出错"); 103 | cb(null,result[0]["count"]); 104 | }); 105 | } 106 | 107 | } 108 | 109 | /** 110 | * 通过ID获取管理员对象数据 111 | * 112 | * @param {[type]} id 管理员主键ID 113 | * @param {Function} cb 回调函数 114 | */ 115 | module.exports.show = function(id,cb) { 116 | daoModule.show("ManagerModel",id,cb); 117 | } 118 | 119 | /** 120 | * 更新管理员信息 121 | * 122 | * @param {[type]} obj 管理员对象 123 | * @param {Function} cb 回调函数 124 | */ 125 | module.exports.update = function(obj,cb) { 126 | daoModule.update("ManagerModel",obj.mg_id,obj,cb); 127 | } 128 | 129 | /** 130 | * 删除管理员对象数据 131 | * 132 | * @param {[type]} id 主键ID 133 | * @param {Function} cb 回调函数 134 | */ 135 | module.exports.destroy = function(id,cb) { 136 | daoModule.destroy("ManagerModel",id,function(err){ 137 | if(err) return cb(err); 138 | return cb(null); 139 | }); 140 | } 141 | 142 | /** 143 | * 保存管理员信息 144 | * 145 | * @param {[type]} obj 管理员对象 146 | * @param {Function} cb 回调函数 147 | */ 148 | module.exports.save = function(obj,cb) { 149 | daoModule.show(obj.mg_id,function(err,oldObj){ 150 | if(err) { 151 | daoModule.create("ManagerModel",obj,cb); 152 | } else { 153 | daoModule.update("ManagerModel",obj.mg_id,obj,cb); 154 | } 155 | }) 156 | } 157 | 158 | /** 159 | * 获取管理员数量 160 | * 161 | * @param {Function} cb 回调函数 162 | */ 163 | module.exports.count = function(cb) { 164 | daoModule("ManagerModel",cb); 165 | } -------------------------------------------------------------------------------- /dao/PermissionAPIDAO.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | daoModule = require("./DAO"); 3 | databaseModule = require(path.join(process.cwd(),"modules/database")); 4 | 5 | /** 6 | * 获取权限列表 7 | * 8 | * @param {Function} cb 回调函数 9 | */ 10 | module.exports.list = function(cb) { 11 | db = databaseModule.getDatabase(); 12 | sql = "SELECT * FROM sp_permission_api as api LEFT JOIN sp_permission as main ON main.ps_id = api.ps_id WHERE main.ps_id is not null"; 13 | database.driver.execQuery(sql,function(err,result){ 14 | if(err) return cb("获取权限列表失败",null); 15 | cb(null,result); 16 | }); 17 | } 18 | 19 | /** 20 | * 权限验证 21 | * 22 | * @param {[type]} rid 角色ID 23 | * @param {[type]} serviceName 服务名 24 | * @param {[type]} actionName 动作名 25 | * @param {Function} cb 回调函数 26 | */ 27 | module.exports.authRight = function(rid,serviceName,actionName,cb) { 28 | 29 | // 超级管理员 30 | if(rid == 0) return cb(null,true); 31 | 32 | // 权限验证 33 | daoModule.findOne("PermissionAPIModel",{"ps_api_service":serviceName,"ps_api_action":actionName},function(err,permissionAPI){ 34 | console.log("rid => %s,serviceName => %s,actionName => %s",rid,serviceName,actionName); 35 | if(err || !permissionAPI) return cb("无权限访问",false); 36 | 37 | daoModule.findOne("RoleModel",{"role_id":rid},function(err,role){ 38 | console.log(role); 39 | if(err || !role) return cb("获取角色信息失败",false); 40 | ps_ids = role.ps_ids.split(","); 41 | for(idx in ps_ids) { 42 | ps_id = ps_ids[idx]; 43 | if(parseInt(permissionAPI.ps_id) == parseInt(ps_id)) { 44 | return cb(null,true); 45 | } 46 | } 47 | return cb("无权限访问",false); 48 | }); 49 | }); 50 | } -------------------------------------------------------------------------------- /models/AttributeModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("AttributeModel",{ 4 | attr_id : {type: 'serial', key: true}, 5 | attr_name : String, 6 | cat_id : Number, 7 | attr_sel : ["only", "many"], // only:输入框(唯一) many:后台下拉列表/前台单选框 8 | attr_write: ["manual","list"], // manual:手工录入 list:从列表选择 9 | attr_vals: String, 10 | delete_time : Number 11 | },{ 12 | table : "sp_attribute" 13 | }); 14 | return callback(); 15 | } -------------------------------------------------------------------------------- /models/CategoryModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("CategoryModel",{ 4 | cat_id : {type: 'serial', key: true}, 5 | cat_name : String, 6 | cat_pid : Number, 7 | cat_level : Number, 8 | cat_deleted: Boolean 9 | },{ 10 | table : "sp_category" 11 | }); 12 | return callback(); 13 | } -------------------------------------------------------------------------------- /models/GoodAttributeModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("GoodAttributeModel",{ 4 | id : {type: 'serial', key: true}, 5 | goods_id : Number, 6 | attr_id : Number, 7 | attr_value : String, 8 | add_price : Number 9 | },{ 10 | table : "sp_goods_attr" 11 | }); 12 | return callback(); 13 | } -------------------------------------------------------------------------------- /models/GoodModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("GoodModel",{ 4 | goods_id : {type: 'serial', key: true}, 5 | cat_id : Number, 6 | goods_name : String, 7 | goods_price : Number, 8 | goods_number : Number, 9 | goods_weight : Number, 10 | goods_introduce : String, 11 | goods_big_logo : String, 12 | goods_small_logo : String, 13 | goods_state : Number, // 0:未审核 1: 审核中 2: 已审核 14 | is_del : ['0','1'], // 0: 正常 , 1: 删除 15 | add_time : Number, 16 | upd_time : Number, 17 | delete_time : Number, 18 | hot_mumber : Number, 19 | is_promote : Boolean, 20 | cat_one_id : Number, 21 | cat_two_id : Number, 22 | cat_three_id : Number 23 | 24 | },{ 25 | table : "sp_goods", 26 | methods: { 27 | getGoodsCat: function () { 28 | return this.cat_one_id + ',' + this.cat_two_id + ',' + this.cat_three_id; 29 | } 30 | } 31 | }); 32 | return callback(); 33 | } -------------------------------------------------------------------------------- /models/GoodPicModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("GoodPicModel",{ 4 | pics_id : {type: 'serial', key: true}, 5 | goods_id : Number, 6 | pics_big : String, 7 | pics_mid : String, 8 | pics_sma : String 9 | },{ 10 | table : "sp_goods_pics" 11 | }); 12 | return callback(); 13 | } -------------------------------------------------------------------------------- /models/ManagerModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("ManagerModel",{ 4 | mg_id : {type: 'serial', key: true}, 5 | mg_name : String, 6 | mg_pwd : String, 7 | mg_time : Number, 8 | role_id : Number, 9 | mg_mobile : String, 10 | mg_email : String, 11 | mg_state : Number 12 | },{ 13 | table : "sp_manager" 14 | }); 15 | return callback(); 16 | } -------------------------------------------------------------------------------- /models/OrderGoodModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("OrderGoodModel",{ 4 | id : {type: 'serial', key: true}, 5 | order_id : Number, 6 | goods_id : Number, 7 | goods_price : Number, 8 | goods_number : Number, 9 | goods_total_price : Number 10 | },{ 11 | table : "sp_order_goods" 12 | }); 13 | return callback(); 14 | } -------------------------------------------------------------------------------- /models/OrderModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("OrderModel",{ 4 | order_id : {type: 'serial', key: true}, 5 | user_id : Number, 6 | order_number : String, 7 | order_price : Number, 8 | order_pay : [1,2,3], 9 | is_send : ["是","否"], 10 | trade_no : String, 11 | order_fapiao_title : ["个人","公司"], 12 | order_fapiao_company : String, 13 | order_fapiao_content : String, 14 | consignee_addr : String, 15 | pay_status : ['0','1'], 16 | create_time : Number, 17 | update_time : Number 18 | },{ 19 | table : "sp_order" 20 | }); 21 | return callback(); 22 | } -------------------------------------------------------------------------------- /models/PermissionAPIModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback) { 2 | // 用户模型 3 | db.define("PermissionAPIModel",{ 4 | id : {type: 'serial', key: true}, 5 | ps_id : Number, 6 | ps_api_service : String, 7 | ps_api_action : String, 8 | ps_api_order : Number 9 | 10 | },{ 11 | table : "sp_permission_api" 12 | }); 13 | return callback(); 14 | } -------------------------------------------------------------------------------- /models/PermissionModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("PermissionModel",{ 4 | ps_id : {type: 'serial', key: true}, 5 | ps_name : String, 6 | ps_pid : Number, 7 | ps_c : String, 8 | ps_a : String, 9 | ps_level : String 10 | },{ 11 | table : "sp_permission" 12 | }); 13 | return callback(); 14 | } -------------------------------------------------------------------------------- /models/ReportOneModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 报表模型1 3 | db.define("ReportOneModel",{ 4 | id : {type: 'serial', key: true}, 5 | rp1_user_count : Number, 6 | rp1_area : Number, 7 | rp1_date : { type: "date", time: false } 8 | },{ 9 | table : "sp_report_1" 10 | }); 11 | return callback(); 12 | } -------------------------------------------------------------------------------- /models/ReportTwoModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 报表模型1 3 | db.define("ReportTwoModel",{ 4 | id : {type: 'serial', key: true}, 5 | rp2_page : String, 6 | rp2_count : Number, 7 | rp2_date : { type: "date", time: false } 8 | },{ 9 | table : "sp_report_2" 10 | }); 11 | return callback(); 12 | } -------------------------------------------------------------------------------- /models/RoleModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function(db,callback){ 2 | // 用户模型 3 | db.define("RoleModel",{ 4 | role_id : {type: 'serial', key: true}, 5 | role_name : String, 6 | ps_ids : String, 7 | ps_ca : String, 8 | role_desc : String 9 | },{ 10 | table : "sp_role" 11 | }); 12 | return callback(); 13 | } -------------------------------------------------------------------------------- /modules/Logistics.js: -------------------------------------------------------------------------------- 1 | // 导入 request 模块 2 | const request = require('request') 3 | 4 | // 自动匹配运单号所属的物流公司 5 | function autoComNumber(orderno) { 6 | const url = `https://www.kuaidi100.com/autonumber/autoComNum?resultv2=1&text=${orderno}` 7 | return new Promise(function(resolve, reject) { 8 | request(url, (err, response, body) => { 9 | if (err) return reject({ status: 500, msg: err.message }) 10 | // resolve(body) 11 | // console.log(body.num) 12 | body = JSON.parse(body) 13 | if (body.auto.length <= 0) return reject({ status: 501, msg: '无对应的物流公司' }) 14 | resolve({ status: 200, msg: body.auto[0], comCode: body.auto[0].comCode }) 15 | }) 16 | }) 17 | } 18 | 19 | async function getLogisticsInfo(req, res) { 20 | const result = await autoComNumber(req.params.orderno) 21 | 22 | if (result.status !== 200) { 23 | return { 24 | meta: { 25 | status: 500, 26 | message: '获取物流信息失败!' 27 | } 28 | } 29 | } 30 | 31 | const dataUrl = `https://www.kuaidi100.com/query?type=${result.comCode}&postid=${req.params.orderno}&temp=0.2595247267684455` 32 | request(dataUrl, (err, response, body) => { 33 | if (err) { 34 | return res.send({ 35 | meta: { 36 | status: 501, 37 | message: '获取物流信息失败!' 38 | } 39 | }) 40 | } 41 | // 获取物流信息成功 42 | return res.send({ 43 | meta: { 44 | status: 200, 45 | message: '获取物流信息成功!' 46 | }, 47 | data: (JSON.parse(body)).data 48 | }) 49 | }) 50 | } 51 | 52 | module.exports = { 53 | getLogisticsInfo 54 | } 55 | -------------------------------------------------------------------------------- /modules/authorization.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | // var roles_controller = require("../controllers/roles"); 3 | 4 | var path = require("path"); 5 | 6 | global.service_caches = {}; 7 | 8 | // 存储全局验证函数 9 | global.service_auth_fn = null; 10 | 11 | /** 12 | * 构造回调对象格式 13 | * 14 | * @param {[type]} serviceName 服务名称 15 | * @param {[type]} actionName 动作名称(方法名) 16 | * @param {[type]} serviceModule 服务模块 17 | * @param {[type]} origFunc 原始方法 18 | */ 19 | function Invocation(serviceName,actionName,serviceModule,origFunc) { 20 | return function() { 21 | var origArguments = arguments; 22 | return function(req,res,next) { 23 | if(global.service_auth_fn) { 24 | global.service_auth_fn(req,res,next,serviceName,actionName,function(pass) { 25 | if(pass) { 26 | origFunc.apply(serviceModule,origArguments); 27 | } else { 28 | res.sendResult(null,401,"权限验证失败"); 29 | } 30 | }); 31 | } else { 32 | res.sendResult(null,401,"权限验证失败"); 33 | } 34 | } 35 | } 36 | } 37 | 38 | // 获取服务对象 39 | module.exports.getService = function(serviceName) { 40 | 41 | if(global.service_caches[serviceName]) { 42 | return global.service_caches[serviceName]; 43 | } 44 | 45 | var servicePath = path.join(process.cwd(),"services",serviceName); 46 | 47 | var serviceModule = require(servicePath); 48 | if(!serviceModule) { 49 | console.log("模块没有被发现"); 50 | return null; 51 | } 52 | global.service_caches[serviceName] = {}; 53 | 54 | console.log("*****************************************"); 55 | console.log("拦截服务 => %s",serviceName); 56 | console.log("*****************************************"); 57 | for(actionName in serviceModule) { 58 | 59 | if(serviceModule && serviceModule[actionName] && typeof(serviceModule[actionName]) == "function") { 60 | var origFunc = serviceModule[actionName]; 61 | global.service_caches[serviceName][actionName] = Invocation(serviceName,actionName,serviceModule,origFunc); 62 | console.log("action => %s",actionName); 63 | } 64 | } 65 | // console.log(global.service_caches); 66 | console.log("*****************************************\n"); 67 | return global.service_caches[serviceName]; 68 | } 69 | 70 | // 设置全局验证函数 71 | module.exports.setAuthFn = function(authFn) { 72 | global.service_auth_fn = authFn; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /modules/database.js: -------------------------------------------------------------------------------- 1 | require('mysql'); 2 | var fs = require("fs"); 3 | var orm = require("orm"); 4 | var Promise = require("bluebird"); 5 | var path = require("path"); 6 | 7 | /* 8 | app: 应用程序环境 9 | config: 数据库配置 10 | callback: 回调 11 | */ 12 | function initialize(app,callback) { 13 | 14 | // 加载配置文件 15 | var config = require('config').get("db_config"); 16 | 17 | // 从配置中获取数据库配置 18 | var opts = { 19 | protocol : config.get("protocol"), 20 | host : config.get("host"), 21 | database : config.get("database"), 22 | port : config.get("port"), 23 | user : config.get("user"), 24 | password : config.get("password"), 25 | query : {pool: true,debug: true} 26 | }; 27 | 28 | 29 | console.log("数据库连接参数 %s",JSON.stringify(opts)); 30 | 31 | // 初始化ORM模型 32 | app.use(orm.express(opts, { 33 | define: function (db, models, next) { 34 | 35 | app.db = db; 36 | global.database = db; 37 | 38 | // 获取映射文件路径 39 | var modelsPath = path.join(process.cwd(),"/models"); 40 | 41 | // 读取所有模型文件 42 | fs.readdir(modelsPath,function(err, files) { 43 | // 存放所有的加载模型函数 44 | var loadModelAsynFns = new Array(); 45 | // console.log("开始加载 ORM 模型层文件 "); 46 | for (var i = 0; i < files.length; i++) { 47 | var modelPath = modelsPath + "/" +files[i]; 48 | // console.log("加载模型 %s",modelPath); 49 | loadModelAsynFns[i] = db.loadAsync(modelPath); 50 | } 51 | 52 | Promise.all(loadModelAsynFns) 53 | .then(function(){ 54 | // console.log("ORM 模型加载完成"); 55 | // 挂载模型集合 56 | 57 | for(var modelName in db.models){ 58 | models[modelName] = db.models[modelName]; 59 | } 60 | app.models = models; 61 | callback(null); 62 | next(); 63 | }) 64 | .catch(function(error){ 65 | console.error('加载模块出错 error: ' + err); 66 | callback(error); 67 | next(); 68 | }); 69 | }); 70 | } 71 | })); 72 | } 73 | 74 | module.exports.initialize = initialize; 75 | module.exports.getDatabase = function() { 76 | return global.database; 77 | } -------------------------------------------------------------------------------- /modules/logger.js: -------------------------------------------------------------------------------- 1 | var log4js = require('log4js'); 2 | 3 | log4js.configure({ 4 | appenders: { cheese: { type: 'file', filename: 'cheese.log' } }, 5 | categories: { default: { appenders: ['cheese'], level: 'error' } } 6 | }); 7 | 8 | exports.logger = function (level) { 9 | var logger = log4js.getLogger("cheese"); 10 | logger.level = 'debug'; 11 | return logger; 12 | }; 13 | 14 | // 配合 express 使用的方法 15 | // exports.use = function (app, level) { 16 | // app.use(log4js.connectLogger(log4js.getLogger('logInfo'), { 17 | // level: levels[level] || levels['debug'], 18 | // format: ':method :url :status' 19 | // })); 20 | // }; -------------------------------------------------------------------------------- /modules/passport.js: -------------------------------------------------------------------------------- 1 | const passport = require('passport'); 2 | const LocalStrategy = require('passport-local').Strategy; 3 | const Strategy = require('passport-http-bearer').Strategy; 4 | 5 | var jwt = require("jsonwebtoken"); 6 | 7 | var _ = require('lodash'); 8 | 9 | var jwt_config = require("config").get("jwt_config"); 10 | 11 | // 通过登录函数初始化 12 | /** 13 | * 初始化 passport 框架 14 | * 15 | * @param {[type]} app 全局应用程序 16 | * @param {[type]} loginFunc 登录函数 17 | * @param {Function} callback 回调函数 18 | */ 19 | module.exports.setup = function(app,loginFunc,callback) { 20 | // 用户名密码 登录策略 21 | passport.use(new LocalStrategy( 22 | function(username, password, done) { 23 | if(!loginFunc) return done("登录验证函数未设置"); 24 | 25 | loginFunc(username,password,function(err,user) { 26 | if(err) return done(err); 27 | return done(null, user); 28 | }); 29 | }) 30 | ); 31 | 32 | // token 验证策略 33 | passport.use(new Strategy( 34 | function(token, done) { 35 | jwt.verify(token, jwt_config.get("secretKey"), function (err, decode) { 36 | if (err) { return done("验证错误"); } 37 | return done(null, decode); 38 | }); 39 | } 40 | )); 41 | 42 | // 初始化passport模块 43 | app.use(passport.initialize()); 44 | 45 | if(callback) callback(); 46 | }; 47 | 48 | /** 49 | * 登录验证逻辑 50 | * 51 | * @param {[type]} req 请求 52 | * @param {[type]} res 响应 53 | * @param {Function} next [description] 54 | */ 55 | module.exports.login = function(req,res,next) { 56 | 57 | passport.authenticate('local', function(err, user, info) { 58 | 59 | if(err) return res.sendResult(null,400,err); 60 | if(!user) return res.sendResult(null,400,"参数错误"); 61 | 62 | // 获取角色信息 63 | var token = jwt.sign({"uid":user.id,"rid":user.rid}, jwt_config.get("secretKey"), {"expiresIn": jwt_config.get("expiresIn")}); 64 | user.token = "Bearer " + token; 65 | return res.sendResult(user,200,'登录成功'); 66 | })(req, res, next); 67 | 68 | } 69 | 70 | /** 71 | * token验证函数 72 | * 73 | * @param {[type]} req 请求对象 74 | * @param {[type]} res 响应对象 75 | * @param {Function} next 传递事件函数 76 | */ 77 | module.exports.tokenAuth = function(req,res,next) { 78 | passport.authenticate('bearer', { session: false },function(err,tokenData) { 79 | if(err) return res.sendResult(null,400,'无效token'); 80 | if(!tokenData) return res.sendResult(null,400,'无效token'); 81 | req.userInfo = {}; 82 | req.userInfo.uid = tokenData["uid"]; 83 | req.userInfo.rid = tokenData["rid"]; 84 | next(); 85 | })(req, res, next); 86 | } 87 | -------------------------------------------------------------------------------- /modules/resextra.js: -------------------------------------------------------------------------------- 1 | // 添加统一的返回结果方法 2 | module.exports = function(req, res, next){ 3 | res.sendResult = function(data,code,message) { 4 | var fmt = req.query.fmt ? req.query.fmt : "rest"; 5 | if(fmt == "rest") { 6 | res.json( 7 | { 8 | "data" : data, 9 | "meta" : { 10 | "msg" : message, 11 | "status" : code 12 | } 13 | }); 14 | } 15 | }; 16 | next(); 17 | } -------------------------------------------------------------------------------- /modules/ueditor.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var Busboy = require('busboy'); 4 | var fs = require("fs"); 5 | var uniqid = require('uniqid'); 6 | var ueditor_config = require(path.join(process.cwd(),"/config/ueditor.config.js")); 7 | var upload_config = require('config').get("upload_config"); 8 | 9 | var filetype = 'jpg,png,gif,ico,bmp'; 10 | module.exports = function(req,res,next) { 11 | 12 | if(req.query.action == "config") { 13 | // 吐给客户端配置信息 14 | res.jsonp(ueditor_config); 15 | } else if (req.query.action === 'uploadimage' || req.query.action === 'uploadfile' || req.query.action === 'uploadvideo') { 16 | var busboy = new Busboy({ headers: req.headers }); 17 | busboy.on('file', function (fieldname, file, filename, encoding, mimetype) { 18 | var fileExtArray = filename.split("."); 19 | var ext = fileExtArray[fileExtArray.length - 1]; 20 | var save_filename = uniqid() + "." + ext; 21 | var savePath = path.join(process.cwd(),upload_config.get("upload_ueditor"),save_filename); 22 | file.on('end', function () { 23 | var result = { 24 | 'url': upload_config.get("baseURL")+"/" + upload_config.get("upload_ueditor") + "/" + save_filename, 25 | 'title': req.body && req.body.pictitle || filename, 26 | 'original': filename, 27 | 'state': 'SUCCESS' 28 | }; 29 | if(req.query.encode) { 30 | res.jsonp(result); 31 | } else { 32 | 33 | res.redirect(upload_config.get("simple_upload_redirect") + "?result=" + JSON.stringify(result)); 34 | // res.redirect(result.url); 35 | } 36 | 37 | }); 38 | 39 | file.pipe(fs.createWriteStream(savePath)); 40 | }); 41 | req.pipe(busboy); 42 | } else if(req.query.action === 'listimage') { 43 | fs.readdir(path.join(process.cwd(),upload_config.get("upload_ueditor")),function(err, files){ 44 | if(err) return res.end(); 45 | var total = files.length; 46 | 47 | var filelist = []; 48 | var total = 0; 49 | _(files).forEach(function(file){ 50 | var fileExtArray = file.split("."); 51 | var ext = fileExtArray[fileExtArray.length - 1]; 52 | if (filetype.indexOf(ext.toLowerCase()) >= 0) { 53 | var result_file = {}; 54 | result_file.url = upload_config.get("baseURL")+"/" + upload_config.get("upload_ueditor") + "/" + file; 55 | filelist.push(result_file); 56 | total ++; 57 | } 58 | }); 59 | res.jsonp({ 60 | "state": "SUCCESS", 61 | "list": filelist, 62 | "start": 1, 63 | "total": total 64 | }); 65 | }) 66 | } 67 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vueShop_Server", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./app.js" 7 | }, 8 | "dependencies": { 9 | "bluebird": "^3.5.1", 10 | "body-parser": "~1.18.2", 11 | "busboy": "^0.2.14", 12 | "config": "^1.28.0", 13 | "debug": "~2.6.9", 14 | "express": "^4.16.2", 15 | "gm": "^1.23.0", 16 | "je": "^1.0.2", 17 | "jsonwebtoken": "^7.1.9", 18 | "lodash": "^4.17.4", 19 | "log4js": "^2.4.1", 20 | "morgan": "~1.9.0", 21 | "mount-routes": "^1.0.8", 22 | "multer": "^1.3.0", 23 | "mysql": "^2.15.0", 24 | "node-orm": "^2.1.15", 25 | "node-php-password": "^0.1.2", 26 | "orm": "^4.0.1", 27 | "passport": "^0.4.0", 28 | "passport-http-bearer": "^1.0.1", 29 | "passport-local": "^1.0.0", 30 | "serve-favicon": "~2.4.5", 31 | "underscore": "^1.8.3", 32 | "uniqid": "^4.1.1" 33 | }, 34 | "devDependencies": { 35 | "chai": "^4.1.2", 36 | "chai-http": "^3.0.0", 37 | "gulp": "^3.9.1", 38 | "mocha": "^4.0.1", 39 | "request": "^2.83.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/anchor/anchor.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 |
16 | 17 |
18 | 19 | 39 | 40 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/attachment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ueditor图片对话框 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | 23 | 24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 | 0% 32 | 33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
    45 |
  • 46 |
47 |
48 |
49 | 50 | 51 |
52 |
53 |
54 | 55 |
56 |
57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_default.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/alignicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/alignicon.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/alignicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/alignicon.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/bg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/file-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/file-icons.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/file-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/file-icons.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/icons.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/icons.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/image.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/progress.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/success.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/attachment/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/attachment/images/success.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/background/background.css: -------------------------------------------------------------------------------- 1 | .wrapper{ width: 424px;margin: 10px auto; zoom:1;position: relative} 2 | .tabbody{height:225px;} 3 | .tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;} 4 | .tabbody .focus { display: block;} 5 | 6 | body{font-size: 12px;color: #888;overflow: hidden;} 7 | input,label{vertical-align:middle} 8 | .clear{clear: both;} 9 | .pl{padding-left: 18px;padding-left: 23px\9;} 10 | 11 | #imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;} 12 | #imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;} 13 | #imageList img {cursor: pointer;border: 2px solid white;} 14 | 15 | .bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;} 16 | .content div{margin: 10px 0 10px 5px;} 17 | .content .iptradio{margin: 0px 5px 5px 0px;} 18 | .txt{width:280px;} 19 | 20 | .wrapcolor{height: 19px;} 21 | div.color{float: left;margin: 0;} 22 | #colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0;float: left;} 23 | div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;} 24 | #custom input{height: 15px;min-height: 15px;width:20px;} 25 | #repeatType{width:100px;} 26 | 27 | 28 | /* 图片管理样式 */ 29 | #imgManager { 30 | width: 100%; 31 | height: 225px; 32 | } 33 | #imgManager #imageList{ 34 | width: 100%; 35 | overflow-x: hidden; 36 | overflow-y: auto; 37 | } 38 | #imgManager ul { 39 | display: block; 40 | list-style: none; 41 | margin: 0; 42 | padding: 0; 43 | } 44 | #imgManager li { 45 | float: left; 46 | display: block; 47 | list-style: none; 48 | padding: 0; 49 | width: 113px; 50 | height: 113px; 51 | margin: 9px 0 0 19px; 52 | background-color: #eee; 53 | overflow: hidden; 54 | cursor: pointer; 55 | position: relative; 56 | } 57 | #imgManager li.clearFloat { 58 | float: none; 59 | clear: both; 60 | display: block; 61 | width:0; 62 | height:0; 63 | margin: 0; 64 | padding: 0; 65 | } 66 | #imgManager li img { 67 | cursor: pointer; 68 | } 69 | #imgManager li .icon { 70 | cursor: pointer; 71 | width: 113px; 72 | height: 113px; 73 | position: absolute; 74 | top: 0; 75 | left: 0; 76 | z-index: 2; 77 | border: 0; 78 | background-repeat: no-repeat; 79 | } 80 | #imgManager li .icon:hover { 81 | width: 107px; 82 | height: 107px; 83 | border: 3px solid #1094fa; 84 | } 85 | #imgManager li.selected .icon { 86 | background-image: url(images/success.png); 87 | background-position: 75px 75px; 88 | } 89 | #imgManager li.selected .icon:hover { 90 | width: 107px; 91 | height: 107px; 92 | border: 3px solid #1094fa; 93 | background-position: 72px 72px; 94 | } -------------------------------------------------------------------------------- /public/ueditor/dialogs/background/background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 |
14 |
15 |
16 |
17 | 18 |
19 |
20 | 21 | 22 |
23 |
24 |
25 | : 26 |
27 |
28 |
29 |
30 |
31 | 32 |
33 |
34 | : 41 |
42 |
43 | :x:px  y:px 44 |
45 |
46 |
47 | 48 |
49 |
50 |
51 |
52 |
53 |
54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/background/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/background/images/bg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/background/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/background/images/success.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/chart.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 图表配置文件 3 | * */ 4 | 5 | 6 | //不同类型的配置 7 | var typeConfig = [ 8 | { 9 | chart: { 10 | type: 'line' 11 | }, 12 | plotOptions: { 13 | line: { 14 | dataLabels: { 15 | enabled: false 16 | }, 17 | enableMouseTracking: true 18 | } 19 | } 20 | }, { 21 | chart: { 22 | type: 'line' 23 | }, 24 | plotOptions: { 25 | line: { 26 | dataLabels: { 27 | enabled: true 28 | }, 29 | enableMouseTracking: false 30 | } 31 | } 32 | }, { 33 | chart: { 34 | type: 'area' 35 | } 36 | }, { 37 | chart: { 38 | type: 'bar' 39 | } 40 | }, { 41 | chart: { 42 | type: 'column' 43 | } 44 | }, { 45 | chart: { 46 | plotBackgroundColor: null, 47 | plotBorderWidth: null, 48 | plotShadow: false 49 | }, 50 | plotOptions: { 51 | pie: { 52 | allowPointSelect: true, 53 | cursor: 'pointer', 54 | dataLabels: { 55 | enabled: true, 56 | color: '#000000', 57 | connectorColor: '#000000', 58 | formatter: function() { 59 | return ''+ this.point.name +': '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %'; 60 | } 61 | } 62 | } 63 | } 64 | } 65 | ]; 66 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/charts.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | width: 100%; 3 | height: 100%; 4 | margin: 0; 5 | padding: 0; 6 | overflow-x: hidden; 7 | } 8 | 9 | .main { 10 | width: 100%; 11 | overflow: hidden; 12 | } 13 | 14 | .table-view { 15 | height: 100%; 16 | float: left; 17 | margin: 20px; 18 | width: 40%; 19 | } 20 | 21 | .table-view .table-container { 22 | width: 100%; 23 | margin-bottom: 50px; 24 | overflow: scroll; 25 | } 26 | 27 | .table-view th { 28 | padding: 5px 10px; 29 | background-color: #F7F7F7; 30 | } 31 | 32 | .table-view td { 33 | width: 50px; 34 | text-align: center; 35 | padding:0; 36 | } 37 | 38 | .table-container input { 39 | width: 40px; 40 | padding: 5px; 41 | border: none; 42 | outline: none; 43 | } 44 | 45 | .table-view caption { 46 | font-size: 18px; 47 | text-align: left; 48 | } 49 | 50 | .charts-view { 51 | /*margin-left: 49%!important;*/ 52 | width: 50%; 53 | margin-left: 49%; 54 | height: 400px; 55 | } 56 | 57 | .charts-container { 58 | border-left: 1px solid #c3c3c3; 59 | } 60 | 61 | .charts-format fieldset { 62 | padding-left: 20px; 63 | margin-bottom: 50px; 64 | } 65 | 66 | .charts-format legend { 67 | padding-left: 10px; 68 | padding-right: 10px; 69 | } 70 | 71 | .format-item-container { 72 | padding: 20px; 73 | } 74 | 75 | .format-item-container label { 76 | display: block; 77 | margin: 10px 0; 78 | } 79 | 80 | .charts-format .data-item { 81 | border: 1px solid black; 82 | outline: none; 83 | padding: 2px 3px; 84 | } 85 | 86 | /* 图表类型 */ 87 | 88 | .charts-type { 89 | margin-top: 50px; 90 | height: 300px; 91 | } 92 | 93 | .scroll-view { 94 | border: 1px solid #c3c3c3; 95 | border-left: none; 96 | border-right: none; 97 | overflow: hidden; 98 | } 99 | 100 | .scroll-container { 101 | margin: 20px; 102 | width: 100%; 103 | overflow: hidden; 104 | } 105 | 106 | .scroll-bed { 107 | width: 10000px; 108 | _margin-top: 20px; 109 | -webkit-transition: margin-left .5s ease; 110 | -moz-transition: margin-left .5s ease; 111 | transition: margin-left .5s ease; 112 | } 113 | 114 | .view-box { 115 | display: inline-block; 116 | *display: inline; 117 | *zoom: 1; 118 | margin-right: 20px; 119 | border: 2px solid white; 120 | line-height: 0; 121 | overflow: hidden; 122 | cursor: pointer; 123 | } 124 | 125 | .view-box img { 126 | border: 1px solid #cecece; 127 | } 128 | 129 | .view-box.selected { 130 | border-color: #7274A7; 131 | } 132 | 133 | .button-container { 134 | margin-bottom: 20px; 135 | text-align: center; 136 | } 137 | 138 | .button-container a { 139 | display: inline-block; 140 | width: 100px; 141 | height: 25px; 142 | line-height: 25px; 143 | border: 1px solid #c2ccd1; 144 | margin-right: 30px; 145 | text-decoration: none; 146 | color: black; 147 | -webkit-border-radius: 2px; 148 | -moz-border-radius: 2px; 149 | border-radius: 2px; 150 | } 151 | 152 | .button-container a:HOVER { 153 | background: #fcfcfc; 154 | } 155 | 156 | .button-container a:ACTIVE { 157 | border-top-color: #c2ccd1; 158 | box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1); 159 | } 160 | 161 | .edui-charts-not-data { 162 | height: 100px; 163 | line-height: 100px; 164 | text-align: center; 165 | } -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts0.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts1.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts2.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts3.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts4.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/charts/images/charts5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/charts/images/charts5.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/emotion.css: -------------------------------------------------------------------------------- 1 | .jd img{ 2 | background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; 3 | cursor:pointer;width:35px;height:35px;display:block; 4 | } 5 | .pp img{ 6 | background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; 7 | cursor:pointer;width:25px;height:25px;display:block; 8 | } 9 | .ldw img{ 10 | background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; 11 | cursor:pointer;width:35px;height:35px;display:block; 12 | } 13 | .tsj img{ 14 | background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; 15 | cursor:pointer;width:35px;height:35px;display:block; 16 | } 17 | .cat img{ 18 | background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; 19 | cursor:pointer;width:35px;height:35px;display:block; 20 | } 21 | .bb img{ 22 | background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; 23 | cursor:pointer;width:35px;height:35px;display:block; 24 | } 25 | .youa img{ 26 | background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; 27 | cursor:pointer;width:35px;height:35px;display:block; 28 | } 29 | 30 | .smileytable td {height: 37px;} 31 | #tabPanel{margin-left:5px;overflow: hidden;} 32 | #tabContent {float:left;background:#FFFFFF;} 33 | #tabContent div{display: none;width:480px;overflow:hidden;} 34 | #tabIconReview.show{left:17px;display:block;} 35 | .menuFocus{background:#ACCD3C;} 36 | .menuDefault{background:#FFFFFF;} 37 | #tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;} 38 | img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;} 39 | 40 | .wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;} 41 | .tabbody table{width: 100%;} 42 | .tabbody td{border:1px solid #BAC498;} 43 | .tabbody td span{display: block;zoom:1;padding:0 4px;} -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/emotion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | 33 |
34 | 35 | 53 | 54 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/0.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/bface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/bface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/cface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/cface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/fface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/fface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/jxface2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/jxface2.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/neweditor-tab-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/neweditor-tab-bg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/tface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/tface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/wface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/wface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/emotion/images/yface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/emotion/images/yface.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/gmap/gmap.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 |
27 | 88 | 89 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/help/help.css: -------------------------------------------------------------------------------- 1 | .wrapper{width: 370px;margin: 10px auto;zoom: 1;} 2 | .tabbody{height: 360px;} 3 | .tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;} 4 | .tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;} 5 | .tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;} 6 | .tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;} 7 | .tabbody table thead{font-weight: bold;line-height: 25px;} -------------------------------------------------------------------------------- /public/ueditor/dialogs/help/help.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 帮助 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 |
18 |

UEditor

19 |

20 |

21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
ctrl+b
ctrl+c
ctrl+x
ctrl+v
ctrl+y
ctrl+z
ctrl+i
ctrl+u
ctrl+a
shift+enter
alt+z
77 |
78 |
79 |
80 | 81 | 82 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/help/help.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 12-9-26 5 | * Time: 下午1:06 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | /** 9 | * tab点击处理事件 10 | * @param tabHeads 11 | * @param tabBodys 12 | * @param obj 13 | */ 14 | function clickHandler( tabHeads,tabBodys,obj ) { 15 | //head样式更改 16 | for ( var k = 0, len = tabHeads.length; k < len; k++ ) { 17 | tabHeads[k].className = ""; 18 | } 19 | obj.className = "focus"; 20 | //body显隐 21 | var tabSrc = obj.getAttribute( "tabSrc" ); 22 | for ( var j = 0, length = tabBodys.length; j < length; j++ ) { 23 | var body = tabBodys[j], 24 | id = body.getAttribute( "id" ); 25 | body.onclick = function(){ 26 | this.style.zoom = 1; 27 | }; 28 | if ( id != tabSrc ) { 29 | body.style.zIndex = 1; 30 | } else { 31 | body.style.zIndex = 200; 32 | } 33 | } 34 | 35 | } 36 | 37 | /** 38 | * TAB切换 39 | * @param tabParentId tab的父节点ID或者对象本身 40 | */ 41 | function switchTab( tabParentId ) { 42 | var tabElements = $G( tabParentId ).children, 43 | tabHeads = tabElements[0].children, 44 | tabBodys = tabElements[1].children; 45 | 46 | for ( var i = 0, length = tabHeads.length; i < length; i++ ) { 47 | var head = tabHeads[i]; 48 | if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); 49 | head.onclick = function () { 50 | clickHandler(tabHeads,tabBodys,this); 51 | } 52 | } 53 | } 54 | switchTab("helptab"); 55 | 56 | document.getElementById('version').innerHTML = parent.UE.version; -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/alignicon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/alignicon.jpg -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/bg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/icons.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/icons.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/image.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/progress.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/success.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/image/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/image/images/success.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/internal.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var parent = window.parent; 3 | //dialog对象 4 | dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )]; 5 | //当前打开dialog的编辑器实例 6 | editor = dialog.editor; 7 | 8 | UE = parent.UE; 9 | 10 | domUtils = UE.dom.domUtils; 11 | 12 | utils = UE.utils; 13 | 14 | browser = UE.browser; 15 | 16 | ajax = UE.ajax; 17 | 18 | $G = function ( id ) { 19 | return document.getElementById( id ) 20 | }; 21 | //focus元素 22 | $focus = function ( node ) { 23 | setTimeout( function () { 24 | if ( browser.ie ) { 25 | var r = node.createTextRange(); 26 | r.collapse( false ); 27 | r.select(); 28 | } else { 29 | node.focus() 30 | } 31 | }, 0 ) 32 | }; 33 | utils.loadFile(document,{ 34 | href:editor.options.themePath + editor.options.theme + "/dialogbase.css?cache="+Math.random(), 35 | tag:"link", 36 | type:"text/css", 37 | rel:"stylesheet" 38 | }); 39 | lang = editor.getLang(dialog.className.split( "-" )[2]); 40 | if(lang){ 41 | domUtils.on(window,'load',function () { 42 | 43 | var langImgPath = editor.options.langPath + editor.options.lang + "/images/"; 44 | //针对静态资源 45 | for ( var i in lang["static"] ) { 46 | var dom = $G( i ); 47 | if(!dom) continue; 48 | var tagName = dom.tagName, 49 | content = lang["static"][i]; 50 | if(content.src){ 51 | //clone 52 | content = utils.extend({},content,false); 53 | content.src = langImgPath + content.src; 54 | } 55 | if(content.style){ 56 | content = utils.extend({},content,false); 57 | content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath) 58 | } 59 | switch ( tagName.toLowerCase() ) { 60 | case "var": 61 | dom.parentNode.replaceChild( document.createTextNode( content ), dom ); 62 | break; 63 | case "select": 64 | var ops = dom.options; 65 | for ( var j = 0, oj; oj = ops[j]; ) { 66 | oj.innerHTML = content.options[j++]; 67 | } 68 | for ( var p in content ) { 69 | p != "options" && dom.setAttribute( p, content[p] ); 70 | } 71 | break; 72 | default : 73 | domUtils.setAttributes( dom, content); 74 | } 75 | } 76 | } ); 77 | } 78 | 79 | 80 | })(); 81 | 82 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/music/music.css: -------------------------------------------------------------------------------- 1 | .wrapper{margin: 5px 10px;} 2 | 3 | .searchBar{height:30px;padding:7px 0 3px;text-align:center;} 4 | .searchBtn{font-size:13px;height:24px;} 5 | 6 | .resultBar{width:460px;margin:5px auto;border: 1px solid #CCC;border-radius: 5px;box-shadow: 2px 2px 5px #D3D6DA;overflow: hidden;} 7 | 8 | .listPanel{overflow: hidden;} 9 | .panelon{display:block;} 10 | .paneloff{display:none} 11 | 12 | .page{width:220px;margin:20px auto;overflow: hidden;} 13 | .pageon{float:right;width:24px;line-height:24px;height:24px;margin-right: 5px;background: none;border: none;color: #000;font-weight: bold;text-align:center} 14 | .pageoff{float:right;width:24px;line-height:24px;height:24px;cursor:pointer;background-color: #fff; 15 | border: 1px solid #E7ECF0;color: #2D64B3;margin-right: 5px;text-decoration: none;text-align:center;} 16 | 17 | .m-box{width:460px;} 18 | .m-m{float: left;line-height: 20px;height: 20px;} 19 | .m-h{height:24px;line-height:24px;padding-left: 46px;background-color:#FAFAFA;border-bottom: 1px solid #DAD8D8;font-weight: bold;font-size: 12px;color: #333;} 20 | .m-l{float:left;width:40px; } 21 | .m-t{float:left;width:140px;} 22 | .m-s{float:left;width:110px;} 23 | .m-z{float:left;width:100px;} 24 | .m-try-t{float: left;width: 60px;;} 25 | 26 | .m-try{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/try_music.gif') no-repeat ;} 27 | .m-trying{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/stop_music.gif') no-repeat ;} 28 | 29 | .loading{width:95px;height:7px;font-size:7px;margin:60px auto;background:url(http://static.tieba.baidu.com/tb/editor/images/loading.gif) no-repeat} 30 | .empty{width:300px;height:40px;padding:2px;margin:50px auto;line-height:40px; color:#006699;text-align:center;} -------------------------------------------------------------------------------- /public/ueditor/dialogs/music/music.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 插入音乐 6 | 7 | 8 | 9 | 10 |
11 | 15 |
16 | 17 |
18 |
19 |
20 |
21 | 22 | 31 | 32 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/preview/preview.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | 40 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/addimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/addimg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/brush.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/delimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/delimg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/delimgH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/delimgH.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/empty.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/emptyH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/emptyH.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/eraser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/eraser.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/redo.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/redoH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/redoH.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/scale.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/scaleH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/scaleH.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/size.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/undo.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/images/undoH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/scrawl/images/undoH.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/scrawl.css: -------------------------------------------------------------------------------- 1 | /*common 2 | */ 3 | body{margin: 0;} 4 | table{width:100%;} 5 | table td{padding:2px 4px;vertical-align: middle;} 6 | a{text-decoration: none;} 7 | em{font-style: normal;} 8 | .border_style1{border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} 9 | /*module 10 | */ 11 | .main{margin: 8px;overflow: hidden;} 12 | 13 | .hot{float:left;height:335px;} 14 | .drawBoard{position: relative; cursor: crosshair;} 15 | .brushBorad{position: absolute;left:0;top:0;z-index: 998;} 16 | .picBoard{border: none;text-align: center;line-height: 300px;cursor: default;} 17 | .operateBar{margin-top:10px;font-size:12px;text-align: center;} 18 | .operateBar span{margin-left: 10px;} 19 | 20 | .drawToolbar{float:right;width:110px;height:300px;overflow: hidden;} 21 | .colorBar{margin-top:10px;font-size: 12px;text-align: center;} 22 | .colorBar a{display:block;width: 10px;height: 10px;border:1px solid #1006F1;border-radius: 3px; box-shadow:2px 2px 5px #d3d6da;opacity: 0.3} 23 | .sectionBar{margin-top:15px;font-size: 12px;text-align: center;} 24 | .sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3} 25 | .size1{background: url('images/size.png') 1px center no-repeat ;} 26 | .size2{background: url('images/size.png') -10px center no-repeat;} 27 | .size3{background: url('images/size.png') -22px center no-repeat;} 28 | .size4{background: url('images/size.png') -35px center no-repeat;} 29 | 30 | .addImgH{position: relative;} 31 | .addImgH_form{position: absolute;left: 18px;top: -1px;width: 75px;height: 21px;opacity: 0;cursor: pointer;} 32 | .addImgH_form input{width: 100%;} 33 | /*scrawl遮罩层 34 | */ 35 | .maskLayerNull{display: none;} 36 | .maskLayer{position: absolute;top:0;left:0;width: 100%; height: 100%;opacity: 0.7; 37 | background-color: #fff;text-align:center;font-weight:bold;line-height:300px;z-index: 1000;} 38 | /*btn state 39 | */ 40 | .previousStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undoH.png');cursor: pointer;} 41 | .previousStepH .text{color:#888;cursor:pointer;} 42 | .previousStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undo.png');cursor:default;} 43 | .previousStep .text{color:#ccc;cursor:default;} 44 | 45 | .nextStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redoH.png');cursor: pointer;} 46 | .nextStepH .text{color:#888;cursor:pointer;} 47 | .nextStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redo.png');cursor:default;} 48 | .nextStep .text{color:#ccc;cursor:default;} 49 | 50 | .clearBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/emptyH.png');cursor: pointer;} 51 | .clearBoardH .text{color:#888;cursor:pointer;} 52 | .clearBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/empty.png');cursor:default;} 53 | .clearBoard .text{color:#ccc;cursor:default;} 54 | 55 | .scaleBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scaleH.png');cursor: pointer;} 56 | .scaleBoardH .text{color:#888;cursor:pointer;} 57 | .scaleBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scale.png');cursor:default;} 58 | .scaleBoard .text{color:#ccc;cursor:default;} 59 | 60 | .removeImgH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimgH.png');cursor: pointer;} 61 | .removeImgH .text{color:#888;cursor:pointer;} 62 | .removeImg .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimg.png');cursor:default;} 63 | .removeImg .text{color:#ccc;cursor:default;} 64 | 65 | .addImgH .icon{vertical-align:top;display: inline-block;width:16px;height:16px;background-image: url('images/addimg.png')} 66 | .addImgH .text{color:#888;cursor:pointer;} 67 | /*icon 68 | */ 69 | .brushIcon{display: inline-block;width:16px;height:16px;background-image: url('images/brush.png')} 70 | .eraserIcon{display: inline-block;width:16px;height:16px;background-image: url('images/eraser.png')} 71 | 72 | 73 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/scrawl/scrawl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 |
37 |
38 |
39 | 40 | 1 41 | 3 42 | 5 43 | 7 44 |
45 |
46 | 47 | 1 48 | 3 49 | 5 50 | 7 51 |
52 |
53 |
54 | 55 | 56 |
57 | 59 |
60 | 61 |
62 |
63 |
64 | 65 | 66 | 67 | 68 |
69 |
70 |
71 |
72 | 73 | 74 | 94 | 95 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/snapscreen/snapscreen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 47 | 48 | 49 |
50 |

51 |
52 |
53 |
54 |
55 |
56 |
57 | 58 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/spechars/spechars.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 |
17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/spechars/spechars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 12-9-26 5 | * Time: 下午1:09 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | var charsContent = [ 9 | { name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")}, 10 | { name:"lmsz", title:lang.lmsz, content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")}, 11 | { name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")}, 12 | { name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")}, 13 | { name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")}, 14 | { name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")}, 15 | { name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")}, 16 | { name:"yyyb", title:lang.yyyb, content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")}, 17 | { name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")} 18 | ]; 19 | (function createTab(content) { 20 | for (var i = 0, ci; ci = content[i++];) { 21 | var span = document.createElement("span"); 22 | span.setAttribute("tabSrc", ci.name); 23 | span.innerHTML = ci.title; 24 | if (i == 1)span.className = "focus"; 25 | domUtils.on(span, "click", function () { 26 | var tmps = $G("tabHeads").children; 27 | for (var k = 0, sk; sk = tmps[k++];) { 28 | sk.className = ""; 29 | } 30 | tmps = $G("tabBodys").children; 31 | for (var k = 0, sk; sk = tmps[k++];) { 32 | sk.style.display = "none"; 33 | } 34 | this.className = "focus"; 35 | $G(this.getAttribute("tabSrc")).style.display = ""; 36 | }); 37 | $G("tabHeads").appendChild(span); 38 | domUtils.insertAfter(span, document.createTextNode("\n")); 39 | var div = document.createElement("div"); 40 | div.id = ci.name; 41 | div.style.display = (i == 1) ? "" : "none"; 42 | var cons = ci.content; 43 | for (var j = 0, con; con = cons[j++];) { 44 | var charSpan = document.createElement("span"); 45 | charSpan.innerHTML = con; 46 | domUtils.on(charSpan, "click", function () { 47 | editor.execCommand("insertHTML", this.innerHTML); 48 | dialog.close(); 49 | }); 50 | div.appendChild(charSpan); 51 | } 52 | $G("tabBodys").appendChild(div); 53 | } 54 | })(charsContent); 55 | function toArray(str) { 56 | return str.split(","); 57 | } 58 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/table/dragicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/table/dragicon.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/table/edittable.css: -------------------------------------------------------------------------------- 1 | body{ 2 | overflow: hidden; 3 | width: 540px; 4 | } 5 | .wrapper { 6 | margin: 10px auto 0; 7 | font-size: 12px; 8 | overflow: hidden; 9 | width: 520px; 10 | height: 315px; 11 | } 12 | 13 | .clear { 14 | clear: both; 15 | } 16 | 17 | .wrapper .left { 18 | float: left; 19 | margin-left: 10px;; 20 | } 21 | 22 | .wrapper .right { 23 | float: right; 24 | border-left: 2px dotted #EDEDED; 25 | padding-left: 15px; 26 | } 27 | 28 | .section { 29 | margin-bottom: 15px; 30 | width: 240px; 31 | overflow: hidden; 32 | } 33 | 34 | .section h3 { 35 | font-weight: bold; 36 | padding: 5px 0; 37 | margin-bottom: 10px; 38 | border-bottom: 1px solid #EDEDED; 39 | font-size: 12px; 40 | } 41 | 42 | .section ul { 43 | list-style: none; 44 | overflow: hidden; 45 | clear: both; 46 | 47 | } 48 | 49 | .section li { 50 | float: left; 51 | width: 120px;; 52 | } 53 | 54 | .section .tone { 55 | width: 80px;; 56 | } 57 | 58 | .section .preview { 59 | width: 220px; 60 | } 61 | 62 | .section .preview table { 63 | text-align: center; 64 | vertical-align: middle; 65 | color: #666; 66 | } 67 | 68 | .section .preview caption { 69 | font-weight: bold; 70 | } 71 | 72 | .section .preview td { 73 | border-width: 1px; 74 | border-style: solid; 75 | height: 22px; 76 | } 77 | 78 | .section .preview th { 79 | border-style: solid; 80 | border-color: #DDD; 81 | border-width: 2px 1px 1px 1px; 82 | height: 22px; 83 | background-color: #F7F7F7; 84 | } -------------------------------------------------------------------------------- /public/ueditor/dialogs/table/edittable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |

13 |
    14 |
  • 15 | 16 |
  • 17 |
  • 18 | 19 |
  • 20 |
21 |
    22 |
  • 23 | 24 |
  • 25 |
  • 26 | 27 |
  • 28 |
29 |
30 |
31 |
32 |

33 |
    34 |
  • 35 | 36 |
  • 37 |
  • 38 | 39 |
  • 40 |
41 |
42 |
43 |
44 |

45 |
    46 |
  • 47 | 48 | 49 |
  • 50 |
51 |
52 |
53 |
54 |
55 |
56 |

57 |
58 |
59 |
60 |
61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/table/edittd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 60 | 61 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/table/edittip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 表格删除提示 5 | 6 | 17 | 18 | 19 |
20 |
21 | 22 |
23 |
24 | 25 |
26 |
27 | 32 | 33 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/bg.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/pre0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/pre0.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/pre1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/pre1.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/pre2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/pre2.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/pre3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/pre3.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/images/pre4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/template/images/pre4.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/template.css: -------------------------------------------------------------------------------- 1 | .wrap{ padding: 5px;font-size: 14px;} 2 | .left{width:425px;float: left;} 3 | .right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;} 4 | .right .pre{height: 332px;overflow-y: auto;} 5 | .right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;} 6 | .right .preitem:hover{background-color: lemonChiffon;cursor: pointer;border: #ccc 1px solid;} 7 | .right .preitem img{display: block;margin: 0 auto;width:100px;} 8 | .clear{clear: both;} 9 | .top{height:26px;line-height: 26px;padding: 5px;} 10 | .bottom{height:320px;width:100%;margin: 0 auto;} 11 | .transparent{ background: url("images/bg.gif") repeat;} 12 | .bottom table tr td{border:1px dashed #ccc;} 13 | #colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;} 14 | .border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} 15 | p{margin: 5px 0} 16 | table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;} 17 | li{clear:both} 18 | ol{padding-left:40px; } -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 |
13 | 14 |
15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/template/template.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 12-8-8 5 | * Time: 下午2:09 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | (function () { 9 | var me = editor, 10 | preview = $G( "preview" ), 11 | preitem = $G( "preitem" ), 12 | tmps = templates, 13 | currentTmp; 14 | var initPre = function () { 15 | var str = ""; 16 | for ( var i = 0, tmp; tmp = tmps[i++]; ) { 17 | str += '
'; 18 | } 19 | preitem.innerHTML = str; 20 | }; 21 | var pre = function ( n ) { 22 | var tmp = tmps[n - 1]; 23 | currentTmp = tmp; 24 | clearItem(); 25 | domUtils.setStyles( preitem.childNodes[n - 1], { 26 | "background-color":"lemonChiffon", 27 | "border":"#ccc 1px solid" 28 | } ); 29 | preview.innerHTML = tmp.preHtml ? tmp.preHtml : ""; 30 | }; 31 | var clearItem = function () { 32 | var items = preitem.children; 33 | for ( var i = 0, item; item = items[i++]; ) { 34 | domUtils.setStyles( item, { 35 | "background-color":"", 36 | "border":"white 1px solid" 37 | } ); 38 | } 39 | }; 40 | dialog.onok = function () { 41 | if ( !$G( "issave" ).checked ){ 42 | me.execCommand( "cleardoc" ); 43 | } 44 | var obj = { 45 | html:currentTmp && currentTmp.html 46 | }; 47 | me.execCommand( "template", obj ); 48 | }; 49 | initPre(); 50 | window.pre = pre; 51 | pre(2) 52 | 53 | })(); -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/bg.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/center_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/center_focus.jpg -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/file-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/file-icons.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/file-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/file-icons.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/icons.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/icons.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/image.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/left_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/left_focus.jpg -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/none_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/none_focus.jpg -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/progress.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/right_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/right_focus.jpg -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/success.gif -------------------------------------------------------------------------------- /public/ueditor/dialogs/video/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/video/images/success.png -------------------------------------------------------------------------------- /public/ueditor/dialogs/webapp/webapp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 |
15 |
16 |
17 | 52 | 53 | -------------------------------------------------------------------------------- /public/ueditor/dialogs/wordimage/fClipboard_ueditor.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/wordimage/fClipboard_ueditor.swf -------------------------------------------------------------------------------- /public/ueditor/dialogs/wordimage/imageUploader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/dialogs/wordimage/imageUploader.swf -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/addimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/addimage.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/alldeletebtnhoverskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/alldeletebtnhoverskin.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/alldeletebtnupskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/alldeletebtnupskin.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/background.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/button.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/copy.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/deletedisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/deletedisable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/deleteenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/deleteenable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/listbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/listbackground.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/localimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/localimage.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/music.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/rotateleftdisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/rotateleftdisable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/rotateleftenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/rotateleftenable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/rotaterightdisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/rotaterightdisable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/rotaterightenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/rotaterightenable.png -------------------------------------------------------------------------------- /public/ueditor/lang/en/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/en/images/upload.png -------------------------------------------------------------------------------- /public/ueditor/lang/zh-cn/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/zh-cn/images/copy.png -------------------------------------------------------------------------------- /public/ueditor/lang/zh-cn/images/localimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/zh-cn/images/localimage.png -------------------------------------------------------------------------------- /public/ueditor/lang/zh-cn/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/zh-cn/images/music.png -------------------------------------------------------------------------------- /public/ueditor/lang/zh-cn/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/lang/zh-cn/images/upload.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/dialogbase.css: -------------------------------------------------------------------------------- 1 | /*弹出对话框页面样式组件 2 | */ 3 | 4 | /*reset 5 | */ 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, font, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td { 15 | margin: 0; 16 | padding: 0; 17 | outline: 0; 18 | font-size: 100%; 19 | } 20 | 21 | body { 22 | line-height: 1; 23 | } 24 | 25 | ol, ul { 26 | list-style: none; 27 | } 28 | 29 | blockquote, q { 30 | quotes: none; 31 | } 32 | 33 | ins { 34 | text-decoration: none; 35 | } 36 | 37 | del { 38 | text-decoration: line-through; 39 | } 40 | 41 | table { 42 | border-collapse: collapse; 43 | border-spacing: 0; 44 | } 45 | 46 | /*module 47 | */ 48 | body { 49 | background-color: #fff; 50 | font: 12px/1.5 sans-serif, "宋体", "Arial Narrow", HELVETICA; 51 | color: #646464; 52 | } 53 | 54 | /*tab*/ 55 | .tabhead { 56 | position: relative; 57 | z-index: 10; 58 | } 59 | 60 | .tabhead span { 61 | display: inline-block; 62 | padding: 0 5px; 63 | height: 30px; 64 | border: 1px solid #ccc; 65 | background: url("images/dialog-title-bg.png") repeat-x; 66 | text-align: center; 67 | line-height: 30px; 68 | cursor: pointer; 69 | *margin-right: 5px; 70 | } 71 | 72 | .tabhead span.focus { 73 | height: 31px; 74 | border-bottom: none; 75 | background: #fff; 76 | } 77 | 78 | .tabbody { 79 | position: relative; 80 | top: -1px; 81 | margin: 0 auto; 82 | border: 1px solid #ccc; 83 | } 84 | 85 | /*button*/ 86 | a.button { 87 | display: block; 88 | text-align: center; 89 | line-height: 24px; 90 | text-decoration: none; 91 | height: 24px; 92 | width: 95px; 93 | border: 0; 94 | color: #838383; 95 | background: url(../../themes/default/images/icons-all.gif) no-repeat; 96 | } 97 | 98 | a.button:hover { 99 | background-position: 0 -30px; 100 | } -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/anchor.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/arrow.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/arrow_down.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/arrow_up.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/button-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/button-bg.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/cancelbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/cancelbutton.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/charts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/charts.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/cursor_h.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/cursor_h.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/cursor_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/cursor_h.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/cursor_v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/cursor_v.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/cursor_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/cursor_v.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/dialog-title-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/dialog-title-bg.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/filescan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/filescan.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/highlighted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/highlighted.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/icons-all.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/icons-all.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/icons.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/icons.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/img-cracked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/img-cracked.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/loaderror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/loaderror.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/loading.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/lock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/lock.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/neweditor-tab-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/neweditor-tab-bg.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/pagebreak.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/pagebreak.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/scale.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/sortable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/sortable.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/spacer.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/sparator_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/sparator_v.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/table-cell-align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/table-cell-align.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/tangram-colorpicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/tangram-colorpicker.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/toolbar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/toolbar_bg.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/unhighlighted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/unhighlighted.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/upload.png -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/videologo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/videologo.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/word.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/word.gif -------------------------------------------------------------------------------- /public/ueditor/themes/default/images/wordpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/themes/default/images/wordpaste.png -------------------------------------------------------------------------------- /public/ueditor/themes/iframe.css: -------------------------------------------------------------------------------- 1 | /*可以在这里添加你自己的css*/ 2 | -------------------------------------------------------------------------------- /public/ueditor/third-party/codemirror/codemirror.css: -------------------------------------------------------------------------------- 1 | .CodeMirror { 2 | line-height: 1em; 3 | font-family: monospace; 4 | } 5 | 6 | .CodeMirror-scroll { 7 | overflow: auto; 8 | height: 300px; 9 | /* This is needed to prevent an IE[67] bug where the scrolled content 10 | is visible outside of the scrolling box. */ 11 | position: relative; 12 | } 13 | 14 | .CodeMirror-gutter { 15 | position: absolute; left: 0; top: 0; 16 | z-index: 10; 17 | background-color: #f7f7f7; 18 | border-right: 1px solid #eee; 19 | min-width: 2em; 20 | height: 100%; 21 | } 22 | .CodeMirror-gutter-text { 23 | color: #aaa; 24 | text-align: right; 25 | padding: .4em .2em .4em .4em; 26 | white-space: pre !important; 27 | } 28 | .CodeMirror-lines { 29 | padding: .4em; 30 | } 31 | 32 | .CodeMirror pre { 33 | -moz-border-radius: 0; 34 | -webkit-border-radius: 0; 35 | -o-border-radius: 0; 36 | border-radius: 0; 37 | border-width: 0; margin: 0; padding: 0; background: transparent; 38 | font-family: inherit; 39 | font-size: inherit; 40 | padding: 0; margin: 0; 41 | white-space: pre; 42 | word-wrap: normal; 43 | } 44 | 45 | .CodeMirror-wrap pre { 46 | word-wrap: break-word; 47 | white-space: pre-wrap; 48 | } 49 | .CodeMirror-wrap .CodeMirror-scroll { 50 | overflow-x: hidden; 51 | } 52 | 53 | .CodeMirror textarea { 54 | outline: none !important; 55 | } 56 | 57 | .CodeMirror pre.CodeMirror-cursor { 58 | z-index: 10; 59 | position: absolute; 60 | visibility: hidden; 61 | border-left: 1px solid black; 62 | } 63 | .CodeMirror-focused pre.CodeMirror-cursor { 64 | visibility: visible; 65 | } 66 | 67 | span.CodeMirror-selected { background: #d9d9d9; } 68 | .CodeMirror-focused span.CodeMirror-selected { background: #d2dcf8; } 69 | 70 | .CodeMirror-searching {background: #ffa;} 71 | 72 | /* Default theme */ 73 | 74 | .cm-s-default span.cm-keyword {color: #708;} 75 | .cm-s-default span.cm-atom {color: #219;} 76 | .cm-s-default span.cm-number {color: #164;} 77 | .cm-s-default span.cm-def {color: #00f;} 78 | .cm-s-default span.cm-variable {color: black;} 79 | .cm-s-default span.cm-variable-2 {color: #05a;} 80 | .cm-s-default span.cm-variable-3 {color: #085;} 81 | .cm-s-default span.cm-property {color: black;} 82 | .cm-s-default span.cm-operator {color: black;} 83 | .cm-s-default span.cm-comment {color: #a50;} 84 | .cm-s-default span.cm-string {color: #a11;} 85 | .cm-s-default span.cm-string-2 {color: #f50;} 86 | .cm-s-default span.cm-meta {color: #555;} 87 | .cm-s-default span.cm-error {color: #f00;} 88 | .cm-s-default span.cm-qualifier {color: #555;} 89 | .cm-s-default span.cm-builtin {color: #30a;} 90 | .cm-s-default span.cm-bracket {color: #cc7;} 91 | .cm-s-default span.cm-tag {color: #170;} 92 | .cm-s-default span.cm-attribute {color: #00c;} 93 | .cm-s-default span.cm-header {color: #a0a;} 94 | .cm-s-default span.cm-quote {color: #090;} 95 | .cm-s-default span.cm-hr {color: #999;} 96 | .cm-s-default span.cm-link {color: #00c;} 97 | 98 | span.cm-header, span.cm-strong {font-weight: bold;} 99 | span.cm-em {font-style: italic;} 100 | span.cm-emstrong {font-style: italic; font-weight: bold;} 101 | span.cm-link {text-decoration: underline;} 102 | 103 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 104 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 105 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/adapters/mootools-adapter.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.6 (2013-10-04) 3 | MooTools adapter 4 | 5 | (c) 2010-2013 Torstein Hønsi 6 | 7 | License: www.highcharts.com/license 8 | */ 9 | (function(){var e=window,h=document,f=e.MooTools.version.substring(0,3),i=f==="1.2"||f==="1.1",j=i||f==="1.3",g=e.$extend||function(){return Object.append.apply(Object,arguments)};e.HighchartsAdapter={init:function(a){var b=Fx.prototype,c=b.start,d=Fx.Morph.prototype,e=d.compute;b.start=function(b,d){var e=this.element;if(b.d)this.paths=a.init(e,e.d,this.toD);c.apply(this,arguments);return this};d.compute=function(b,c,d){var f=this.paths;if(f)this.element.attr("d",a.step(f[0],f[1],d,this.toD));else return e.apply(this, 10 | arguments)}},adapterRun:function(a,b){if(b==="width"||b==="height")return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=h.getElementsByTagName("head")[0],d=h.createElement("script");d.type="text/javascript";d.src=a;d.onload=b;c.appendChild(d)},animate:function(a,b,c){var d=a.attr,f=c&&c.complete;if(d&&!a.setStyle)a.getStyle=a.attr,a.setStyle=function(){var a=arguments;this.attr.call(this,a[0],a[1][0])},a.$family=function(){return!0};e.HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a), 11 | g({transition:Fx.Transitions.Quad.easeInOut},c));if(d)c.element=a;if(b.d)c.toD=b.d;f&&c.addEvent("complete",f);c.start(b);a.fx=c},each:function(a,b){return i?$each(a,b):Array.each(a,b)},map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){a=a.getPosition();return{left:a.x,top:a.y}},extendWithEvents:function(a){a.addEvent||(a.nodeName?$(a):g(a,new Events))},addEvent:function(a,b,c){typeof b==="string"&&(b=== 12 | "unload"&&(b="beforeunload"),e.HighchartsAdapter.extendWithEvents(a),a.addEvent(b,c))},removeEvent:function(a,b,c){typeof a!=="string"&&a.addEvent&&(b?(b==="unload"&&(b="beforeunload"),c?a.removeEvent(b,c):a.removeEvents&&a.removeEvents(b)):a.removeEvents())},fireEvent:function(a,b,c,d){b={type:b,target:a};b=j?new Event(b):new DOMEvent(b);b=g(b,c);if(!b.target&&b.event)b.target=b.event.target;b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},washMouseEvent:function(a){if(a.page)a.pageX= 13 | a.page.x,a.pageY=a.page.y;return a},stop:function(a){a.fx&&a.fx.cancel()}}})(); 14 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/adapters/prototype-adapter.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.6 (2013-10-04) 3 | Prototype adapter 4 | 5 | @author Michael Nelson, Torstein Hønsi. 6 | 7 | Feel free to use and modify this script. 8 | Highcharts license: www.highcharts.com/license. 9 | */ 10 | var HighchartsAdapter=function(){var f=typeof Effect!=="undefined";return{init:function(a){if(f)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(b,c,d,g){var e;this.element=b;this.key=c;e=b.attr?b.attr(c):$(b).getStyle(c);if(c==="d")this.paths=a.init(b,b.d,d),this.toD=d,e=0,d=1;this.start(Object.extend(g||{},{from:e,to:d,attribute:c}))},setup:function(){HighchartsAdapter._extend(this.element);if(!this.element._highchart_animation)this.element._highchart_animation={};this.element._highchart_animation[this.key]= 11 | this},update:function(b){var c=this.paths,d=this.element;c&&(b=a.step(c[0],c[1],b,this.toD));d.attr?d.element&&d.attr(this.options.attribute,b):(c={},c[this.options.attribute]=b,$(d).setStyle(c))},finish:function(){this.element&&this.element._highchart_animation&&delete this.element._highchart_animation[this.key]}})},adapterRun:function(a,b){return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=$$("head")[0];c&&c.appendChild((new Element("script",{type:"text/javascript",src:a})).observe("load", 12 | b))},addNS:function(a){var b=/^(?:click|mouse(?:down|up|over|move|out))$/;return/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/.test(a)||b.test(a)?a:"h:"+a},addEvent:function(a,b,c){a.addEventListener||a.attachEvent?Event.observe($(a),HighchartsAdapter.addNS(b),c):(HighchartsAdapter._extend(a),a._highcharts_observe(b,c))},animate:function(a,b,c){var d,c=c||{};c.delay=0;c.duration=(c.duration||500)/1E3;c.afterFinish=c.complete;if(f)for(d in b)new Effect.HighchartsTransition($(a), 13 | d,b[d],c);else{if(a.attr)for(d in b)a.attr(d,b[d]);c.complete&&c.complete()}a.attr||$(a).setStyle(b)},stop:function(a){var b;if(a._highcharts_extended&&a._highchart_animation)for(b in a._highchart_animation)a._highchart_animation[b].cancel()},each:function(a,b){$A(a).each(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){return $(a).cumulativeOffset()},fireEvent:function(a,b,c,d){a.fire?a.fire(HighchartsAdapter.addNS(b),c):a._highcharts_extended&&(c=c||{},a._highcharts_fire(b, 14 | c));c&&c.defaultPrevented&&(d=null);d&&d(c)},removeEvent:function(a,b,c){$(a).stopObserving&&(b&&(b=HighchartsAdapter.addNS(b)),$(a).stopObserving(b,c));window===a?Event.stopObserving(a,b,c):(HighchartsAdapter._extend(a),a._highcharts_stop_observing(b,c))},washMouseEvent:function(a){return a},grep:function(a,b){return a.findAll(b)},map:function(a,b){return a.map(b)},_extend:function(a){a._highcharts_extended||Object.extend(a,{_highchart_events:{},_highchart_animation:null,_highcharts_extended:!0, 15 | _highcharts_observe:function(b,a){this._highchart_events[b]=[this._highchart_events[b],a].compact().flatten()},_highcharts_stop_observing:function(b,a){b?a?this._highchart_events[b]=[this._highchart_events[b]].compact().flatten().without(a):delete this._highchart_events[b]:this._highchart_events={}},_highcharts_fire:function(a,c){var d=this;(this._highchart_events[a]||[]).each(function(a){if(!c.stopped)c.preventDefault=function(){c.defaultPrevented=!0},c.target=d,a.bind(this)(c)===!1&&c.preventDefault()}.bind(this))}})}}}(); 16 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/modules/annotations.js: -------------------------------------------------------------------------------- 1 | (function(i,C){function m(a){return typeof a==="number"}function n(a){return a!==D&&a!==null}var D,p,r,s=i.Chart,t=i.extend,z=i.each;r=["path","rect","circle"];p={top:0,left:0,center:0.5,middle:0.5,bottom:1,right:1};var u=C.inArray,A=i.merge,B=function(){this.init.apply(this,arguments)};B.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b,f;f={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",fill:"transparent",strokeWidth:2}}};b={circle:{params:{x:0, 2 | y:0}}};if(b[c])f.shape=A(f.shape,b[c]);this.options=A({},f,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,h=this.options,i=h.title,l=h.shape;if(!b)b=this.group=c.g();if(!e&&l&&u(l.type,r)!==-1)e=this.shape=c[h.shape.type](l.params),e.add(b);if(!f&&i)f=this.title=c.label(i),f.add(b);b.add(d.annotations.group);this.linkObjects();a!==!1&&this.redraw()},redraw:function(){var a=this.options,d=this.chart,c=this.group,b=this.title,f=this.shape,e=this.linkedObject, 3 | h=d.xAxis[a.xAxis],v=d.yAxis[a.yAxis],l=a.width,w=a.height,x=p[a.anchorY],y=p[a.anchorX],j,o,g,q;if(e)j=e instanceof i.Point?"point":e instanceof i.Series?"series":null,j==="point"?(a.xValue=e.x,a.yValue=e.y,o=e.series):j==="series"&&(o=e),c.visibility!==o.group.visibility&&c.attr({visibility:o.group.visibility});e=n(a.xValue)?h.toPixels(a.xValue+h.minPointOffset)-h.minPixelPadding:a.x;j=n(a.yValue)?v.toPixels(a.yValue):a.y;if(!isNaN(e)&&!isNaN(j)&&m(e)&&m(j)){b&&(b.attr(a.title),b.css(a.title.style)); 4 | if(f){b=t({},a.shape.params);if(a.units==="values"){for(g in b)u(g,["width","x"])>-1?b[g]=h.translate(b[g]):u(g,["height","y"])>-1&&(b[g]=v.translate(b[g]));b.width&&(b.width-=h.toPixels(0)-h.left);b.x&&(b.x+=h.minPixelPadding);if(a.shape.type==="path"){g=b.d;o=e;for(var r=j,s=g.length,k=0;k-1&&d.splice(c,1);z(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){t(this.options,a);this.linkObjects();this.render(d)}, 6 | linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;if(n(b)){if(!n(d)||b!==c)this.linkedObject=a.get(b)}else this.linkedObject=null}};t(s.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;Object.prototype.toString.call(a)==="[object Array]"||(a=[a]);for(e=a.length;e--;)f=new B(b,a[e]),c.push(f),f.render(d)},redraw:function(){z(this.allItems,function(a){a.redraw()})}}});s.prototype.callbacks.push(function(a){var d= 7 | a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;Object.prototype.toString.call(d)==="[object Array]"&&d.length>0&&a.annotations.add(a.options.annotations);i.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(Highcharts,HighchartsAdapter); 8 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/modules/funnel.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Highcharts funnel module, Beta 4 | 5 | (c) 2010-2012 Torstein Hønsi 6 | 7 | License: www.highcharts.com/license 8 | */ 9 | (function(d){var u=d.getOptions().plotOptions,p=d.seriesTypes,D=d.merge,z=function(){},A=d.each;u.funnel=D(u.pie,{center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}});p.funnel=d.extendClass(p.pie,{type:"funnel",animate:z,translate:function(){var a=function(k,a){return/%$/.test(k)?a*parseInt(k,10)/100:parseInt(k,10)},g=0,e=this.chart,f=e.plotWidth, 10 | e=e.plotHeight,h=0,c=this.options,C=c.center,b=a(C[0],f),d=a(C[0],e),p=a(c.width,f),i,q,j=a(c.height,e),r=a(c.neckWidth,f),s=a(c.neckHeight,e),v=j-s,a=this.data,w,x,u=c.dataLabels.position==="left"?1:0,y,m,B,n,l,t,o;this.getWidthAt=q=function(k){return k>j-s||j===s?r:r+(p-r)*((j-s-k)/(j-s))};this.getX=function(k,a){return b+(a?-1:1)*(q(k)/2+c.dataLabels.distance)};this.center=[b,d,j];this.centerX=b;A(a,function(a){g+=a.y});A(a,function(a){o=null;x=g?a.y/g:0;m=d-j/2+h*j;l=m+x*j;i=q(m);y=b-i/2;B=y+ 11 | i;i=q(l);n=b-i/2;t=n+i;m>v?(y=n=b-r/2,B=t=b+r/2):l>v&&(o=l,i=q(v),n=b-i/2,t=n+i,l=v);w=["M",y,m,"L",B,m,t,l];o&&w.push(t,o,n,o);w.push(n,l,"Z");a.shapeType="path";a.shapeArgs={d:w};a.percentage=x*100;a.plotX=b;a.plotY=(m+(o||l))/2;a.tooltipPos=[b,a.plotY];a.slice=z;a.half=u;h+=x});this.setTooltipPoints()},drawPoints:function(){var a=this,g=a.options,e=a.chart.renderer;A(a.data,function(f){var h=f.graphic,c=f.shapeArgs;h?h.animate(c):f.graphic=e.path(c).attr({fill:f.color,stroke:g.borderColor,"stroke-width":g.borderWidth}).add(a.group)})}, 12 | sortByAngle:z,drawDataLabels:function(){var a=this.data,g=this.options.dataLabels.distance,e,f,h,c=a.length,d,b;for(this.center[2]-=2*g;c--;)h=a[c],f=(e=h.half)?1:-1,b=h.plotY,d=this.getX(b,e),h.labelPos=[0,b,d+(g-5)*f,b,d+g*f,b,e?"right":"left",0];p.pie.prototype.drawDataLabels.call(this)}})})(Highcharts); 13 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/modules/heatmap.js: -------------------------------------------------------------------------------- 1 | (function(b){var k=b.seriesTypes,l=b.each;k.heatmap=b.extendClass(k.map,{colorKey:"z",useMapGeometry:!1,pointArrayMap:["y","z"],translate:function(){var c=this,b=c.options,i=Number.MAX_VALUE,j=Number.MIN_VALUE;c.generatePoints();l(c.data,function(a){var e=a.x,f=a.y,d=a.z,g=(b.colsize||1)/2,h=(b.rowsize||1)/2;a.path=["M",e-g,f-h,"L",e+g,f-h,"L",e+g,f+h,"L",e-g,f+h,"Z"];a.shapeType="path";a.shapeArgs={d:c.translatePath(a.path)};typeof d==="number"&&(d>j?j=d:d dataMax) { 39 | dataMax = value; 40 | } else if (value < dataMin) { 41 | dataMin = value; 42 | } 43 | } 44 | }); 45 | 46 | series.translateColors(dataMin, dataMax); 47 | }, 48 | 49 | getBox: function () {} 50 | 51 | }); 52 | 53 | }(Highcharts)); 54 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/modules/no-data-to-display.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.6 (2013-10-04) 3 | Plugin for displaying a message when there is no data visible in chart. 4 | 5 | (c) 2010-2013 Highsoft AS 6 | Author: Øystein Moseng 7 | 8 | License: www.highcharts.com/license 9 | */ 10 | (function(c){function f(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var d=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),i=c.extend;i(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"},attr:{},style:{fontWeight:"bold",fontSize:"12px",color:"#60606a"}};d.pie.prototype.hasData=f;if(d.gauge)d.gauge.prototype.hasData=f;if(d.waterfall)d.waterfall.prototype.hasData=f;c.Series.prototype.hasData=function(){return this.dataMax!== 11 | void 0&&this.dataMin!==void 0};e.showNoData=function(a){var b=this.options,a=a||b.lang.noData,b=b.noData;if(!this.noDataLabel)this.noDataLabel=this.renderer.label(a,0,0,null,null,null,null,null,"no-data").attr(b.attr).css(b.style).add(),this.noDataLabel.align(i(this.noDataLabel.getBBox(),b.position),!1,"plotBox")};e.hideNoData=function(){if(this.noDataLabel)this.noDataLabel=this.noDataLabel.destroy()};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&!a[b].options.isInternal)return!0; 12 | return!1};e.callbacks.push(function(a){c.addEvent(a,"load",g);c.addEvent(a,"redraw",g)})})(Highcharts); 13 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/modules/no-data-to-display.src.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Highcharts JS v3.0.6 (2013-10-04) 3 | * Plugin for displaying a message when there is no data visible in chart. 4 | * 5 | * (c) 2010-2013 Highsoft AS 6 | * Author: Øystein Moseng 7 | * 8 | * License: www.highcharts.com/license 9 | */ 10 | 11 | (function (H) { // docs 12 | 13 | var seriesTypes = H.seriesTypes, 14 | chartPrototype = H.Chart.prototype, 15 | defaultOptions = H.getOptions(), 16 | extend = H.extend; 17 | 18 | // Add language option 19 | extend(defaultOptions.lang, { 20 | noData: 'No data to display' 21 | }); 22 | 23 | // Add default display options for message 24 | defaultOptions.noData = { 25 | position: { 26 | x: 0, 27 | y: 0, 28 | align: 'center', 29 | verticalAlign: 'middle' 30 | }, 31 | attr: { 32 | }, 33 | style: { 34 | fontWeight: 'bold', 35 | fontSize: '12px', 36 | color: '#60606a' 37 | } 38 | }; 39 | 40 | /** 41 | * Define hasData functions for series. These return true if there are data points on this series within the plot area 42 | */ 43 | function hasDataPie() { 44 | return !!this.points.length; /* != 0 */ 45 | } 46 | 47 | seriesTypes.pie.prototype.hasData = hasDataPie; 48 | 49 | if (seriesTypes.gauge) { 50 | seriesTypes.gauge.prototype.hasData = hasDataPie; 51 | } 52 | 53 | if (seriesTypes.waterfall) { 54 | seriesTypes.waterfall.prototype.hasData = hasDataPie; 55 | } 56 | 57 | H.Series.prototype.hasData = function () { 58 | return this.dataMax !== undefined && this.dataMin !== undefined; 59 | }; 60 | 61 | /** 62 | * Display a no-data message. 63 | * 64 | * @param {String} str An optional message to show in place of the default one 65 | */ 66 | chartPrototype.showNoData = function (str) { 67 | var chart = this, 68 | options = chart.options, 69 | text = str || options.lang.noData, 70 | noDataOptions = options.noData; 71 | 72 | if (!chart.noDataLabel) { 73 | chart.noDataLabel = chart.renderer.label(text, 0, 0, null, null, null, null, null, 'no-data') 74 | .attr(noDataOptions.attr) 75 | .css(noDataOptions.style) 76 | .add(); 77 | chart.noDataLabel.align(extend(chart.noDataLabel.getBBox(), noDataOptions.position), false, 'plotBox'); 78 | } 79 | }; 80 | 81 | /** 82 | * Hide no-data message 83 | */ 84 | chartPrototype.hideNoData = function () { 85 | var chart = this; 86 | if (chart.noDataLabel) { 87 | chart.noDataLabel = chart.noDataLabel.destroy(); 88 | } 89 | }; 90 | 91 | /** 92 | * Returns true if there are data points within the plot area now 93 | */ 94 | chartPrototype.hasData = function () { 95 | var chart = this, 96 | series = chart.series, 97 | i = series.length; 98 | 99 | while (i--) { 100 | if (series[i].hasData() && !series[i].options.isInternal) { 101 | return true; 102 | } 103 | } 104 | 105 | return false; 106 | }; 107 | 108 | /** 109 | * Show no-data message if there is no data in sight. Otherwise, hide it. 110 | */ 111 | function handleNoData() { 112 | var chart = this; 113 | if (chart.hasData()) { 114 | chart.hideNoData(); 115 | } else { 116 | chart.showNoData(); 117 | } 118 | } 119 | 120 | /** 121 | * Add event listener to handle automatic display of no-data message 122 | */ 123 | chartPrototype.callbacks.push(function (chart) { 124 | H.addEvent(chart, 'load', handleNoData); 125 | H.addEvent(chart, 'redraw', handleNoData); 126 | }); 127 | 128 | }(Highcharts)); 129 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/themes/grid.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Grid theme for Highcharts JS 3 | * @author Torstein Hønsi 4 | */ 5 | 6 | Highcharts.theme = { 7 | colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'], 8 | chart: { 9 | backgroundColor: { 10 | linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 }, 11 | stops: [ 12 | [0, 'rgb(255, 255, 255)'], 13 | [1, 'rgb(240, 240, 255)'] 14 | ] 15 | }, 16 | borderWidth: 2, 17 | plotBackgroundColor: 'rgba(255, 255, 255, .9)', 18 | plotShadow: true, 19 | plotBorderWidth: 1 20 | }, 21 | title: { 22 | style: { 23 | color: '#000', 24 | font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' 25 | } 26 | }, 27 | subtitle: { 28 | style: { 29 | color: '#666666', 30 | font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' 31 | } 32 | }, 33 | xAxis: { 34 | gridLineWidth: 1, 35 | lineColor: '#000', 36 | tickColor: '#000', 37 | labels: { 38 | style: { 39 | color: '#000', 40 | font: '11px Trebuchet MS, Verdana, sans-serif' 41 | } 42 | }, 43 | title: { 44 | style: { 45 | color: '#333', 46 | fontWeight: 'bold', 47 | fontSize: '12px', 48 | fontFamily: 'Trebuchet MS, Verdana, sans-serif' 49 | 50 | } 51 | } 52 | }, 53 | yAxis: { 54 | minorTickInterval: 'auto', 55 | lineColor: '#000', 56 | lineWidth: 1, 57 | tickWidth: 1, 58 | tickColor: '#000', 59 | labels: { 60 | style: { 61 | color: '#000', 62 | font: '11px Trebuchet MS, Verdana, sans-serif' 63 | } 64 | }, 65 | title: { 66 | style: { 67 | color: '#333', 68 | fontWeight: 'bold', 69 | fontSize: '12px', 70 | fontFamily: 'Trebuchet MS, Verdana, sans-serif' 71 | } 72 | } 73 | }, 74 | legend: { 75 | itemStyle: { 76 | font: '9pt Trebuchet MS, Verdana, sans-serif', 77 | color: 'black' 78 | 79 | }, 80 | itemHoverStyle: { 81 | color: '#039' 82 | }, 83 | itemHiddenStyle: { 84 | color: 'gray' 85 | } 86 | }, 87 | labels: { 88 | style: { 89 | color: '#99b' 90 | } 91 | }, 92 | 93 | navigation: { 94 | buttonOptions: { 95 | theme: { 96 | stroke: '#CCCCCC' 97 | } 98 | } 99 | } 100 | }; 101 | 102 | // Apply the theme 103 | var highchartsOptions = Highcharts.setOptions(Highcharts.theme); 104 | -------------------------------------------------------------------------------- /public/ueditor/third-party/highcharts/themes/skies.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Skies theme for Highcharts JS 3 | * @author Torstein Hønsi 4 | */ 5 | 6 | Highcharts.theme = { 7 | colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"], 8 | chart: { 9 | className: 'skies', 10 | borderWidth: 0, 11 | plotShadow: true, 12 | plotBackgroundImage: 'http://www.highcharts.com/demo/gfx/skies.jpg', 13 | plotBackgroundColor: { 14 | linearGradient: [0, 0, 250, 500], 15 | stops: [ 16 | [0, 'rgba(255, 255, 255, 1)'], 17 | [1, 'rgba(255, 255, 255, 0)'] 18 | ] 19 | }, 20 | plotBorderWidth: 1 21 | }, 22 | title: { 23 | style: { 24 | color: '#3E576F', 25 | font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' 26 | } 27 | }, 28 | subtitle: { 29 | style: { 30 | color: '#6D869F', 31 | font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' 32 | } 33 | }, 34 | xAxis: { 35 | gridLineWidth: 0, 36 | lineColor: '#C0D0E0', 37 | tickColor: '#C0D0E0', 38 | labels: { 39 | style: { 40 | color: '#666', 41 | fontWeight: 'bold' 42 | } 43 | }, 44 | title: { 45 | style: { 46 | color: '#666', 47 | font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' 48 | } 49 | } 50 | }, 51 | yAxis: { 52 | alternateGridColor: 'rgba(255, 255, 255, .5)', 53 | lineColor: '#C0D0E0', 54 | tickColor: '#C0D0E0', 55 | tickWidth: 1, 56 | labels: { 57 | style: { 58 | color: '#666', 59 | fontWeight: 'bold' 60 | } 61 | }, 62 | title: { 63 | style: { 64 | color: '#666', 65 | font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' 66 | } 67 | } 68 | }, 69 | legend: { 70 | itemStyle: { 71 | font: '9pt Trebuchet MS, Verdana, sans-serif', 72 | color: '#3E576F' 73 | }, 74 | itemHoverStyle: { 75 | color: 'black' 76 | }, 77 | itemHiddenStyle: { 78 | color: 'silver' 79 | } 80 | }, 81 | labels: { 82 | style: { 83 | color: '#3E576F' 84 | } 85 | } 86 | }; 87 | 88 | // Apply the theme 89 | var highchartsOptions = Highcharts.setOptions(Highcharts.theme); 90 | -------------------------------------------------------------------------------- /public/ueditor/third-party/snapscreen/UEditorSnapscreen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/snapscreen/UEditorSnapscreen.exe -------------------------------------------------------------------------------- /public/ueditor/third-party/video-js/font/vjs.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/video-js/font/vjs.eot -------------------------------------------------------------------------------- /public/ueditor/third-party/video-js/font/vjs.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/video-js/font/vjs.ttf -------------------------------------------------------------------------------- /public/ueditor/third-party/video-js/font/vjs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/video-js/font/vjs.woff -------------------------------------------------------------------------------- /public/ueditor/third-party/video-js/video-js.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/video-js/video-js.swf -------------------------------------------------------------------------------- /public/ueditor/third-party/webuploader/Uploader.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/webuploader/Uploader.swf -------------------------------------------------------------------------------- /public/ueditor/third-party/webuploader/webuploader.css: -------------------------------------------------------------------------------- 1 | .webuploader-container { 2 | position: relative; 3 | } 4 | .webuploader-element-invisible { 5 | position: absolute !important; 6 | clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 7 | clip: rect(1px,1px,1px,1px); 8 | } 9 | .webuploader-pick { 10 | position: relative; 11 | display: inline-block; 12 | cursor: pointer; 13 | background: #00b7ee; 14 | padding: 10px 15px; 15 | color: #fff; 16 | text-align: center; 17 | border-radius: 3px; 18 | overflow: hidden; 19 | } 20 | .webuploader-pick-hover { 21 | background: #00a2d4; 22 | } 23 | 24 | .webuploader-pick-disable { 25 | opacity: 0.6; 26 | pointer-events:none; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /public/ueditor/third-party/zeroclipboard/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangxinleo/practise-vue-shop-server/bf59a3fa3e0f79934ab20400d6638939a570cffc/public/ueditor/third-party/zeroclipboard/ZeroClipboard.swf -------------------------------------------------------------------------------- /routes/api/private/v1/menus.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | // 获取验证模块 6 | var authorization = require(path.join(process.cwd(),"/modules/authorization")); 7 | 8 | // 通过验证模块获取菜单服务模块 9 | var menuService = require(path.join(process.cwd(),"/services/MenuService")); 10 | 11 | router.get("/", 12 | function(req,res,next) { 13 | menuService.getLeftMenus(req.userInfo,function(err,result) { 14 | if(err) return res.sendResult(null,400,err); 15 | res.sendResult(result,200,"获取菜单列表成功"); 16 | }); 17 | } 18 | ); 19 | 20 | module.exports = router; -------------------------------------------------------------------------------- /routes/api/private/v1/orders.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | // 获取验证模块 6 | var authorization = require(path.join(process.cwd(),"/modules/authorization")); 7 | 8 | // 通过验证模块获取分类管理 9 | var orderServ = authorization.getService("OrderService"); 10 | 11 | // 订单列表 12 | router.get("/", 13 | // 参数验证 14 | function(req,res,next) { 15 | // 参数验证 16 | if(!req.query.pagenum || req.query.pagenum <= 0) return res.sendResult(null,400,"pagenum 参数错误"); 17 | if(!req.query.pagesize || req.query.pagesize <= 0) return res.sendResult(null,400,"pagesize 参数错误"); 18 | next(); 19 | }, 20 | // 业务逻辑 21 | function(req,res,next) { 22 | var conditions = { 23 | "pagenum" : req.query.pagenum, 24 | "pagesize" : req.query.pagesize 25 | }; 26 | 27 | if(req.query.user_id) { 28 | conditions["user_id"] = req.query.user_id; 29 | } 30 | if(req.query.pay_status) { 31 | conditions["pay_status"] = req.query.pay_status; 32 | } 33 | if(req.query.is_send) { 34 | conditions["is_send"] = req.query.is_send; 35 | } 36 | if(req.query.order_fapiao_title) { 37 | conditions["order_fapiao_title"] = req.query.order_fapiao_title; 38 | } 39 | if(req.query.order_fapiao_company) { 40 | conditions["order_fapiao_company"] = req.query.order_fapiao_company; 41 | } 42 | if(req.query.order_fapiao_content) { 43 | conditions["order_fapiao_content"] = req.query.order_fapiao_content; 44 | } 45 | if(req.query.consignee_addr) { 46 | conditions["consignee_addr"] = req.query.consignee_addr; 47 | } 48 | 49 | orderServ.getAllOrders( 50 | conditions, 51 | function(err,result){ 52 | if(err) return res.sendResult(null,400,err); 53 | res.sendResult(result,200,"获取成功"); 54 | } 55 | )(req,res,next); 56 | } 57 | ); 58 | 59 | // 添加订单 60 | router.post("/", 61 | // 参数验证 62 | function(req,res,next) { 63 | next(); 64 | }, 65 | // 业务逻辑 66 | function(req,res,next) { 67 | var params = req.body; 68 | orderServ.createOrder(params,function(err,newOrder){ 69 | if(err) return res.sendResult(null,400,err); 70 | return res.sendResult(newOrder,201,"创建订单成功"); 71 | })(req,res,next); 72 | 73 | } 74 | ); 75 | 76 | // 更新订单发送状态 77 | router.put("/:id", 78 | // 参数验证 79 | function(req,res,next) { 80 | next(); 81 | }, 82 | // 业务逻辑 83 | function(req,res,next) { 84 | var params = req.body; 85 | orderServ.updateOrder(req.params.id,params,function(err,newOrder){ 86 | if(err) return res.sendResult(null,400,err); 87 | return res.sendResult(newOrder,201,"更新订单成功"); 88 | })(req,res,next); 89 | } 90 | ); 91 | 92 | router.get("/:id",function(req,res,next){ 93 | orderServ.getOrder(req.params.id,function(err,result){ 94 | if(err) return res.sendResult(null,400,err); 95 | return res.sendResult(result,200,"获取成功"); 96 | })(req,res,next); 97 | }); 98 | 99 | 100 | 101 | module.exports = router; 102 | -------------------------------------------------------------------------------- /routes/api/private/v1/reports.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | 6 | // 获取验证模块 7 | var authorization = require(path.join(process.cwd(),"/modules/authorization")); 8 | 9 | // 通过验证模块获取用户管理服务 10 | var reportsServ = authorization.getService("ReportsService"); 11 | 12 | router.get("/type/:typeid", 13 | // 参数验证 14 | function(req,res,next){ 15 | if(!req.params.typeid) { 16 | return res.sendResult(null,400,"报表类型不能为空"); 17 | } 18 | if(isNaN(parseInt(req.params.typeid))) return res.sendResult(null,400,"报表类型必须是数字"); 19 | next(); 20 | }, 21 | // 业务逻辑 22 | function(req,res,next) { 23 | reportsServ.reports(req.params.typeid,function(err,result){ 24 | if(err) return res.sendResult(null,400,err); 25 | res.sendResult(result,200,"获取报表成功"); 26 | })(req,res,next); 27 | } 28 | ); 29 | 30 | module.exports = router; -------------------------------------------------------------------------------- /routes/api/private/v1/rights.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | // 获取验证模块 6 | var authorization = require(path.join(process.cwd(),"/modules/authorization")); 7 | 8 | // 通过验证模块构建权限服务模块 9 | var rightService = authorization.getService("RightService"); 10 | router.get("/:type", 11 | // 参数验证 12 | function(req,res,next) { 13 | if(!req.params.type) { 14 | return res.sendResult(null,400,"显示类型未定义"); 15 | } 16 | if(req.params.type != "list" && req.params.type != "tree") { 17 | return res.sendResult(null,400,"显示类型参数错误"); 18 | } 19 | next(); 20 | }, 21 | // 业务逻辑 22 | function(req,res,next) { 23 | rightService.getAllRights(req.params.type,function(err,rights){ 24 | if(err) return res.sendResult(null,400,err); 25 | res.sendResult(rights,200,"获取权限列表成功"); 26 | })(req,res,next); 27 | } 28 | ); 29 | 30 | module.exports = router; -------------------------------------------------------------------------------- /routes/api/private/v1/roles.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | // 获取验证模块 6 | var authorization = require(path.join(process.cwd(),"/modules/authorization")); 7 | 8 | // 角色管理模块 9 | var roleServ = authorization.getService("RoleService"); 10 | 11 | // 获取角色列表 12 | router.get("/", 13 | // 参数验证 14 | function(req,res,next){ 15 | next(); 16 | }, 17 | // 处理业务逻辑 18 | function(req,res,next) { 19 | roleServ.getAllRoles(function(err,result) { 20 | if(err) return res.sendResult(null,400,err); 21 | res.sendResult(result,200,"获取成功"); 22 | })(req,res,next); 23 | } 24 | ); 25 | 26 | // 创建角色 27 | router.post("/", 28 | // 参数验证 29 | function(req,res,next) { 30 | if(!req.body.roleName) return res.sendResult(null,400,"角色名称不能为空"); 31 | next(); 32 | }, 33 | // 处理业务逻辑 34 | function(req,res,next) { 35 | roleServ.createRole({ 36 | "roleName":req.body.roleName, 37 | "roleDesc":req.body.roleDesc 38 | },function(err,role){ 39 | if(err) return res.sendResult(null,400,err); 40 | res.sendResult(role,201,"创建成功"); 41 | })(req,res,next); 42 | } 43 | ); 44 | 45 | // 获取角色详情 46 | router.get("/:id", 47 | // 参数验证 48 | function(req,res,next) { 49 | if(!req.params.id) return res.sendResult(null,400,"角色ID不能为空"); 50 | if(isNaN(parseInt(req.params.id))) res.sendResult(null,400,"角色ID必须为数字"); 51 | next(); 52 | }, 53 | // 处理业务逻辑 54 | function(req,res,next) { 55 | roleServ.getRoleById( 56 | req.params.id, 57 | function(err,result){ 58 | if(err) return res.sendResult(null,400,err); 59 | res.sendResult(result,200,"获取成功"); 60 | })(req,res,next); 61 | } 62 | ); 63 | 64 | // 更新角色信息 65 | router.put("/:id", 66 | // 参数验证 67 | function(req,res,next) { 68 | if(!req.params.id) return res.sendResult(null,400,"角色ID不能为空"); 69 | if(isNaN(parseInt(req.params.id))) return res.sendResult(null,400,"角色ID必须为数字"); 70 | if(!req.body.roleName) return res.sendResult(null,400,"角色名称不能为空"); 71 | next(); 72 | }, 73 | // 处理业务逻辑 74 | function(req,res,next) { 75 | roleServ.updateRole( 76 | { 77 | "id":req.params.id, 78 | "roleName":req.body.roleName, 79 | "roleDesc":req.body.roleDesc 80 | }, 81 | function(err,result){ 82 | if(err) return res.sendResult(null,400,err); 83 | res.sendResult(result,200,"获取成功"); 84 | })(req,res,next); 85 | } 86 | ); 87 | 88 | // 删除角色 89 | router.delete("/:id", 90 | // 参数验证 91 | function(req,res,next) { 92 | if(!req.params.id) return res.sendResult(null,400,"角色ID不能为空"); 93 | if(isNaN(parseInt(req.params.id))) return res.sendResult(null,400,"角色ID必须为数字"); 94 | next(); 95 | }, 96 | // 处理业务逻辑 97 | function(req,res,next) { 98 | roleServ.deleteRole( 99 | req.params.id, 100 | function(err,success){ 101 | if(err) return res.sendResult(null,400,err); 102 | res.sendResult(null,200,"删除成功"); 103 | })(req,res,next); 104 | } 105 | ); 106 | 107 | // 为角色授权 108 | router.post("/:id/rights", 109 | // 参数校验 110 | function(req,res,next) { 111 | if(!req.params.id) return res.sendResult(null,400,"角色ID不能为空"); 112 | if(isNaN(parseInt(req.params.id))) res.sendResult(null,400,"角色ID必须为数字"); 113 | next(); 114 | }, 115 | // 业务逻辑 116 | function(req,res,next) { 117 | roleServ.updateRoleRight(req.params.id,req.body.rids,function(err,newRole){ 118 | if(err) return res.sendResult(null,400,err); 119 | res.sendResult(null,200,"更新成功"); 120 | })(req,res,next); 121 | } 122 | ); 123 | 124 | // 删除角色权限 125 | router.delete("/:id/rights/:rightId", 126 | // 参数验证 127 | function(req,res,next) { 128 | if(!req.params.id) return res.sendResult(null,400,"角色ID不能为空"); 129 | if(isNaN(parseInt(req.params.id))) res.sendResult(null,400,"角色ID必须为数字"); 130 | if(isNaN(parseInt(req.params.rightId))) res.sendResult(null,400,"权限ID必须为数字"); 131 | next(); 132 | }, 133 | // 业务逻辑 134 | function(req,res,next) { 135 | roleServ.deleteRoleRight(req.params.id,req.params.rightId,function(err,result){ 136 | if(err) return res.sendResult(null,400,err); 137 | res.sendResult(result,200,"取消权限成功"); 138 | })(req,res,next); 139 | } 140 | ); 141 | 142 | module.exports = router; -------------------------------------------------------------------------------- /routes/api/private/v1/upload.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var path = require("path"); 4 | 5 | var fs = require('fs'); 6 | var os = require('os'); 7 | 8 | var multer = require('multer'); 9 | // 临时上传目录 10 | var upload = multer({ dest: 'tmp_uploads/' }); 11 | 12 | var upload_config = require('config').get("upload_config"); 13 | 14 | // 提供文件上传服务 15 | router.post("/",upload.single('file'),function(req,res,next) { 16 | var fileExtArray = req.file.originalname.split("."); 17 | var ext = fileExtArray[fileExtArray.length - 1]; 18 | var targetPath = req.file.path + "." + ext; 19 | fs.rename(path.join(process.cwd(),"/" + req.file.path),path.join(process.cwd(),targetPath),function(err){ 20 | if(err) { 21 | return res.sendResult(null,400,"上传文件失败"); 22 | } 23 | res.sendResult({"tmp_path":targetPath,"url":upload_config.get("baseURL") + "/" + targetPath},200,"上传成功"); 24 | }) 25 | }); 26 | 27 | module.exports = router; -------------------------------------------------------------------------------- /services/AttributeService.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var dao = require(path.join(process.cwd(),"dao/DAO")); 4 | var attributeDao = require(path.join(process.cwd(),"dao/AttributeDAO")); 5 | 6 | /** 7 | * 获取属性列表 8 | * 9 | * @param {[type]} cat_id 分类ID 10 | * @param {[type]} sel 类型 // only:输入框(唯一) many:后台下拉列表/前台单选框 11 | * @param {Function} cb 回调函数 12 | */ 13 | module.exports.getAttributes = function(cat_id,sel,cb) { 14 | attributeDao.list(cat_id,sel,function(err,attributes) { 15 | if(err) return cb("获取失败"); 16 | cb(null,attributes); 17 | }); 18 | } 19 | 20 | /** 21 | * 创建参数 22 | * 23 | * @param {[type]} info 参数信息 24 | * @param {Function} cb 回调函数 25 | */ 26 | module.exports.createAttribute = function(info,cb) { 27 | dao.create("AttributeModel",info,function(err,attribute) { 28 | if(err) return cb("创建失败"); 29 | cb(null,attribute); 30 | }); 31 | } 32 | 33 | /** 34 | * 更新参数 35 | * 36 | * @param {[type]} catId 分类ID 37 | * @param {[type]} attrId 属性ID 38 | * @param {[type]} info 更新内容 39 | * @param {Function} cb 回调函数 40 | */ 41 | module.exports.updateAttribute = function(attrId,info,cb) { 42 | dao.update("AttributeModel",attrId,info,function(err,newAttr) { 43 | if(err) return cb(err); 44 | cb(null,_.omit(newAttr,"delete_time")); 45 | }); 46 | } 47 | 48 | /** 49 | * 删除参数 50 | * 51 | * @param {[type]} attrId 参数ID 52 | * @param {Function} cb 回调函数 53 | */ 54 | module.exports.deleteAttribute = function(attrId,cb) { 55 | dao.update("AttributeModel",attrId,{"delete_time":parseInt((Date.now()/1000))},function(err,newAttr){ 56 | console.log(newAttr); 57 | if(err) return cb("删除失败"); 58 | cb(null,newAttr); 59 | }); 60 | } 61 | 62 | module.exports.attributeById = function(attrId,cb) { 63 | dao.show("AttributeModel",attrId,function(err,attr) { 64 | if(err) return cb(err); 65 | cb(null,_.omit(attr,"delete_time")); 66 | }); 67 | } 68 | -------------------------------------------------------------------------------- /services/CategoryService.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var dao = require(path.join(process.cwd(),"dao/DAO")); 4 | 5 | /** 6 | * 判断是否删除 7 | * 8 | * @param {[type]} keyCategories 所有数据 9 | * @param {[type]} cat [description] 10 | * @return {Boolean} [description] 11 | */ 12 | function isDelete(keyCategories,cat) { 13 | if(cat.cat_pid == 0) { 14 | return cat.cat_deleted; 15 | } else if(cat.cat_deleted) { 16 | return true; 17 | } else { 18 | parentCat = keyCategories[cat.cat_pid]; 19 | if(!parentCat) return true; 20 | return isDelete(keyCategories,parentCat); 21 | } 22 | } 23 | 24 | /** 25 | * 获取树状结果 26 | * @param {[type]} keyCategories [description] 27 | * @return {[type]} [description] 28 | */ 29 | function getTreeResult(keyCategories,categories,type) { 30 | 31 | var result = []; 32 | for(idx in categories) { 33 | var cat = categories[idx]; 34 | // 判断是否被删除 35 | if(isDelete(keyCategories,cat)) continue; 36 | if(cat.cat_pid == 0) { 37 | result.push(cat); 38 | } else { 39 | if(cat.cat_level >= type) continue; 40 | var parantCat = keyCategories[cat.cat_pid]; 41 | if(!parantCat) continue; 42 | if(!parantCat.children) { 43 | parantCat["children"] = []; 44 | } 45 | parantCat.children.push(cat); 46 | } 47 | } 48 | 49 | return result; 50 | } 51 | 52 | 53 | 54 | /** 55 | * 获取所有分类 56 | * 57 | * @param {[type]} type 描述显示层级 58 | * @param {Function} cb 回调函数 59 | */ 60 | module.exports.getAllCategories = function(type,conditions,cb) { 61 | dao.list("CategoryModel",{"cat_deleted":false},function(err,categories) { 62 | var keyCategories = _.keyBy(categories,'cat_id'); 63 | if(!type) type = 3; 64 | 65 | result = getTreeResult(keyCategories,categories,type); 66 | 67 | if(conditions) { 68 | count = result.length; 69 | pagesize = parseInt(conditions.pagesize); 70 | pagenum = parseInt(conditions.pagenum) - 1; 71 | result = _.take(_.drop(result,pagenum * pagesize),pagesize) 72 | var resultDta = {}; 73 | resultDta["total"] = count; 74 | resultDta["pagenum"] = pagenum; 75 | resultDta["pagesize"] = pagesize; 76 | resultDta["result"] = result; 77 | return cb(null,resultDta); 78 | } 79 | cb(null,result); 80 | }); 81 | } 82 | 83 | /** 84 | * 获取具体分类对象 85 | * 86 | * @param {[type]} id 分类ID 87 | * @param {Function} cb 回调函数 88 | */ 89 | module.exports.getCategoryById = function(id,cb) { 90 | dao.show("CategoryModel",id,function(err,category){ 91 | if(err) return cb("获取分类对象失败"); 92 | cb(null,category); 93 | }) 94 | } 95 | 96 | /** 97 | * 添加分类 98 | * 99 | * @param {[type]} cat 分类数据 100 | * { 101 | * cat_pid => 父类ID(如果是根类就赋值为0), 102 | * cat_name => 分类名称, 103 | * cat_level => 层级 (顶层为 0) 104 | * } 105 | * 106 | * @param {Function} cb 回调函数 107 | */ 108 | module.exports.addCategory = function(cat,cb) { 109 | dao.create("CategoryModel",{"cat_pid":cat.cat_pid,"cat_name":cat.cat_name,"cat_level":cat.cat_level},function(err,newCat) { 110 | if(err) return cb("创建分类失败"); 111 | cb(null,newCat); 112 | 113 | }); 114 | } 115 | 116 | /** 117 | * 更新分类 118 | * 119 | * @param {[type]} cat_id 分类ID 120 | * @param {[type]} newName 新的名称 121 | * @param {Function} cb 回调函数 122 | */ 123 | module.exports.updateCategory = function(cat_id,newName,cb) { 124 | dao.update("CategoryModel",cat_id,{"cat_name":newName},function(err,newCat) { 125 | if(err) return cb("更新失败"); 126 | cb(null,newCat); 127 | }); 128 | } 129 | 130 | /** 131 | * 删除分类 132 | * 133 | * @param {[type]} cat_id 分类ID 134 | * @param {Function} cb 回调函数 135 | */ 136 | module.exports.deleteCategory = function(cat_id,cb) { 137 | dao.update("CategoryModel",cat_id,{"cat_deleted":true},function(err,newCat){ 138 | 139 | if(err) return cb("删除失败"); 140 | cb("删除成功"); 141 | }); 142 | } 143 | -------------------------------------------------------------------------------- /services/MenuService.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var dao = require(path.join(process.cwd(),"dao/DAO")); 4 | var permissionAPIDAO = require(path.join(process.cwd(),"dao/PermissionAPIDAO")); 5 | 6 | /** 7 | * 获取左侧菜单数据 8 | * 9 | * @param {Function} cb 回调函数 10 | */ 11 | module.exports.getLeftMenus = function(userInfo,cb) { 12 | if(!userInfo) return cb("无权限访问"); 13 | 14 | 15 | 16 | var authFn = function(rid,keyRolePermissions,cb) { 17 | permissionAPIDAO.list(function(err,permissions){ 18 | if(err) return cb("获取权限数据失败"); 19 | var keyPermissions = _.keyBy(permissions,'ps_id'); 20 | var rootPermissionsResult = {}; 21 | // 处理一级菜单 22 | for(idx in permissions) { 23 | 24 | permission = permissions[idx]; 25 | 26 | if(permission.ps_level == 0) { 27 | if(rid != 0) { 28 | if(!keyRolePermissions[permission.ps_id]) continue;; 29 | } 30 | rootPermissionsResult[permission.ps_id] = { 31 | "id":permission.ps_id, 32 | "authName":permission.ps_name, 33 | "path":permission.ps_api_path, 34 | "children":[], 35 | "order":permission.ps_api_order 36 | }; 37 | } 38 | } 39 | 40 | // 处理二级菜单 41 | for(idx in permissions) { 42 | permission = permissions[idx]; 43 | if(permission.ps_level == 1) { 44 | if(rid != 0) { 45 | if(!keyRolePermissions[permission.ps_id]) continue;; 46 | } 47 | parentPermissionResult = rootPermissionsResult[permission.ps_pid]; 48 | if(parentPermissionResult) { 49 | parentPermissionResult.children.push({ 50 | "id":permission.ps_id, 51 | "authName":permission.ps_name, 52 | "path":permission.ps_api_path, 53 | "children":[], 54 | "order":permission.ps_api_order 55 | }); 56 | } 57 | } 58 | } 59 | // 排序 60 | result = _.values(rootPermissionsResult); 61 | result = _.sortBy(result,"order"); 62 | for(idx in result) { 63 | subresult = result[idx]; 64 | subresult.children = _.sortBy(subresult.children,"order"); 65 | } 66 | 67 | cb(null,result); 68 | }); 69 | } 70 | 71 | rid = userInfo.rid; 72 | if(rid == 0) { 73 | authFn(rid,null,cb); 74 | } else { 75 | dao.show("RoleModel",userInfo.rid,function(err,role){ 76 | if(err || !role) return cb("无权限访问"); 77 | 78 | 79 | rolePermissions = role.ps_ids.split(",") 80 | keyRolePermissions = {} 81 | for(idx in rolePermissions) { 82 | keyRolePermissions[rolePermissions[idx]] = true; 83 | } 84 | 85 | authFn(rid,keyRolePermissions,cb); 86 | 87 | }) 88 | } 89 | 90 | } -------------------------------------------------------------------------------- /services/ReportsService.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var dao = require(path.join(process.cwd(),"dao/DAO")); 4 | 5 | function reportOne(cb) { 6 | dao.list("ReportOneModel",null,function(err,result){ 7 | if(err) return cb("获取报表数据失败"); 8 | var areaKeyResult = {}; 9 | var areaKeys = _.union(_.map(result,"rp1_area")); 10 | var dateKeys = _.union(_.map(result,function(record){ 11 | str = record["rp1_date"].getFullYear() + "-" + (record["rp1_date"].getMonth() + 1) + "-" + record["rp1_date"].getDate() 12 | console.log(str); 13 | return str; 14 | })); 15 | for(var idx in result) { 16 | var record = result[idx]; 17 | var dateKey = record["rp1_date"].getFullYear() + "-" + (record["rp1_date"].getMonth() + 1) + "-" + record["rp1_date"].getDate(); 18 | if(!areaKeyResult[record["rp1_area"]]) { 19 | areaKeyResult[record["rp1_area"]] = {}; 20 | } 21 | areaKeyResult[record["rp1_area"]][dateKey] = record; 22 | } 23 | // 格式输出 24 | var series = []; 25 | _(areaKeys).forEach(function(areaKey){ 26 | var data = [] 27 | 28 | _(dateKeys).forEach(function(dateKey){ 29 | console.log("areaKey:" + areaKey + "," + "dateKey:" + dateKey); 30 | if(areaKeyResult[areaKey][dateKey]) { 31 | data.push(areaKeyResult[areaKey][dateKey]["rp1_user_count"]); 32 | } else { 33 | data.push(0); 34 | } 35 | }) 36 | series.push({ 37 | name:areaKey, 38 | type:'line', 39 | stack: '总量', 40 | areaStyle: {normal: {}}, 41 | data:data 42 | }) 43 | }); 44 | data = { 45 | legend: { 46 | data : areaKeys 47 | }, 48 | yAxis : [ 49 | { 50 | type : 'value' 51 | } 52 | ], 53 | xAxis : [ 54 | { 55 | data :dateKeys 56 | } 57 | ], 58 | series : series 59 | }; 60 | 61 | 62 | cb(null,data); 63 | }); 64 | } 65 | 66 | function reportTwo(cb) { 67 | dao.list("ReportTwoModel",null,function(err,result){ 68 | if(err) return cb("获取报表数据失败"); 69 | var dateKeyResult = {}; 70 | for(var idx in result) { 71 | var record = result[idx]; 72 | var dateKey = record["rp2_date"].getFullYear() + "-" + (record["rp2_date"].getMonth() + 1) + "-" + record["rp2_date"].getDate(); 73 | if(!dateKeyResult[dateKey]) { 74 | dateKeyResult[dateKey] = []; 75 | } 76 | dateKeyResult[dateKey].push(record); 77 | } 78 | cb(null,dateKeyResult); 79 | }); 80 | } 81 | 82 | function reportThree(cb) { 83 | 84 | } 85 | 86 | function reportFour(cb) { 87 | 88 | } 89 | 90 | module.exports.reports = function(typeid,cb) { 91 | console.log(typeid); 92 | switch (parseInt(typeid)) { 93 | case 1: 94 | reportOne(function(err,result){ 95 | if(err) return cb(err); 96 | cb(null,result); 97 | }); 98 | break; 99 | case 2: 100 | reportTwo(function(err,result){ 101 | if(err) return cb(err); 102 | cb(null,result); 103 | }); 104 | break; 105 | case 3: 106 | reportThree(function(err,result){ 107 | if(err) return cb(err); 108 | cb(null,result); 109 | }); 110 | break; 111 | case 4: 112 | reportFour(function(err,result){ 113 | if(err) return cb(err); 114 | cb(null,result); 115 | }); 116 | break; 117 | default: 118 | cb("类型出错"); 119 | break; 120 | } 121 | } -------------------------------------------------------------------------------- /services/RightService.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | var dao = require(path.join(process.cwd(),"dao/PermissionAPIDAO")); 4 | 5 | 6 | // 获取所有权限 7 | module.exports.getAllRights = function(type,cb) { 8 | if(!type || (type != "list" && type != "tree")) { 9 | cb("参数类型错误"); 10 | } 11 | 12 | 13 | dao.list(function(err,permissions){ 14 | if(err) return cb("获取权限数据失败"); 15 | 16 | if(type == "list") { 17 | var result = []; 18 | for(idx in permissions) { 19 | permission = permissions[idx]; 20 | result.push({ 21 | "id" : permission.ps_id, 22 | "authName" : permission.ps_name, 23 | "level" : permission.ps_level, 24 | "pid" : permission.ps_pid, 25 | "path": permission.ps_api_path 26 | }); 27 | } 28 | cb(null,result); 29 | } else { 30 | var keyCategories = _.keyBy(permissions,'ps_id'); 31 | 32 | // 显示一级 33 | var permissionsResult = {}; 34 | 35 | // 处理一级菜单 36 | for(idx in permissions) { 37 | permission = permissions[idx]; 38 | if(permission && permission.ps_level == 0) { 39 | permissionsResult[permission.ps_id] = { 40 | "id":permission.ps_id, 41 | "authName":permission.ps_name, 42 | "path":permission.ps_api_path, 43 | "pid" : permission.ps_pid, 44 | "children":[] 45 | }; 46 | } 47 | } 48 | 49 | // 临时存储二级返回结果 50 | tmpResult = {}; 51 | // 处理二级菜单 52 | for(idx in permissions) { 53 | permission = permissions[idx]; 54 | if(permission && permission.ps_level == 1) { 55 | 56 | parentPermissionResult = permissionsResult[permission.ps_pid]; 57 | if(parentPermissionResult) { 58 | tmpResult[permission.ps_id] = { 59 | "id":permission.ps_id, 60 | "authName":permission.ps_name, 61 | "path":permission.ps_api_path, 62 | "pid" : permission.ps_pid, 63 | "children":[] 64 | } 65 | parentPermissionResult.children.push(tmpResult[permission.ps_id]); 66 | } 67 | } 68 | } 69 | 70 | // 处理三级菜单 71 | for(idx in permissions) { 72 | permission = permissions[idx]; 73 | if(permission && permission.ps_level == 2) { 74 | 75 | parentPermissionResult = tmpResult[permission.ps_pid]; 76 | 77 | if(parentPermissionResult) { 78 | 79 | parentPermissionResult.children.push({ 80 | "id":permission.ps_id, 81 | "authName":permission.ps_name, 82 | "path":permission.ps_api_path, 83 | "pid" : permission.ps_pid + "," + keyCategories[permission.ps_pid].ps_pid 84 | }); 85 | } 86 | } 87 | } 88 | 89 | cb(null,_.values(permissionsResult)); 90 | 91 | } 92 | }); 93 | 94 | } -------------------------------------------------------------------------------- /services/UserService.js: -------------------------------------------------------------------------------- 1 | // 用户登录 2 | module.exports.login = function(username,password,cb) { 3 | console.log("登录 %s %s",username,password); 4 | } -------------------------------------------------------------------------------- /test/api/private/common/common.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | // set development environment 3 | process.env.NODE_ENV = 'test'; 4 | var chai = require('chai'); 5 | var chaiHttp = require('chai-http'); 6 | var app = require(path.join(process.cwd(),"app")); 7 | chai.use(chaiHttp); 8 | 9 | var config = require(path.join(process.cwd(),"test/configs/config")); 10 | var loginURL = config.baseURL + "login"; 11 | 12 | module.exports.login = function(username,password,cb) { 13 | // admin login 14 | chai 15 | .request(app) 16 | .post(loginURL) 17 | .send({"username":username,"password":password}) 18 | .end(cb); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/api/private/v1/goods.test.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | var dao = require(path.join(process.cwd(),"dao/DAO")); 3 | // set development environment 4 | process.env.NODE_ENV = 'test'; 5 | var chai = require('chai'); 6 | var chaiHttp = require('chai-http'); 7 | var app = require(path.join(process.cwd(),"app")); 8 | chai.use(chaiHttp); 9 | 10 | var common = require("../common/common.js"); 11 | 12 | var config = require(path.join(process.cwd(),"test/configs/config")); 13 | var url = config.baseURL + "goods"; 14 | 15 | describe(url + " good api testing",function(){ 16 | 17 | var token; 18 | 19 | var testGood = { 20 | "goods_name" : "__test_good_name", 21 | "goods_price" : 20, 22 | "goods_number" : 30 23 | } 24 | 25 | before(function(done) { 26 | common.login(config.username,config.password,function(err,res){ 27 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 28 | token = res.body.data.token; 29 | done(); 30 | }); 31 | }); 32 | 33 | after(function(done) { 34 | if(testGood.goods_id && testGood.goods_id > 0) { 35 | dao.destroy("GoodModel",testGood.goods_id,function(err){ 36 | done(); 37 | }); 38 | } 39 | }); 40 | 41 | it("test to create good",function(done){ 42 | chai 43 | .request(app) 44 | .post(url) 45 | .set({"Authorization": token}) 46 | .send(testGood) 47 | .end(function(err,res){ 48 | chai.assert.equal(res.body.meta.status,201,res.body.meta.msg); 49 | chai.assert.isNotNull(res.body.data,"The data is empty"); 50 | testGood = res.body.data; 51 | done(); 52 | }); 53 | }); 54 | 55 | it("test to get good list",function(done){ 56 | chai 57 | .request(app) 58 | .get(url) 59 | .set({"Authorization": token}) 60 | .query({ 61 | "pagenum" : 1, 62 | "pagesize" : 1, 63 | "query" : testGood.goods_name 64 | }) 65 | .end(function(err,res){ 66 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 67 | chai.assert.isOk(res.body.data.goods.length > 0,"The goods is empty"); 68 | done(); 69 | }) 70 | }); 71 | 72 | it("test to delete good",function(done) { 73 | chai.assert.isNotNull(testGood.goods_id,"The goods_id is null"); 74 | var deleteURL = url + "/" + testGood.goods_id; 75 | chai 76 | .request(app) 77 | .del(deleteURL) 78 | .set({"Authorization": token}) 79 | .end(function(err,res) { 80 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 81 | dao.findOne( 82 | "GoodModel", 83 | {"goods_id":testGood.goods_id}, 84 | function(err,good) { 85 | chai.assert.isNull(err,err); 86 | chai.assert.equal(good.is_del,'1',"Delete failure"); 87 | done(); 88 | } 89 | ); 90 | }); 91 | }); 92 | }); 93 | 94 | -------------------------------------------------------------------------------- /test/api/private/v1/login.test.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | // set development environment 3 | process.env.NODE_ENV = 'test'; 4 | var chai = require('chai'); 5 | var chaiHttp = require('chai-http'); 6 | var app = require(path.join(process.cwd(),"app")); 7 | chai.use(chaiHttp); 8 | 9 | var common = require("../common/common.js"); 10 | 11 | var config = require(path.join(process.cwd(),"test/configs/config")); 12 | var url = config.baseURL + "login"; 13 | 14 | describe(url+" login api testing",function(){ 15 | it("test to login",function(done){ 16 | common.login(config.username,config.password,function(err,res){ 17 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 18 | done(); 19 | }); 20 | }); 21 | it("test to login => username is null",function(done){ 22 | common.login(null,config.password,function(err,res){ 23 | chai.assert.equal(res.body.meta.status,400,res.body.meta.msg); 24 | done(); 25 | }); 26 | }); 27 | it("test to login => password is null",function(done){ 28 | common.login(config.username,null,function(err,res){ 29 | chai.assert.equal(res.body.meta.status,400,res.body.meta.msg); 30 | done(); 31 | }); 32 | }); 33 | }); -------------------------------------------------------------------------------- /test/api/private/v1/roles.test.js: -------------------------------------------------------------------------------- 1 | var _ = require('lodash'); 2 | var path = require("path"); 3 | // 设置测试环境 4 | process.env.NODE_ENV = 'test'; 5 | var chai = require('chai'); 6 | var chaiHttp = require('chai-http'); 7 | var app = require(path.join(process.cwd(),"app")); 8 | chai.use(chaiHttp); 9 | 10 | var common = require("../common/common.js"); 11 | var config = require(path.join(process.cwd(),"test/configs/config")); 12 | var loginURL = config.baseURL + "login"; 13 | 14 | var url = config.baseURL + "roles"; 15 | 16 | describe(url + " role api testing",function() { 17 | // manager's token 18 | var token; 19 | 20 | // new role data 21 | var testRole = { 22 | roleName:"__test_role_name", 23 | roleDesc:"__test_role_desc" 24 | }; 25 | 26 | var roleId = -1; 27 | 28 | before(function(done) { 29 | // The api access must be logged in 30 | common.login(config.username,config.password,function(err,res){ 31 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 32 | token = res.body.data.token; 33 | done(); 34 | }); 35 | }); 36 | 37 | after(function(done) { 38 | done(); 39 | }); 40 | 41 | it("test to add a new role",function(done){ 42 | chai 43 | .request(app) 44 | .post(url) 45 | .set({"Authorization": token}) 46 | .send(testRole) 47 | .end(function(err,res){ 48 | chai.assert.equal(res.body.meta.status,201,res.body.meta.msg); 49 | chai.assert.isNotNull(res.body.data,"The result is empty"); 50 | if(res.body.data) { 51 | roleId = res.body.data.roleId; 52 | } 53 | done(); 54 | }); 55 | }); 56 | 57 | it("test to get role's destail",function(done){ 58 | var getURL = url + "/" + roleId; 59 | chai 60 | .request(app) 61 | .get(getURL) 62 | .set({"Authorization": token}) 63 | .end(function(err,res) { 64 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 65 | chai.assert.isNotNull(res.body.data,"The result is empty"); 66 | done(); 67 | }); 68 | }); 69 | 70 | it("test to get role's list",function(done){ 71 | chai 72 | .request(app) 73 | .get(url) 74 | .set({"Authorization": token}) 75 | .end(function(err,res){ 76 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 77 | chai.assert.isOk(res.body.data.length > 0,"获取角色列表失败"); 78 | done(); 79 | }); 80 | }); 81 | 82 | it("test to update role's info",function(done){ 83 | var newRoleName = "__test_new_role_name"; 84 | var newRoleDesc = "__test_new_role_desc"; 85 | var updateURL = url + "/" + roleId; 86 | chai 87 | .request(app) 88 | .put(updateURL) 89 | .set({"Authorization": token}) 90 | .send({ 91 | "roleName" : newRoleName, 92 | "roleDesc" : newRoleDesc 93 | }) 94 | .end(function(err,res){ 95 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 96 | chai.assert.equal(res.body.data.roleName,newRoleName,"The role's name is not updated"); 97 | chai.assert.equal(res.body.data.roleDesc,newRoleDesc,"The role's desc is not updated"); 98 | done(); 99 | }); 100 | }); 101 | 102 | // /:id/rights 103 | it("test to authorize for role",function(done) { 104 | // done(); 105 | }); 106 | 107 | // /:id/rights/:rightId 108 | it("test to revoke authorization for role",function(done){ 109 | // done(); 110 | }); 111 | 112 | it("test to delete role",function(done) { 113 | chai.assert.isOk(roleId > 0,"delete failure"); 114 | if(roleId > 0) { 115 | var delURL = url + "/" + roleId; 116 | chai 117 | .request(app) 118 | .del(delURL) 119 | .set({"Authorization": token}) 120 | .end(function(err,res){ 121 | chai.assert.equal(res.body.meta.status,200,res.body.meta.msg); 122 | done(); 123 | }); 124 | } 125 | }); 126 | }); -------------------------------------------------------------------------------- /test/app.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | var express = require('express') 3 | var bodyParser = require('body-parser') 4 | var path = require('path') 5 | // 路由加载 6 | var mount = require('mount-routes') 7 | 8 | var app = express() 9 | 10 | 11 | /** 12 | * 13 | * 公共系统初始化 14 | * 15 | */ 16 | app.use(bodyParser.json()) 17 | app.use(bodyParser.urlencoded({ extended: true })) 18 | 19 | // 初始化数据库模块 20 | var database = require('./modules/database') 21 | database.initialize(app, function(err) { 22 | if (err) { 23 | console.error('连接数据库失败失败 %s', err) 24 | } 25 | }) 26 | 27 | /** 28 | * 29 | * 后台管理系统初始化 30 | * 31 | */ 32 | // 获取管理员逻辑模块 33 | var managerService = require(path.join(process.cwd(), 'services/ManagerService')) 34 | // 获取角色服务模块 35 | var roleService = require(path.join(process.cwd(), 'services/RoleService')) 36 | 37 | // 设置跨域和相应数据格式 38 | app.all('/api/*', function(req, res, next) { 39 | res.header('Access-Control-Allow-Origin', '*') 40 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, mytoken') 41 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, Authorization') 42 | res.setHeader('Content-Type', 'application/json;charset=utf-8') 43 | res.header('Access-Control-Allow-Headers', 'Content-Type,Content-Length, Authorization, Accept,X-Requested-With') 44 | res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS') 45 | res.header('X-Powered-By', ' 3.2.1') 46 | if (req.method == 'OPTIONS') res.send(200) 47 | /*让options请求快速返回*/ else next() 48 | }) 49 | 50 | // 初始化统一响应机制 51 | var resextra = require('./modules/resextra') 52 | app.use(resextra) 53 | 54 | // 初始化 后台登录 passport 策略 55 | admin_passport = require('./modules/passport') 56 | // 设置登录模块的登录函数衔接 passport 策略 57 | admin_passport.setup(app, managerService.login) 58 | // 设置 passport 登录入口点 59 | app.use('/api/private/v1/login', admin_passport.login) 60 | // 设置 passport 验证路径 61 | app.use('/api/private/v1/*', admin_passport.tokenAuth) 62 | 63 | // 获取验证模块 64 | var authorization = require(path.join(process.cwd(), '/modules/authorization')) 65 | 66 | // 设置全局权限 67 | authorization.setAuthFn(function(req, res, next, serviceName, actionName, passFn) { 68 | if (!req.userInfo || isNaN(parseInt(req.userInfo.rid))) return res.sendResult('无角色ID分配') 69 | // 验证权限 70 | roleService.authRight(req.userInfo.rid, serviceName, actionName, function(err, pass) { 71 | passFn(pass) 72 | }) 73 | }) 74 | 75 | /** 76 | * 77 | * 初始化路由 78 | * 79 | */ 80 | // 带路径的用法并且可以打印出路有表 81 | mount(app, path.join(process.cwd(), '/routes'), true) 82 | 83 | app.all('/ueditor/ue', function(req, res, next) { 84 | res.header('Access-Control-Allow-Origin', '*') 85 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, mytoken') 86 | res.header('Access-Control-Allow-Headers', 'X-Requested-With, Authorization') 87 | res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With, X_Requested_With') 88 | res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS') 89 | res.header('X-Powered-By', ' 3.2.1') 90 | if (req.method == 'OPTIONS') res.send(200) 91 | /*让options请求快速返回*/ else next() 92 | }) 93 | 94 | // 富文本编辑器上传 95 | var ueditor = require(path.join(process.cwd(), '/modules/ueditor')) 96 | // 富文本控件处理qing q 97 | app.use('/ueditor/ue', ueditor) 98 | //. 设置富文本空间地址 99 | app.use('/ueditor', express.static('public/ueditor')) 100 | 101 | app.use('/tmp_uploads', express.static('tmp_uploads')) 102 | app.use('/x/common', express.static('uploads/common')) 103 | app.use('/uploads/goodspics', express.static('uploads/goodspics')) 104 | 105 | var upload_config = require('config').get('upload_config') 106 | app.use('/' + upload_config.get('upload_ueditor'), express.static(upload_config.get('upload_ueditor'))) 107 | 108 | const logistics = require('./modules/Logistics.js') 109 | app.get('/api/private/v1/kuaidi/:orderno', logistics.getLogisticsInfo) 110 | 111 | // 定义日志 112 | // var log4js = require('./modules/logger'); 113 | // log4js.use(app); 114 | 115 | /** 116 | * 117 | * 统一处理无响应 118 | * 119 | */ 120 | // 如果没有路径处理就返回 Not Found 121 | app.use(function(req, res, next) { 122 | res.sendResult(null, 404, 'Not Found') 123 | }) 124 | 125 | app.listen(8888) 126 | 127 | module.exports = app 128 | -------------------------------------------------------------------------------- /test/configs/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "baseURL" : "/api/private/v1/", 3 | "username" : "admin", 4 | "password" : "123456" 5 | } -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vueShop_Server", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./app.js" 7 | }, 8 | "dependencies": { 9 | "bluebird": "^3.5.1", 10 | "body-parser": "~1.18.2", 11 | "busboy": "^0.2.14", 12 | "config": "^1.28.0", 13 | "debug": "~2.6.9", 14 | "express": "^4.16.2", 15 | "gm": "^1.23.0", 16 | "je": "^1.0.2", 17 | "jsonwebtoken": "^7.1.9", 18 | "lodash": "^4.17.4", 19 | "log4js": "^2.4.1", 20 | "morgan": "~1.9.0", 21 | "mount-routes": "^1.0.8", 22 | "multer": "^1.3.0", 23 | "mysql": "^2.15.0", 24 | "node-orm": "^2.1.15", 25 | "node-php-password": "^0.1.2", 26 | "orm": "^4.0.1", 27 | "passport": "^0.4.0", 28 | "passport-http-bearer": "^1.0.1", 29 | "passport-local": "^1.0.0", 30 | "serve-favicon": "~2.4.5", 31 | "underscore": "^1.8.3", 32 | "uniqid": "^4.1.1" 33 | }, 34 | "devDependencies": { 35 | "chai": "^4.1.2", 36 | "chai-http": "^3.0.0", 37 | "gulp": "^3.9.1", 38 | "mocha": "^4.0.1", 39 | "request": "^2.83.0" 40 | } 41 | } 42 | --------------------------------------------------------------------------------