vuvivian's blog

越努力,越幸运.

前端框架: mpvue

对应src文件夹

1
2
3
4
5
6
7
8
9
> sudo npm install vue-cli

> vue init mpvue/mpvue-quickstart wechat

> npm install

> npm run dev

> 微信小程序中导入该项目文件夹

后端环境:将本地搭建成服务器,运行小程序

server文件夹 server下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
> 下载server文件夹  [server下载](https://console.cloud.tencent.com/lav2/dev)

> 将server文件夹复制到项目目录下

> 更改config.js文件夹

> 安装数据库

> 配置数据库信息

> cd server : npm install

> sudo npm install -g nodemon

>初始化数据库 node tools/initdb.js

错误集锦

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1.ERROR! MySQL server PID file could not be found! Starting MySQL .Logging to '/usr/local/mysql/data/wangjuan-air.err'.


2.mac 启动 mysql : https://blog.csdn.net/u012954706/article/details/83929801

3.Access denied for user ''@'localhost' (using password: NO)
https://blog.csdn.net/qq_36324464/article/details/79534605

4. Missing write access to /usr/local/lib/node_modules/n

https://blog.csdn.net/love_dl_forever/article/details/78869371

5.npm ERR! cb() never called!

https://blog.csdn.net/u012982629/article/details/82502554

6.Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

7.MySQL初始密码忘记重置MySQL root密码

8.MYSQL:ER_NOT_SUPPORTED_AUTH_MODE:Client does not support authentication protocol

https://blog.csdn.net/weixin_36094484/article/details/83479992
1
2
3
4
5
6
7
8
9
10
11
12
13

cd /usr/local/mysql/bin/

mysql -uroot -p

启动MySQL服务
sudo /usr/local/MySQL/support-files/mysql.server start

停止MySQL服务
sudo /usr/local/mysql/support-files/mysql.server stop

重启MySQL服务
sudo /usr/local/mysql/support-files/mysql.server restart
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
const CONF = {
serverHost: 'localhost',
tunnelServerUrl: '',
tunnelSignatureKey: '27fb7d1c161b7ca52d73cce0f1d833f9f5b5ec89',

// 腾讯云相关配置可以查看云 API 秘钥控制台:https://console.cloud.tencent.com/capi
qcloudAppId: '1257200652',
qcloudSecretId: 'AKIDVq8C1cb82qTs3z89LI7k7FCuMZYPLPZW',
qcloudSecretKey: 'NMBk49zZvAD1ZswmRrAH8jQs67tXsxnN',
wxMessageToken: 'weixinmsgtoken',

networkTimeout: 30000,


port: '5757',
rootPathname: '',

// 微信小程序 App ID
appId: '',

// 微信小程序 App Secret
appSecret: '',

// 是否使用腾讯云代理登录小程序
useQcloudLogin: true,

/**
* MySQL 配置,用来存储 session 和用户信息
* 若使用了腾讯云微信小程序解决方案
* 开发环境下,MySQL 的初始密码为您的微信小程序 appid
*/
mysql: {
host: 'http://127.0.0.1',
port: 3306,
user: 'root',
db: 'cAuth',
pass: '12345678',
char: 'utf8mb4'
},

cos: {
/**
* 地区简称
* @查看 https://cloud.tencent.com/document/product/436/6224
*/
region: 'ap-guangzhou',
// Bucket 名称
fileBucket: 'qcloudtest',
// 文件夹
uploadFolder: ''
},

// 微信登录态有效期
wxLoginExpires: 7200,
wxMessageToken: 'abcdefgh'
}

module.exports = CONF
本文最后更新于 天前,文中所描述的信息可能已发生改变