tumobi / nideshop Goto Github PK
View Code? Open in Web Editor NEWNideShop 开源微信小程序商城服务端 API(Node.js + ThinkJS)
Home Page: https://www.nideshop.com/
License: MIT License
NideShop 开源微信小程序商城服务端 API(Node.js + ThinkJS)
Home Page: https://www.nideshop.com/
License: MIT License
这个源码里面的admin是空的吧,没有页面
目前这个没有管理后台吗
我看商品的图片,大约一张是200k,测试版在手机微信里打开的时候,首页的图片普遍加载很慢。我看服务器是在北美,速度和DNS应该都是挺快的,加载慢是不是单纯因为图片都较大?
原因:支付成功后的notify回调,修改了order.pay_status=2,但是order_status并没有修改,在我的-订单列表中显示的数据只根据order_status判断,所以出现了此bug。
解决:处理好pay_status和order_status
HTTP/1.1 500 Internal Server Error
Vary: Origin
X-Powered-By: thinkjs-3.2.8
Content-Type: text/html; charset=utf-8
Content-Length: 87146
Date: Wed, 15 Aug 2018 07:41:33 GMT
Connection: keep-alive
`
安装完npm start的时候报的错
TypeError: publicController.includes is not a function
git版本号 d957dc5 的后台,下单时请求收货地址失败:
Request URL:http://127.0.0.1:8360/api/cart/checkout?addressId=0&couponId=0
Request Method:GET
Status Code:200 OK
Remote Address:127.0.0.1:8360
Referrer Policy:no-referrer-when-downgrade
Response Headers
view source
Connection:keep-alive
Content-Length:37
Content-Type:application/json; charset=utf-8
Date:Wed, 07 Mar 2018 14:49:55 GMT
Vary:Origin
X-Powered-By:thinkjs-3.2.7
X-Response-Time:1ms
Request Headers
view source
Accept:*/*
Accept-Encoding:gzip, deflate, br
Cache-Control:no-cache
Connection:keep-alive
content-type:application/json
Host:127.0.0.1:8360
Pragma:no-cache
User-Agent:wechatdevtools appservice port/64469
{"errno":401,"errmsg":"请先登录"}
npm run compile
error:SyntaxError: src/common/config/adapter.js: Unexpected token, expected ; (1:8)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile: babel --no-babelrc src/ --presets think-node --out-dir app/
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
const fileCache = require('think-cache-file');
const {Console, File, DateFile} = require('think-logger3');
const path = require('path');
const database = require('./database.js');
const isDev = think.env === 'development';
/**
exports.cache = {
type: 'file',
common: {
timeout: 24 * 60 * 60 * 1000
},
file: {
handle: fileCache,
cachePath: path.join(think.ROOT_PATH, 'runtime/cache'), // absoulte path is necessarily required
pathDepth: 1,
gcInterval: 24 * 60 * 60 * 1000 // gc interval
}
};
/**
exports.model = {
type: 'mysql',
common: {
logConnect: isDev,
logSql: isDev,
logger: msg => think.logger.info(msg)
},
mysql: {
handle: mysql,
database: 'nideshop',
prefix: 'nideshop_',
encoding: 'utf8mb4',
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '我的密码',
dateStrings: true
}
};
我检查了adapter.js语法应该没错的 能帮助一起找一下原因吗?
什么时候能完善一下后台呀
如题
首页耗时太多,发现执行了大量的Sql, 在本地数据库看不出来,稍微慢点的数据库首页就超时,有什么好的解决办法?
nideshop/src/api/controller/index.js
Line 4 in cf81d74
你好,我在新浪sae上配置部署好了服务器后,在小程序上设置了相应的域名,但是在真机调试的时候,请求接口报错访问接口的证书无效,这个是为什么呢? 如何解决还请赐教!
麻烦问一下作者什么时候会做后台管理系统,非常感谢!
错误
SQL 查询:
CREATE TABLE nideshop_keywords
(
keyword
varchar(90) NOT NULL DEFAULT '',
is_hot
tinyint(1) unsigned NOT NULL DEFAULT '0',
is_default
tinyint(1) unsigned NOT NULL DEFAULT '0',
is_show
tinyint(1) unsigned NOT NULL DEFAULT '1',
sort_order
int(11) unsigned NOT NULL DEFAULT '100',
scheme _url
varchar(255) NOT NULL DEFAULT '' COMMENT '关键词的跳转链接',
id
int(11) NOT NULL AUTO_INCREMENT,
type
int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (keyword
,id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='热闹关键词表'
MySQL 返回: 文档
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
请问现在新浪云还可以免备案吗?
单独执行 npm install think-logger3 --no-optional成功之后启动,同样报错找不到模块
部分报错信息如下:
module.js:471
throw err;
^
Error: Cannot find module 'think-logger3'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/mnt/html/nideshop/node_modules/thinkjs/lib/loader.js:2:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Linux 2.6.32-696.1.1.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node development.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node development.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the thinkjs-application package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node development.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs thinkjs-application
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls thinkjs-application
npm ERR! There is likely additional logging output above.
使用acme自动配置SSL,在middleware.js里添加了
{
handle: 'resource',
enable: isDev,
options: {
root: path.join(think.ROOT_PATH, 'www'),
publicPath: /^/(static|favicon.ico|index.html|web.js|styles.css|fonts|.well-known|well-known|.well-known/acme-challenge)/
}
},
试了一下,SSL验证key文件在www里放在well-known/acme-challenge文件夹下的可以访问到,但在.well-known/acme-challenge下访问不到,不知道是为什么
项目正常部署成功,数据导入成功,但是Region数据数据库中只有1000条,还缺失很多区域数据
反对反对
xuetianhhbdeMac-mini:~ xuetianhhb$ npm install
npm WARN enoent ENOENT: no such file or directory, open '/Users/xuetianhhb/package.json'
npm WARN xuetianhhb No description
npm WARN xuetianhhb No repository field.
npm WARN xuetianhhb No README data
npm WARN xuetianhhb No license field.
xuetianhhbdeMac-mini:~ xuetianhhb$
npm start可以,一旦后台托管就有这个问题。
//src/api/controller/user.js
think.RESOURCE_PATH
这个常量已经不在thinkjs3.0中默认支持 需要使用extend自己配置 但是貌似没有找到请麻烦解答一下,谢谢。
RT
这个问题在开发工具上不出现,在手机上会出现.
在物品详情页点击加入购物车后,跳转的下一个场景页面底部栏位不显示
方便大家统一代码风格。
按教程部署到SAE,测试接口发现获取对应商品报404,/api/goods/list等其他接口正常,/api/goods/goods?id=xxx报错。
logic deprecated logic's __after method is deprecated, it will be discarded in the next version node_modules/koa-compose/index.js:42:32 logic deprecated logic's __after method is deprecated, it will be discarded in the next version node_modules/koa-compose/index.js:42:32 { NotFoundError: url
/api/goods/goodsnot found. at Object.throw (/var/www/nideshop/node_modules/koa/lib/context.js:97:11) at beforeTrace.then.then (/var/www/nideshop/node_modules/think-trace/lib/index.js:33:23) at process._tickCallback (internal/process/next_tick.js:68:7) message: 'url
/api/goods/goodsnot found.' } { request: { method: 'GET', url: '/api/goods/goods?id=1181000', header: { 'x-forwarded-for': '58.213.91.10, 58.213.91.10', host: 'yizaohuadian2.applinzi.com', appname: 'yizaohuadian2', appversion: '1', accesskey: 'nxz33x2z4y', secretkey: '2mxi11xkz3hkmx1y34m0mmwzy4y2z03k03hz0m1w', apphash: '273', mysqlport: '0', appcookie: 'default_version=1;saedomain=8;', appmask: '1', appsrvc: '0000000000000000', ipid: '23024', 'x-real-ip': '58.213.91.10', 'x-proto': 'SSL', 'x-forwarded-proto': 'https', 'upgrade-insecure-requests': '1', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36', accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'zh-CN,zh;q=0.9' } }, response: { status: 404, message: 'Not Found', header: [Object: null prototype] { vary: 'Origin', 'x-powered-by': 'thinkjs-3.2.10' } }, app: { subdomainOffset: 2, proxy: true, env: 'production' }, originalUrl: '/api/goods/goods?id=1181000', req: '<original node req>', res: '<original node res>', socket: '<original node socket>' }
npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues
npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! /home/lesvere/oss/code/node/nideshop/npm-debug.log
console里的err数据是正确的微信用户数据
更改了自己的数据库地址和端口,但是报连不上,同样的地址端口,在terminal里面就登陆上了,为啥呢?
{"errno":0,"errmsg":"","data":{"banner":[{"id":1,"ad_position_id":1,"media_type":1,"name":"合作 谁是你的菜","link":"","image_url":"http://yanxuan.nosdn.127.net/65091eebc48899298171c2eb6696fe27.jpg","content":"合作 谁是你的菜","end_time":0,"enabled":1},{"id":2,"ad_position_id":1,"media_type":1,"name":"活动 美食节","link":"","image_url":"http://yanxuan.nosdn.127.net/bff2e49136fcef1fd829f5036e07f116.jpg","content":"活动 美食节","end_time":0,"enabled":1},{"id":3,"ad_position_id":1,"media_type":1,"name":"活动 母亲节","link":"","image_url":"http://yanxuan.nosdn.127.net/8e50c65fda145e6dd1bf4fb7ee0fcecc.jpg","content":"活动 母亲节","end_time":0,"enabled":1}],"channel":[{"id":1,"name":"居家","url":"/pages/category/category?id=1005000","icon_url":"http://ac-3yr0g9cz.clouddn.com/c031ea3cf575f885cd1c.png","sort_order":1},{"id":2,"name":"餐厨","url":"/pages/category/category?id=1005001","icon_url":"http://ac-3yr0g9cz.clouddn.com/4fbe8913819b017ebe1b.png","sort_order":2},{"id":3,"name":"配件","url":"/pages/category/category?id=1008000","icon_url":"http://ac-3yr0g9cz.clouddn.com/e8070853e6c6f5627713.png","sort_order":3},{"id":4,"name":"服装","url":"/pages/category/category?id=1005002","icon_url":"http://ac-3yr0g9cz.clouddn.com/4fa3c0c72964901c5a45.png","sort_order":4},{"id":5,"name":"志趣","url":"/pages/category/category?id=1019000","icon_url":"http://ac- |
---|
Admin只有接口,没有管理后台哦
莫非是小程序里有管理员登录和管理入口?
hi,大神,有api接口文档吗,这样就完美了
新浪云导入nideshop.sql 出现以下错误,求解
错误
SQL 查询:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel' at line 1
有后台管理界面吗?
访问http://localhost:8360/ 时报错Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)
确定mysql密码正确,在cmd中用mysql -u root -p登陆正常,望解答
async uploadAction() {
let brandFile = this.file('brand_pic');
if (think.isEmpty(brandFile)) {
return this.fail('保存失败');
}
let that = this;
let filename = '/static/brand/' + think.uuid(32) + '.jpg';
gm(brandFile.path)
.resize(750, 420, "!")
.write(think.RESOURCE_PATH + filename, function (err) {
if (err) {
that.fail('图片上传失败');
}
that.success({
fileUrl: '' + filename
});
});
}
这部分执行有问题
Linux服务器 执行gm.write 方法, 回调参数 err 是一个空对象,出错信息不明,不知道到底是哪里出错了。
查看 www 下的 brand 文件夹, 也没有刚上传的文件
你好 请问下后台管理端有进展不?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.