├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── api │ └── index.js ├── assets │ ├── css │ │ ├── account.css │ │ ├── account.less │ │ ├── clean.css │ │ └── theme.min.css │ ├── images │ │ ├── empty.png │ │ ├── empty1.png │ │ └── empty3.png │ └── imgs │ │ ├── 404.png │ │ ├── error.png │ │ ├── icon_close.png │ │ ├── load.gif │ │ ├── loading.gif │ │ ├── loading.png │ │ ├── logo.jpg │ │ └── logo.png ├── components │ ├── Account.vue │ ├── Capacity.vue │ ├── Copy.vue │ ├── Empty.vue │ ├── Forget.vue │ ├── Login.vue │ ├── Notice.vue │ ├── PortraitSelect.vue │ ├── Register.vue │ ├── UserFloat.vue │ ├── WangEnduit.vue │ └── index.js ├── main.js ├── router │ ├── index.js │ └── routes.js ├── store │ └── index.js ├── utils │ ├── index.js │ ├── request.js │ └── store │ │ ├── cookie.js │ │ └── localStorage.js └── views │ ├── error │ └── 404 │ │ └── index.vue │ ├── gallery │ └── index.vue │ ├── home │ ├── base-info.vue │ ├── home.vue │ ├── left-chart.vue │ └── right-chart.vue │ ├── index │ └── index.vue │ ├── layout │ └── index.vue │ ├── setup │ ├── admin.vue │ ├── home.vue │ ├── member.vue │ ├── role.vue │ └── storage.vue │ ├── user │ ├── about.vue │ ├── update.vue │ ├── userInfo.vue │ └── userpwd.vue │ └── word │ ├── delete.vue │ ├── index.vue │ └── upload.vue └── vue.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.* 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

LightPicture

4 | 5 | 6 |

LightPicture - 企业/团队图床系统

7 | ☁ 本仓库前端vue代码;如需完整系统代码请点此查看 8 | 9 | 10 | 11 | ### 安装依赖 12 | ~~~ 13 | npm install 14 | ~~~ 15 | ### 启动项目 16 | ~~~ 17 | npm run serve 18 | ~~~ 19 | 20 | ### 打包项目 21 | ~~~ 22 | npm run build 23 | ~~~ 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ], 5 | 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.21.1", 12 | "core-js": "^2.6.5", 13 | "crypto-js": "^4.0.0", 14 | "echarts": "^5.2.2", 15 | "less": "^3.12.2", 16 | "less-loader": "^7.1.0", 17 | "save": "^2.4.0", 18 | "v-viewer": "^1.6.4", 19 | "view-design": "^4.5.0-beta.1", 20 | "vue": "^2.6.10", 21 | "vue-clipboard2": "^0.3.3", 22 | "vue-json-viewer": "^2.2.21", 23 | "vue-lazyload": "^1.3.3", 24 | "vue-router": "^3.4.9", 25 | "vue-ueditor-wrap": "^2.4.4", 26 | "vue-wechat-title": "^2.0.7", 27 | "vuex": "^3.6.0" 28 | }, 29 | "devDependencies": { 30 | "@vue/cli-plugin-babel": "^3.12.0", 31 | "@vue/cli-plugin-eslint": "^3.12.0", 32 | "@vue/cli-service": "^3.12.0", 33 | "babel-eslint": "^10.0.1", 34 | "eslint": "^5.16.0", 35 | "eslint-plugin-vue": "^5.0.0", 36 | "vue-template-compiler": "^2.6.10", 37 | "vux-loader": "^1.2.9" 38 | }, 39 | "eslintConfig": { 40 | "root": true, 41 | "env": { 42 | "node": true 43 | }, 44 | "extends": [ 45 | "plugin:vue/essential", 46 | "eslint:recommended" 47 | ], 48 | "rules": {}, 49 | "parserOptions": { 50 | "parser": "babel-eslint" 51 | } 52 | }, 53 | "postcss": { 54 | "plugins": { 55 | "autoprefixer": {} 56 | } 57 | }, 58 | "browserslist": [ 59 | "> 1%", 60 | "last 2 versions" 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | LightPicture 11 | 12 | 13 | 49 | 50 | 51 | 52 | 56 |
57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 63 | 64 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 前台接口 3 | * 2021.04.15 4 | */ 5 | 6 | import request from '@/utils/request' 7 | 8 | /** 9 | * 查询基础配置 10 | */ 11 | export function getIndex() { 12 | return request({ 13 | url: '/index', 14 | method: 'get', 15 | }) 16 | } 17 | 18 | 19 | /** 20 | * 登录 21 | * @param {array} data 请求数据 22 | */ 23 | export function postLogin(data) { 24 | return request({ 25 | url: '/account/login', 26 | method: 'post', 27 | data 28 | }) 29 | } 30 | 31 | /** 32 | * 查询概况 33 | */ 34 | export function getUserHome() { 35 | return request({ 36 | url: '/user/home', 37 | method: 'get', 38 | }) 39 | } 40 | 41 | /** 42 | * 查询存储桶概况数据 43 | */ 44 | export function getHomeStorsge() { 45 | return request({ 46 | url: '/user/storage', 47 | method: 'get', 48 | }) 49 | } 50 | 51 | /** 52 | * 查询动态日志 53 | */ 54 | export function getHomeLog(params) { 55 | return request({ 56 | url: '/user/log', 57 | method: 'get', 58 | params 59 | }) 60 | } 61 | 62 | /** 63 | * 查询用户信息 64 | */ 65 | export function getUserInfo() { 66 | return request({ 67 | url: '/user/info', 68 | method: 'get', 69 | }) 70 | } 71 | 72 | /** 73 | * 修改密码 74 | * @param {array} data 请求数据 75 | */ 76 | export function putResetPwd(data) { 77 | return request({ 78 | url: '/user/resetPwd', 79 | method: 'put', 80 | data 81 | }) 82 | } 83 | 84 | /** 85 | * 重置密钥 86 | */ 87 | export function putResetKey() { 88 | return request({ 89 | url: '/user/resetKey', 90 | method: 'put', 91 | }) 92 | } 93 | 94 | /** 95 | * 修改资料 96 | * @param {array} data 请求数据 97 | */ 98 | export function putUpdate(data) { 99 | return request({ 100 | url: '/user/update', 101 | method: 'put', 102 | data 103 | }) 104 | } 105 | 106 | /** 107 | * 查询设置信息 108 | * @param {string} type 请求数据 109 | */ 110 | export function getSetup(type) { 111 | return request({ 112 | url: '/setup/index/'+type, 113 | method: 'get', 114 | }) 115 | } 116 | 117 | /** 118 | * 更新设置 119 | * @param {array} data 请求数据 120 | */ 121 | export function putSetup(data) { 122 | return request({ 123 | url: '/setup/update', 124 | method: 'put', 125 | data:data 126 | }) 127 | } 128 | 129 | /** 130 | * 发送测试邮件 131 | */ 132 | export function postSendMail() { 133 | return request({ 134 | url: '/setup/sendTest', 135 | method: 'post', 136 | }) 137 | } 138 | 139 | /** 140 | * 发送验证码 141 | * @param {array} data 请求数据 142 | */ 143 | export function postCode(data) { 144 | return request({ 145 | url: '/account/sendCode', 146 | method: 'post', 147 | data 148 | }) 149 | } 150 | 151 | /** 152 | * 注册 153 | * @param {array} data 请求数据 154 | */ 155 | export function postReg(data) { 156 | return request({ 157 | url: '/account/register', 158 | method: 'post', 159 | data 160 | }) 161 | } 162 | 163 | /** 164 | * 找回密码 165 | * @param {array} data 请求数据 166 | */ 167 | export function postForget(data) { 168 | return request({ 169 | url: '/account/forget', 170 | method: 'post', 171 | data 172 | }) 173 | } 174 | 175 | /** 176 | * 角色组列表 177 | * @param {array} params 请求数据 178 | */ 179 | export function getRole(params) { 180 | return request({ 181 | url: '/role/query', 182 | method: 'get', 183 | params 184 | }) 185 | } 186 | 187 | /** 188 | * 新增角色 189 | * @param {array} data 请求数据 190 | */ 191 | export function postRole(data) { 192 | return request({ 193 | url: '/role/save', 194 | method: 'post', 195 | data 196 | }) 197 | } 198 | 199 | /** 200 | * 修改角色 201 | * @param {array} data 请求数据 202 | */ 203 | export function putRole(data) { 204 | return request({ 205 | url: '/role/update', 206 | method: 'put', 207 | data 208 | }) 209 | } 210 | 211 | /** 212 | * 删除角色 213 | * @param {array} params 请求数据 214 | */ 215 | export function delRole(params) { 216 | return request({ 217 | url: '/role/delete', 218 | method: 'delete', 219 | params 220 | }) 221 | } 222 | 223 | /** 224 | * 查询存储桶列表 225 | * @param {array} params 请求数据 226 | */ 227 | export function getStorage(params) { 228 | return request({ 229 | url: '/storage/query', 230 | method: 'get', 231 | params 232 | }) 233 | } 234 | 235 | /** 236 | * 查询存储桶类型列表 237 | */ 238 | export function getStorageType() { 239 | return request({ 240 | url: '/storage/type', 241 | method: 'get', 242 | }) 243 | } 244 | 245 | /** 246 | * 新增桶 247 | * @param {array} data 请求数据 248 | */ 249 | export function postStorage(data) { 250 | return request({ 251 | url: '/storage/save', 252 | method: 'post', 253 | data 254 | }) 255 | } 256 | 257 | /** 258 | * 修改桶 259 | * @param {array} data 请求数据 260 | */ 261 | export function putStorage(data) { 262 | return request({ 263 | url: '/storage/update', 264 | method: 'put', 265 | data 266 | }) 267 | } 268 | 269 | /** 270 | * 删除桶 271 | * @param {array} params 请求数据 272 | */ 273 | export function delStorage(params) { 274 | return request({ 275 | url: '/storage/delete', 276 | method: 'delete', 277 | params 278 | }) 279 | } 280 | 281 | /** 282 | * 查询图片列表 283 | * @param {array} params 请求数据 284 | */ 285 | export function getImages(params) { 286 | return request({ 287 | url: '/images/query', 288 | method: 'get', 289 | params 290 | }) 291 | } 292 | 293 | /** 294 | * 删除图片 295 | * @param {array} params 请求数据 296 | */ 297 | export function delImages(params) { 298 | return request({ 299 | url: '/images/delete', 300 | method: 'delete', 301 | params 302 | }) 303 | } 304 | 305 | /** 306 | * 成员列表 307 | * @param {array} params 请求数据 308 | */ 309 | export function getMember(params) { 310 | return request({ 311 | url: '/member/query', 312 | method: 'get', 313 | params 314 | }) 315 | } 316 | 317 | /** 318 | * 新增成员 319 | * @param {array} data 请求数据 320 | */ 321 | export function postMember(data) { 322 | return request({ 323 | url: '/member/save', 324 | method: 'post', 325 | data 326 | }) 327 | } 328 | 329 | /** 330 | * 修改成员 331 | * @param {array} data 请求数据 332 | */ 333 | export function putMember(data) { 334 | return request({ 335 | url: '/member/update', 336 | method: 'put', 337 | data 338 | }) 339 | } 340 | 341 | /** 342 | * 删除成员 343 | * @param {array} params 请求数据 344 | */ 345 | export function delMember(params) { 346 | return request({ 347 | url: '/member/delete', 348 | method: 'delete', 349 | params 350 | }) 351 | } 352 | 353 | /** 354 | * 上传图片 355 | * @param {array} data 请求数据 356 | */ 357 | export function postUpload(data) { 358 | return request({ 359 | url: '/api/upload', 360 | method: 'post', 361 | data 362 | }) 363 | } 364 | 365 | 366 | /** 367 | * 获取更新 368 | */ 369 | export function getUpdate() { 370 | return request({ 371 | url: '/updade/version', 372 | method: 'get', 373 | }) 374 | } 375 | 376 | /** 377 | * 下载更新包 378 | * @param {array} data 请求数据 379 | */ 380 | export function postUpdate(data) { 381 | return request({ 382 | url: '/updade/update', 383 | method: 'post', 384 | data 385 | }) 386 | } 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | -------------------------------------------------------------------------------- /src/assets/css/account.css: -------------------------------------------------------------------------------- 1 | .login_bg { 2 | position: fixed; 3 | width: 100%; 4 | height: 100%; 5 | left: 0; 6 | top: 0; 7 | background-color: rgba(34, 42, 62, 0.3); 8 | background-position: 50%; 9 | background-size: 100%; 10 | } 11 | .login_container { 12 | position: absolute; 13 | top: 50%; 14 | left: 50%; 15 | width: 1100px; 16 | margin: 0 auto; 17 | z-index: 1; 18 | transform: translate(-50%, -50%); 19 | } 20 | .login_body { 21 | width: inherit; 22 | display: flex; 23 | box-shadow: 0px 20px 80px 0px rgba(0, 0, 0, 0.3); 24 | border-radius: 10px; 25 | } 26 | .login-sidebox { 27 | width: 50%; 28 | padding: 60px; 29 | color: #fff; 30 | background: #3887e5; 31 | position: relative; 32 | overflow: hidden; 33 | border-radius: 0 10px 10px 0; 34 | } 35 | .login-sidebox__title h2 { 36 | font-size: 30px; 37 | } 38 | .login-sidebox__title h4 { 39 | font-size: 18px; 40 | margin-top: 10px; 41 | font-weight: normal; 42 | } 43 | .login-sidebox__title p { 44 | font-size: 14px; 45 | margin-top: 10px; 46 | line-height: 1.8; 47 | color: rgba(255, 255, 255, 0.6); 48 | } 49 | .login-sidebox img { 50 | position: absolute; 51 | left: -120px; 52 | bottom: -160px; 53 | width: 550px; 54 | } 55 | .login-logo { 56 | text-align: center; 57 | margin-bottom: 30px; 58 | } 59 | .login-logo .logo { 60 | width: 100px; 61 | margin: 0 auto; 62 | vertical-align: bottom; 63 | } 64 | .login-logo h2 { 65 | font-size: 24px; 66 | margin-top: 20px; 67 | color: #40485b; 68 | } 69 | .login-title { 70 | margin-top: 20px; 71 | } 72 | .login-title h2 { 73 | font-size: 22px; 74 | font-weight: normal; 75 | } 76 | .login-title p { 77 | font-size: 12px; 78 | margin-top: 40px; 79 | line-height: 1.8; 80 | color: rgba(255, 255, 255, 0.8); 81 | } 82 | .login-form { 83 | width: 50%; 84 | padding: 60px 100px; 85 | background: #fff; 86 | border-radius: 10px 0 0 10px; 87 | } 88 | .ivu-login { 89 | margin-bottom: 30px; 90 | } 91 | .ivu-login .page-account-auto-login { 92 | margin-bottom: 24px; 93 | text-align: left; 94 | } 95 | .ivu-login .page-account-auto-login .line { 96 | display: inline-block; 97 | width: 1px; 98 | height: 20px; 99 | background: #999; 100 | } 101 | .copy { 102 | text-align: center; 103 | color: #999; 104 | } 105 | @media (max-height: 650px) { 106 | .login_container { 107 | position: static; 108 | transform: none; 109 | margin: 50px auto; 110 | } 111 | } 112 | @media (max-width: 1200px) { 113 | .login_container { 114 | width: 900px; 115 | } 116 | .login-form { 117 | padding: 60px; 118 | } 119 | } 120 | @media (max-width: 1000px) { 121 | .login_container { 122 | width: 100%; 123 | background: #fff; 124 | margin: 0; 125 | transform: none; 126 | top: 0px; 127 | bottom: 0px; 128 | left: 0px; 129 | right: 0px; 130 | } 131 | .login_body { 132 | box-shadow: none; 133 | } 134 | .login-form { 135 | width: 100%; 136 | padding: 60px 40px; 137 | } 138 | .login-sidebox { 139 | display: none; 140 | } 141 | .login-footer { 142 | margin-top: 0; 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /src/assets/css/account.less: -------------------------------------------------------------------------------- 1 | .login_bg { 2 | position: fixed; 3 | width: 100%; 4 | height: 100%; 5 | left: 0; 6 | top: 0; 7 | background-color: rgba(34, 42, 62, 0.3); 8 | // background-repeat: no-repeat; 9 | background-position: 50%; 10 | background-size: 100%; 11 | } 12 | 13 | .login_container { 14 | position: absolute; 15 | top: 50%; 16 | left: 50%; 17 | width: 1100px; 18 | margin: 0 auto; 19 | z-index: 1; 20 | transform: translate(-50%, -50%); 21 | 22 | } 23 | 24 | .login_body { 25 | width: inherit; 26 | display: flex; 27 | box-shadow: 0px 20px 80px 0px rgba(0, 0, 0, 0.3); 28 | border-radius: 10px; 29 | } 30 | 31 | .login-sidebox { 32 | width: 50%; 33 | padding: 60px; 34 | color: #fff; 35 | background: #3887e5; 36 | position: relative; 37 | overflow: hidden; 38 | border-radius: 0 10px 10px 0; 39 | } 40 | 41 | .login-sidebox__title h2 { 42 | font-size: 30px; 43 | } 44 | 45 | .login-sidebox__title h4 { 46 | font-size: 18px; 47 | margin-top: 10px; 48 | font-weight: normal; 49 | } 50 | 51 | .login-sidebox__title p { 52 | font-size: 14px; 53 | margin-top: 10px; 54 | line-height: 1.8; 55 | color: rgba(255, 255, 255, 0.6); 56 | } 57 | 58 | .login-sidebox img { 59 | position: absolute; 60 | left: -120px; 61 | bottom: -160px; 62 | width: 550px; 63 | } 64 | 65 | .login-logo { 66 | text-align: center; 67 | margin-bottom: 30px; 68 | } 69 | 70 | .login-logo .logo { 71 | width: 100px; 72 | margin: 0 auto; 73 | vertical-align: bottom; 74 | } 75 | 76 | .login-logo h2 { 77 | font-size: 24px; 78 | margin-top: 20px; 79 | color: #40485b; 80 | } 81 | 82 | .login-title { 83 | margin-top: 20px; 84 | } 85 | 86 | .login-title h2 { 87 | font-size: 22px; 88 | font-weight: normal; 89 | } 90 | 91 | .login-title p { 92 | font-size: 12px; 93 | margin-top: 40px; 94 | line-height: 1.8; 95 | color: rgba(255, 255, 255, 0.8); 96 | } 97 | 98 | .login-form { 99 | width: 50%; 100 | padding: 60px 100px; 101 | background: #fff; 102 | border-radius: 10px 0 0 10px; 103 | } 104 | 105 | 106 | 107 | 108 | 109 | 110 | .ivu-login { 111 | margin-bottom: 30px; 112 | 113 | 114 | 115 | .page-account-auto-login { 116 | margin-bottom: 24px; 117 | text-align: left; 118 | 119 | .line { 120 | display: inline-block; 121 | width: 1px; 122 | height: 20px; 123 | background: #999; 124 | } 125 | } 126 | } 127 | 128 | .copy { 129 | text-align: center; 130 | color: #999; 131 | } 132 | 133 | 134 | 135 | 136 | 137 | @media (max-height: 650px) { 138 | .login_container { 139 | position: static; 140 | transform: none; 141 | margin: 50px auto; 142 | } 143 | 144 | 145 | } 146 | 147 | @media (max-width: 1200px) { 148 | .login_container { 149 | width: 900px; 150 | } 151 | 152 | .login-form { 153 | padding: 60px; 154 | } 155 | } 156 | 157 | @media (max-width: 1000px) { 158 | .login_container { 159 | width: 100%; 160 | background: #fff; 161 | margin: 0; 162 | transform: none; 163 | top: 0px; 164 | bottom: 0px; 165 | left: 0px; 166 | right: 0px; 167 | } 168 | 169 | .login_body { 170 | box-shadow: none; 171 | } 172 | 173 | .login-form { 174 | width: 100%; 175 | padding: 60px 40px; 176 | } 177 | 178 | .login-sidebox { 179 | display: none; 180 | } 181 | 182 | .login-footer { 183 | margin-top: 0; 184 | } 185 | } -------------------------------------------------------------------------------- /src/assets/css/clean.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | html { 4 | -webkit-text-size-adjust: 100%; 5 | -ms-text-size-adjust: 100%; 6 | -webkit-overflow-scrolling : touch; 7 | } 8 | html, body, #app{width:100%;height:100%;} 9 | 10 | input[type="submit"], input[type="reset"], input[type="button"], input { 11 | font-family: Arial, Helvetica, sans-serif; 12 | resize: none; 13 | border: none; 14 | } 15 | 16 | body, div, ul, li, ol, h1, h2, h3, h4, h5, h6, input, textarea, select, p, dl, dt, dd, a, img, button, form, table, th, tr, td, tbody, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 17 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 18 | font-size:14px; 19 | box-sizing:border-box; 20 | } 21 | 22 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 23 | display: block; 24 | } 25 | 26 | img { 27 | width: 100%; 28 | height: auto; 29 | width: auto\9; /* ie8 */ 30 | display: block; 31 | -ms-interpolation-mode: bicubic;/*为了照顾ie图片缩放失真*/ 32 | } 33 | 34 | body, div, ul, li, ol, h1, h2, h3, h4, h5, h6, input, textarea, select, p, dl, dt, dd, a, img, button, form, table, th, tr, td, tbody, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 35 | margin: 0; 36 | padding: 0; 37 | } 38 | body { 39 | font: 12px/1.5 'Microsoft YaHei','宋体', Tahoma, Arial, sans-serif; 40 | } 41 | em, i { 42 | font-style: normal; 43 | } 44 | ul,li{ 45 | list-style-type: none; 46 | } 47 | strong { 48 | font-weight: normal; 49 | } 50 | .clearfix:after { 51 | content: ""; 52 | display: block; 53 | visibility: hidden; 54 | height: 0; 55 | clear: both; 56 | } 57 | .clearfix { 58 | zoom: 1; 59 | } 60 | a { 61 | text-decoration: none; 62 | color: #969696; 63 | font-family: 'Microsoft YaHei', Tahoma, Arial, sans-serif; 64 | } 65 | a:hover { 66 | text-decoration: none; 67 | } 68 | ul, ol { 69 | list-style: none; 70 | } 71 | h1, h2, h3, h4, h5, h6 { 72 | font-size: 100%; 73 | font-family: 'Microsoft YaHei'; 74 | } 75 | img { 76 | border: none; 77 | } 78 | input{ 79 | font-family: 'Microsoft YaHei'; 80 | } 81 | 82 | .one-txt-cut{ 83 | overflow: hidden; 84 | white-space: nowrap; 85 | text-overflow: ellipsis; 86 | } 87 | 88 | .txt-cut{ 89 | overflow : hidden; 90 | text-overflow: ellipsis; 91 | display: -webkit-box; 92 | -webkit-box-orient: vertical; 93 | } 94 | label{ 95 | font-weight: normal; 96 | } 97 | a:link,a:active,a:visited,a:hover { 98 | background: none; 99 | -webkit-tap-highlight-color: rgba(0,0,0,0); 100 | -webkit-tap-highlight-color: transparent; 101 | } 102 | input[type=button], input[type=submit], input[type=file], button { cursor: pointer; -webkit-appearance: none; } -------------------------------------------------------------------------------- /src/assets/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/images/empty.png -------------------------------------------------------------------------------- /src/assets/images/empty1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/images/empty1.png -------------------------------------------------------------------------------- /src/assets/images/empty3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/images/empty3.png -------------------------------------------------------------------------------- /src/assets/imgs/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/404.png -------------------------------------------------------------------------------- /src/assets/imgs/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/error.png -------------------------------------------------------------------------------- /src/assets/imgs/icon_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/icon_close.png -------------------------------------------------------------------------------- /src/assets/imgs/load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/load.gif -------------------------------------------------------------------------------- /src/assets/imgs/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/loading.gif -------------------------------------------------------------------------------- /src/assets/imgs/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/loading.png -------------------------------------------------------------------------------- /src/assets/imgs/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/logo.jpg -------------------------------------------------------------------------------- /src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osuuu/LightPicture-vue/1aeb04f12d5f160748a7b99b69d410b17cf928cf/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /src/components/Account.vue: -------------------------------------------------------------------------------- 1 | 14 | 21 | 22 | 39 | 40 | -------------------------------------------------------------------------------- /src/components/Capacity.vue: -------------------------------------------------------------------------------- 1 | 14 | 24 | 25 | 51 | 52 | -------------------------------------------------------------------------------- /src/components/Copy.vue: -------------------------------------------------------------------------------- 1 | 14 | 33 | 34 | 45 | 46 | -------------------------------------------------------------------------------- /src/components/Empty.vue: -------------------------------------------------------------------------------- 1 | 14 | 25 | 26 | 36 | 37 | -------------------------------------------------------------------------------- /src/components/Forget.vue: -------------------------------------------------------------------------------- 1 | 14 | 68 | 69 | 190 | 191 | -------------------------------------------------------------------------------- /src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 14 | 48 | 49 | 143 | 144 | -------------------------------------------------------------------------------- /src/components/Notice.vue: -------------------------------------------------------------------------------- 1 | 14 | 29 | 30 | 58 | 59 | -------------------------------------------------------------------------------- /src/components/PortraitSelect.vue: -------------------------------------------------------------------------------- 1 | 14 | 36 | 37 | 75 | 76 | -------------------------------------------------------------------------------- /src/components/Register.vue: -------------------------------------------------------------------------------- 1 | 14 | 86 | 87 | 227 | 228 | -------------------------------------------------------------------------------- /src/components/UserFloat.vue: -------------------------------------------------------------------------------- 1 | 14 | 55 | 56 | 91 | 92 | -------------------------------------------------------------------------------- /src/components/WangEnduit.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 53 | 54 | 71 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | import Empty from './Empty' 13 | import Account from './Account.vue' 14 | import PortraitSelect from './PortraitSelect.vue' 15 | import UserFloat from './UserFloat.vue' 16 | import osCopy from './Copy.vue' 17 | import Notice from './Notice.vue' 18 | import Capacity from './Capacity.vue' 19 | 20 | export default { 21 | install(Vue, options) { 22 | Vue.component('Empty', Empty) 23 | Vue.component('Account', Account) 24 | Vue.component('PortraitSelect', PortraitSelect) 25 | Vue.component('UserFloat', UserFloat) 26 | Vue.component('osCopy', osCopy) 27 | Vue.component('Notice', Notice) 28 | Vue.component('Capacity', Capacity) 29 |   } 30 | } -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | 6 | import ViewUI from 'view-design'; 7 | import 'view-design/dist/styles/iview.css'; 8 | 9 | Vue.use(ViewUI); 10 | 11 | // 加载插件 12 | import components from './components' 13 | Vue.use(components) 14 | // 点击复制 15 | import VueClipboard from 'vue-clipboard2' 16 | Vue.use(VueClipboard) 17 | // 加载进度条 18 | router.beforeEach((to, from, next) => { 19 | ViewUI.LoadingBar.start(); 20 | next(); 21 | }); 22 | router.afterEach(route => { 23 | ViewUI.LoadingBar.finish(); 24 | }); 25 | 26 | // 图片预览 27 | import Viewer from 'v-viewer' 28 | import 'viewerjs/dist/viewer.css' 29 | Vue.use(Viewer) 30 | Viewer.setDefaults({ 31 | Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' } 32 | }) 33 | 34 | // 图片懒加载 35 | import VueLazyLoad from 'vue-lazyload'; 36 | Vue.use(VueLazyLoad, { 37 | // preLoad: 1.3, // 预加载高度的比例 38 | error: require("@/assets/imgs/error.png"), // 加载失败图片 39 | loading: require("@/assets/imgs/load.gif"), // 加载中图片 40 | attempt: 3, // 尝试加载次数 41 | // 不常用参数的一些说明 42 | // 懒加载模块,滚动到对应视图区域之前才加载该模块,模块内容较多时不推荐使用 43 | // 加载速度可能会为用户带来不好的体验,适用于一些信息模块,或者一些非主体模块,适用于少部分用户关注的模块 44 | lazyComponent: true, 45 | // 默认的方法有['scroll', 'wheel', 'mousewheel', 'resize', 'animationend', 'transitionend'] 46 | listenEvents: ['scroll'], 47 | }) 48 | 49 | 50 | import VueWechatTitle from 'vue-wechat-title' 51 | Vue.use(VueWechatTitle) 52 | 53 | 54 | 55 | Vue.config.productionTip = false 56 | 57 | new Vue({ 58 | router, 59 | store, 60 | render: h => h(App), 61 | }).$mount('#app') 62 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | import Vue from 'vue' 13 | import VueRouter from 'vue-router' 14 | // 路由数据 15 | import routes from './routes'; 16 | import store from '@/store' 17 | 18 | Vue.use(VueRouter) 19 | 20 | //解决点击相同路由报错问题 21 | const routerPush = VueRouter.prototype.push 22 | VueRouter.prototype.push = function push(location) { 23 | return routerPush.call(this, location).catch(error=> error) 24 | } 25 | 26 | const router = new VueRouter({ 27 | routes, 28 | // mode: "history", // 路由模式,可选值为 history 或 hash 29 | // base: Setting.routerBase, // 应用的基路径 30 | }); 31 | 32 | /** 33 | * 路由拦截 34 | * 权限验证 35 | */ 36 | 37 | router.beforeEach((to, from, next) => { 38 | // 判断是否需要登录才可以进入 39 | if (to.matched.some(_ => _.meta.auth)) { 40 | // 这里依据 token 判断是否登录,可视情况修改 41 | const token = localStorage.getItem('lp_token'); 42 | 43 | if (token && token !== 'undefined') { 44 | next(); 45 | } else { 46 | // 没有登录的时候跳转到登录界面 47 | // 携带上登陆成功之后需要跳转的页面完整路径 48 | store.state.isAccount = 1 49 | } 50 | } else { 51 | // 不需要身份校验 直接通过 52 | next(); 53 | } 54 | }); 55 | 56 | 57 | 58 | export default router; 59 | -------------------------------------------------------------------------------- /src/router/routes.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | const meta = { 13 | auth: true 14 | }; 15 | 16 | const frameIn = [{ 17 | path: '/', 18 | component: () => import("@/views/layout/index.vue"), 19 | children: [ 20 | { 21 | path: '', 22 | name: 'index', 23 | component: () => import("@/views/index/index.vue"), 24 | meta: { 25 | title: '首页', 26 | icon: 'osuu-net geek-menu_kongzhitai', 27 | isShow: true, 28 | isFold: false, 29 | } 30 | }, 31 | { 32 | path: 'gallery', 33 | name: 'gallery', 34 | component: () => import("@/views/gallery/index.vue"), 35 | meta: { 36 | ...meta, 37 | title: '图库', 38 | icon: 'osuu-net geek-yingxiaogongju-zhututubiao', 39 | isShow: true, 40 | isFold: false, 41 | } 42 | }, 43 | { 44 | path: 'word', 45 | name: 'word', 46 | component: () => import("@/views/word/index.vue"), 47 | meta: { 48 | ...meta, 49 | title: '接口', 50 | icon: 'osuu-net geek-shuju', 51 | isShow: true, 52 | isFold: false, 53 | } 54 | }, 55 | { 56 | path: 'setup', 57 | name: 'setup', 58 | component: { render: (e) => e("router-view") }, 59 | meta: { 60 | title: '系统管理', 61 | icon: 'osuu-net geek-shezhi', 62 | isShow: true, 63 | isFold: true, 64 | }, 65 | children: [{ 66 | path: 'home', 67 | name: "setup-home", 68 | component: () => import("@/views/home/home.vue"), 69 | meta: { 70 | ...meta, 71 | title: '概况', 72 | isShow:true 73 | } 74 | }, 75 | 76 | { 77 | path: 'storage', 78 | name: "setup-storage", 79 | component: () => import("@/views/setup/storage.vue"), 80 | meta: { 81 | ...meta, 82 | title: '存储桶', 83 | isShow:true 84 | } 85 | }, 86 | { 87 | path: 'role', 88 | name: "setup-role", 89 | component: () => import("@/views/setup/role.vue"), 90 | meta: { 91 | ...meta, 92 | title: '角色组', 93 | isShow:true 94 | } 95 | }, 96 | { 97 | path: 'member', 98 | name: "setup-member", 99 | component: () => import("@/views/setup/member.vue"), 100 | meta: { 101 | ...meta, 102 | title: '团队成员', 103 | isShow:true 104 | } 105 | }, 106 | { 107 | path: 'admin', 108 | name: "setup-admin", 109 | component: () => import("@/views/setup/admin.vue"), 110 | meta: { 111 | ...meta, 112 | title: '系统设置', 113 | isShow:false 114 | } 115 | }, 116 | 117 | ] 118 | }, 119 | { 120 | path: 'userInfo', 121 | name: 'userInfo', 122 | component: () => import("@/views/user/userInfo.vue"), 123 | meta: { 124 | ...meta, 125 | title: '个人资料', 126 | isShow: false 127 | } 128 | }, 129 | { 130 | path: 'userpwd', 131 | name: 'userpwd', 132 | component: () => import("@/views/user/userpwd.vue"), 133 | meta: { 134 | ...meta, 135 | title: '修改密码', 136 | isShow: false 137 | } 138 | }, 139 | { 140 | path: 'about', 141 | name: 'about', 142 | component: () => import("@/views/user/about.vue"), 143 | meta: { 144 | ...meta, 145 | title: '关于系统', 146 | isShow: false 147 | } 148 | }, 149 | { 150 | path: 'update', 151 | name: 'update', 152 | component: () => import("@/views/user/update.vue"), 153 | meta: { 154 | ...meta, 155 | title: '系统更新', 156 | isShow: false 157 | } 158 | }, 159 | 160 | ] 161 | }, 162 | 163 | ]; 164 | 165 | 166 | 167 | 168 | /** 169 | * 错误页面 170 | */ 171 | 172 | const errorPage = [ 173 | { 174 | path: '*', 175 | name: '404', 176 | meta: { 177 | title: '404' 178 | }, 179 | component: () => import('@/views/error/404/index.vue') 180 | }, 181 | ]; 182 | 183 | // 导出需要显示菜单的 184 | export const frameInRoutes = frameIn; 185 | 186 | // 重新组织后导出 187 | export default [ 188 | ...frameIn, 189 | ...errorPage 190 | ]; -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | import Vue from 'vue' 13 | import Vuex from 'vuex' 14 | import router from '@/router' 15 | 16 | Vue.use(Vuex) 17 | 18 | export default new Vuex.Store({ 19 | 20 | state: { 21 | isMobile: document.body.clientWidth < 768 ? true : false,//设备类型 22 | isAccount: 0, 23 | userInfo:{}, 24 | config:{}, 25 | isMenu:false 26 | 27 | }, 28 | mutations: { 29 | switchAccount(state, param) { 30 | state.isAccount = param; 31 | if(param == 0){ 32 | router.push({name:"index"}) 33 | } 34 | }, 35 | addUserInfo(state, param) { 36 | state.userInfo = param; 37 | }, 38 | addConfig(state, param) { 39 | state.config = param; 40 | state.config.upload_rule = param.upload_rule.split(","); 41 | }, 42 | 43 | }, 44 | actions: { 45 | 46 | }, 47 | 48 | }) 49 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | export function trim(str) { 13 | return String.prototype.trim.call(str); 14 | } 15 | 16 | export function isType(arg, type) { 17 | return Object.prototype.toString.call(arg) === "[object " + type + "]"; 18 | } 19 | 20 | export function isWeixin() { 21 | return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; 22 | } 23 | 24 | // 存储单位转换 25 | export function toSize(val) { 26 | let size = Number(val) 27 | if (size / 1024 / 1024 / 1024 / 1024 >= 1) { 28 | return (size / 1024 / 1024 / 1024 / 1024).toFixed(2) + " TB" 29 | } else 30 | if (size / 1024 / 1024 / 1024 >= 1) { 31 | return (size / 1024 / 1024 / 1024).toFixed(2) + " GB" 32 | } else 33 | if (size / 1024 / 1024 >= 1) { 34 | return (size / 1024 / 1024).toFixed(2) + " MB" 35 | } else 36 | if (size / 1024 >= 1) { 37 | return (size / 1024).toFixed(2) + " KB" 38 | } else { 39 | return size.toFixed(2) + " B" 40 | } 41 | } 42 | 43 | export function parseQuery() { 44 | const res = {}; 45 | 46 | const query = (location.href.split("?")[1] || "") 47 | .trim() 48 | .replace(/^(\?|#|&)/, ""); 49 | 50 | if (!query) { 51 | return res; 52 | } 53 | 54 | query.split("&").forEach(param => { 55 | const parts = param.replace(/\+/g, " ").split("="); 56 | const key = decodeURIComponent(parts.shift()); 57 | const val = parts.length > 0 ? decodeURIComponent(parts.join("=")) : null; 58 | 59 | if (res[key] === undefined) { 60 | res[key] = val; 61 | } else if (Array.isArray(res[key])) { 62 | res[key].push(val); 63 | } else { 64 | res[key] = [res[key], val]; 65 | } 66 | }); 67 | 68 | return res; 69 | } 70 | 71 | 72 | 73 | const VUE_APP_API_URL = process.env.VUE_APP_API_URL || `${location.origin}/api`; 74 | const VUE_APP_WS_URL = 75 | process.env.VUE_APP_WS_URL || `ws:${location.hostname}:20003`; 76 | 77 | export { 78 | VUE_APP_API_URL, 79 | VUE_APP_WS_URL 80 | }; -------------------------------------------------------------------------------- /src/utils/request.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | import axios from 'axios' 13 | import router from '@/router' 14 | import { Message,Notice } from 'view-design'; 15 | import store from '@/store' 16 | 17 | const service = axios.create({ 18 | baseURL: process.env.VUE_APP_BASE_API, 19 | timeout: 10000 20 | }) 21 | 22 | // http request 请求拦截器 23 | service.interceptors.request.use( 24 | config => { 25 | const AccessToken = localStorage.getItem('lp_token') 26 | if (AccessToken) { 27 | config.headers['Content-Type'] = 'application/json;charset=UTF-8' 28 | config.headers['Token'] = AccessToken 29 | } 30 | config.headers['Accept-Token'] = 'AVOCqrcST9Wy5hr2' 31 | config.headers['User-Time'] = Date.parse(new Date()) 32 | 33 | return config 34 | }, 35 | error => { 36 | return Promise.reject(error) 37 | } 38 | ) 39 | 40 | // http response 响应拦截器 41 | service.interceptors.response.use( 42 | 43 | response => { 44 | const res = response.data 45 | if (res.code == -1) { 46 | router.replace({ 47 | path: '/', 48 | // query: { 49 | // redirect: router.currentRoute.fullPath 50 | // } 51 | }); 52 | store.state.isAccount = 1 53 | store.state.userInfo = {} 54 | return 55 | } 56 | return response.data; 57 | }, 58 | err => { 59 | if (err && err.response && err.response.status) { 60 | switch (err.response.status) { 61 | case 400: 62 | err.message = "错误请求"; 63 | break; 64 | case 401: 65 | err.message = "未授权,请重新登录"; 66 | break; 67 | case 403: 68 | err.message = "拒绝访问,请重新登录"; 69 | break; 70 | case 404: 71 | err.message = "请求错误,未找到该资源"; 72 | break; 73 | case 405: 74 | err.message = "请求方法未允许"; 75 | break; 76 | case 408: 77 | err.message = "请求超时"; 78 | break; 79 | case 500: 80 | err.message = "服务器端出错"; 81 | break; 82 | case 501: 83 | err.message = "网络未实现"; 84 | break; 85 | case 502: 86 | err.message = "网络错误"; 87 | break; 88 | case 503: 89 | err.message = "服务不可用"; 90 | break; 91 | case 504: 92 | err.message = "网络超时"; 93 | break; 94 | case 505: 95 | err.message = "http版本不支持该请求"; 96 | break; 97 | default: 98 | err.message = "连接错误"; 99 | } 100 | } 101 | if (err.response.data.message) { 102 | Notice.error({ 103 | title: '系统出错', 104 | desc: err.response.data.message 105 | }); 106 | } 107 | 108 | Message.error(err.message + ' ' + err.response.status); 109 | return Promise.reject(err) 110 | } 111 | ) 112 | 113 | export default service 114 | -------------------------------------------------------------------------------- /src/utils/store/cookie.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | import { trim, isType } from "@/utils"; 13 | import CryptoJS from "crypto-js"; //加密js 14 | 15 | 16 | // 加密设置cookie 17 | function setCookie(portId, psw, exdays) { 18 | // Encrypt,加密账号密码 19 | var cipherPortId = CryptoJS.AES.encrypt( 20 | portId + "", 21 | "secretkey123" 22 | ).toString(); 23 | var cipherPsw = CryptoJS.AES.encrypt(psw + "", "secretkey123").toString(); 24 | 25 | var exdate = new Date(); //获取时间 26 | exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //保存的天数 27 | //字符串拼接cookie,为什么这里用了==,因为加密后的字符串也有个=号,影响下面getcookie的字符串切割,你也可以使用更炫酷的符号。 28 | window.document.cookie = 29 | "username" + 30 | "==" + 31 | cipherPortId + 32 | ";path=/;expires=" + 33 | exdate.toGMTString(); 34 | window.document.cookie = 35 | "password" + 36 | "==" + 37 | cipherPsw + 38 | ";path=/;expires=" + 39 | exdate.toGMTString(); 40 | } 41 | 42 | //读取加密cookie 43 | function getCookie() { 44 | if (document.cookie.length > 0) { 45 | var arr = document.cookie.split("; "); //这里显示的格式请根据自己的代码更改 46 | for (var i = 0; i < arr.length; i++) { 47 | var arr2 = arr[i].split("=="); //根据==切割 48 | //判断查找相对应的值 49 | if (arr2[0] == "username") { 50 | // Decrypt,将解密后的内容赋值给账号 51 | var bytes = CryptoJS.AES.decrypt(arr2[1], "secretkey123"); 52 | var username = bytes.toString(CryptoJS.enc.Utf8); 53 | } else if (arr2[0] == "password") { 54 | // Decrypt,将解密后的内容赋值给密码 55 | var bytes = CryptoJS.AES.decrypt(arr2[1], "secretkey123"); 56 | var password = bytes.toString(CryptoJS.enc.Utf8); 57 | } 58 | } 59 | return {username,password}; 60 | 61 | } 62 | } 63 | 64 | // 取cookie 65 | function get(key) { 66 | if (!key || !_has(key)) { 67 | return null; 68 | } 69 | let regexpStr = 70 | "(?:^|.*;\\s*)" + 71 | escape(key).replace(/[-.+*]/g, "\\$&") + 72 | "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"; 73 | return JSON.parse(unescape(window.document.cookie.replace(new RegExp(regexpStr), "$1"))); 74 | } 75 | 76 | function all() { 77 | let cookies = window.document.cookie.split(/; ?/g), 78 | data = {}; 79 | for (let i = cookies.length - 1; i >= 0; i--) { 80 | if (!trim(cookies[i])) { 81 | continue; 82 | } 83 | let kvp = cookies[i].split("="); 84 | let key = unescape(kvp[0]); 85 | data[key] = unescape(kvp[1]); 86 | } 87 | return data; 88 | } 89 | 90 | // 存cookie 91 | function set(key, data, time) { 92 | if (!key) { 93 | return; 94 | } 95 | var expiresds = new Date(); //获取时间 96 | expiresds.setTime(expiresds.getTime() + 24 * 60 * 60 * 1000 * time); //保存的天数 97 | data = JSON.stringify(data); 98 | window.document.cookie = 99 | escape(key) + "=" + escape(data) + "; expires=" + expiresds + "; path=/"; 100 | } 101 | 102 | 103 | 104 | 105 | 106 | function remove(key) { 107 | if (!key || !_has(key)) { 108 | return; 109 | } 110 | window.document.cookie = escape(key) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; 111 | } 112 | 113 | function clearAll() { 114 | Object.keys(all()).forEach(function (key) { 115 | remove(key); 116 | }); 117 | } 118 | 119 | function _has(key) { 120 | return new RegExp( 121 | "(?:^|;\\s*)" + escape(key).replace(/[-.+*]/g, "\\$&") + "\\s*\\=" 122 | ).test(window.document.cookie); 123 | } 124 | 125 | export default { 126 | setCookie, 127 | getCookie, 128 | get, 129 | all, 130 | set, 131 | remove, 132 | clearAll, 133 | has: _has 134 | }; 135 | -------------------------------------------------------------------------------- /src/utils/store/localStorage.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | LightPicture [ 图床 ] 3 | // +---------------------------------------------------------------------- 4 | // | 企业团队图片资源管理系统 5 | // +---------------------------------------------------------------------- 6 | // | Github: https://github.com/osuuu/LightPicture 7 | // +---------------------------------------------------------------------- 8 | // | Copyright © http://picture.h234.cn All rights reserved. 9 | // +---------------------------------------------------------------------- 10 | // | Author: Team 11 | // +---------------------------------------------------------------------- 12 | function localStorage() { 13 | return window.localStorage; 14 | } 15 | 16 | function get(key) { 17 | return JSON.parse(localStorage().getItem(key)); 18 | } 19 | 20 | function set(key, data) { 21 | return localStorage().setItem(key, JSON.stringify(data)); 22 | } 23 | 24 | function all() { 25 | const data = {}; 26 | for (var i = localStorage().length - 1; i >= 0; i--) { 27 | var key = localStorage().key(i); 28 | data[key] = get(key); 29 | } 30 | 31 | return data; 32 | } 33 | 34 | function remove(key) { 35 | return localStorage().removeItem(key); 36 | } 37 | 38 | function clearAll() { 39 | return localStorage().clear(); 40 | } 41 | 42 | function has(key) { 43 | return localStorage().getItem(key) !== null; 44 | } 45 | 46 | export default { 47 | get, 48 | set, 49 | all, 50 | remove, 51 | clearAll, 52 | has 53 | }; 54 | -------------------------------------------------------------------------------- /src/views/error/404/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 30 | 33 | 34 | -------------------------------------------------------------------------------- /src/views/gallery/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 105 | 106 | 306 | 307 | -------------------------------------------------------------------------------- /src/views/home/base-info.vue: -------------------------------------------------------------------------------- 1 | 14 | 85 | 127 | -------------------------------------------------------------------------------- /src/views/home/home.vue: -------------------------------------------------------------------------------- 1 | 14 | 31 | 32 | 68 | 69 | -------------------------------------------------------------------------------- /src/views/home/left-chart.vue: -------------------------------------------------------------------------------- 1 | 14 | 52 | 134 | -------------------------------------------------------------------------------- /src/views/home/right-chart.vue: -------------------------------------------------------------------------------- 1 | 14 | 29 | 94 | -------------------------------------------------------------------------------- /src/views/index/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 79 | 80 | 223 | 224 | -------------------------------------------------------------------------------- /src/views/layout/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 88 | 89 | 154 | 155 | -------------------------------------------------------------------------------- /src/views/setup/admin.vue: -------------------------------------------------------------------------------- 1 | 14 | 66 | 67 | 162 | 163 | -------------------------------------------------------------------------------- /src/views/setup/home.vue: -------------------------------------------------------------------------------- 1 | 14 | 28 | 29 | 44 | 45 | -------------------------------------------------------------------------------- /src/views/setup/member.vue: -------------------------------------------------------------------------------- 1 | 14 | 112 | 113 | 427 | 428 | -------------------------------------------------------------------------------- /src/views/setup/role.vue: -------------------------------------------------------------------------------- 1 | 14 | 123 | 124 | 419 | 420 | -------------------------------------------------------------------------------- /src/views/setup/storage.vue: -------------------------------------------------------------------------------- 1 | 14 | 114 | 115 | 351 | 352 | -------------------------------------------------------------------------------- /src/views/user/about.vue: -------------------------------------------------------------------------------- 1 | 14 | 43 | 44 | 61 | 62 | -------------------------------------------------------------------------------- /src/views/user/update.vue: -------------------------------------------------------------------------------- 1 | 52 | 53 | 126 | 127 | -------------------------------------------------------------------------------- /src/views/user/userInfo.vue: -------------------------------------------------------------------------------- 1 | 14 | 80 | 81 | 162 | 163 | -------------------------------------------------------------------------------- /src/views/user/userpwd.vue: -------------------------------------------------------------------------------- 1 | 14 | 59 | 60 | 137 | 138 | -------------------------------------------------------------------------------- /src/views/word/delete.vue: -------------------------------------------------------------------------------- 1 | 14 | 33 | 150 | -------------------------------------------------------------------------------- /src/views/word/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 48 | 49 | 80 | 81 | -------------------------------------------------------------------------------- /src/views/word/upload.vue: -------------------------------------------------------------------------------- 1 | 14 | 33 | 163 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | module.exports = { 3 | publicPath: '/', 4 | outputDir: 'dist', 5 | assetsDir: 'static', 6 | 7 | 8 | 9 | } --------------------------------------------------------------------------------