1 Star 1 Fork 0

新为向前 / baike-img-manage

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

AiImg

快速开始

$ npm install
$ npm run dev
$ start http://localhost:9000 # Window 
$ open http://localhost:9000 # Mac 
$ npm run build 	// 生产开发环境

目录结构

baike-img-manage
├── package.json
├── package-lock.json
├── postcss.config.json		// postcss 配置项
├── tailwind.config.js 		// tailwind v1.4.6 配置项
├── build 					// webpack 配置
├── dist 					// 打包好的生产环境
├── src
|   ├── css
│   |   ├── font
│   |   └── common.scss
│   ├── img (可选)
│   ├── js
│   |	├── pages			// 设置ejs生成html页面中的标题、跳转路径等变量
│   |	│   ├── index.js	// index.ejs模板变量
│   |	│   └── detail.js	// detail.ejs模板变量
│   |   ├── ajax.js			// axios 配置
│   |   ├── http.js			// api 请求服务器
│   |   └── api.js			// api 请求接口路径
│   └── pages
│       ├── detail
│       |	├──	app.js		// detail 逻辑
│       |	├──	detail.ejs	// detail.html
│       |	└──	style.scss	// detail当前页css
│       └── index
|			├──	app.js		// 同上
|			├──	index.ejs	// 同上
|			└──	style.scss	// 同上

安装

建议通过 nrm 调整安装源 使用git bash 输入以下命令

$ npm i // 安装环境 npm install 简写

本地开发

$ npm run dev # 在浏览器中查看 http://localhost:9000/
# 等待bundle构建完成,未构建完成时会显示无法访问
// 调整请求服务器地址,请在以下地址中修改
// /src/js/http.js
export const apiUrl = "https://www.xxx.com"; // 直接修改服务器地址 例子 'https://www.xxx.com'


// 更改服务器地址下的请求接口路径,请在以下地址中修改
// /src/js/api.js
export default {
	lis: "/api.php", 	// 修改后端请求地址 最后apiUrl拼接成为 'https://www.xxx.com/api.php'
};

eje模板变量

修改网页标题等模板变量, 里面有详细的参数 /src/js/pages/*.js

eje模板变量介绍

打包

$ npm run build

// 生成生产环境
// 只需要把 dist内文件上传到服务器

后端配置变量

  • 后端图片是由缩略图和原图组成
  • index.html请求获得的是缩略图
  • detail.html使用原图生成

智图压缩图片

// api.php 此文件在后端包中
$baseroot = '/www/wwwroot/www.xxxxxx.cn/thumbnail'; //缩略图片存放根目录
$domainurl = "http://www.xxxx.cn/thumbnail/"; //缩略图片访问地址
$limit = 20; //随机获取数量

常见问题

常见问题

更新日志

日志

开源协议

MIT

MIT License Copyright (c) 2021 新为向前 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版 (4)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/tomwang_xyz/baike-img-manage.git
git@gitee.com:tomwang_xyz/baike-img-manage.git
tomwang_xyz
baike-img-manage
baike-img-manage
master

搜索帮助

14c37bed 8189591 565d56ea 8189591