eggjs 读取数据库代码 效果,读取数据库前需要先连接数据库
路由配置
// 读取数据库
router.get('/api/user/:name', controller.user.info);
controller 代码
// app/controller/use...
3年前 (2022-02-03)
喜欢
添加配置
config/plugin.js
'use strict';
/** @type Egg.EggPlugin */
// module.exports = {
// // had enabled by egg
// mysql: {
// enabl...
3年前 (2022-02-03)
喜欢
接口请求示例图
安装依赖
npm i tls-sig-api-v2
使用源码
'use strict';
const Controller = require('egg').Controller;
let TLSSigAPIv2 = require('tls-sig-api...
3年前 (2022-02-03)
喜欢
datalist.splice(0, 0, {
id: '',
name: '全部'
});
...
3年前 (2022-02-02)
喜欢
腾讯im官方文档
腾讯im官方文档
根据文档说明,我们可以看到IM的uniapp版本 这里我们选择国内的gitee地址进行查看
gitee地址
gitee地址
按照readme的说明文档进行相关操作。注册账号,然后下载代码安装依赖。
# 命令行执行
git clone http...
3年前 (2022-02-02)
喜欢
创建文件weatcher
app/controller/weatcher.js
'use strict';
const Controller = require('egg').Controller;
const axios = require('axios');
class...
3年前 (2022-02-02)
喜欢
安装依赖
npm i axios --save
引入
const axios = require('axios');
使用实例eggjs 使用高德地图查询天气
...
3年前 (2022-02-02)
喜欢
computed: {
remark: function() {
var msg = this.item.remark.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag
msg = msg.replace(/...
3年前 (2022-01-31)
喜欢
截取前24个字符
value.substring(0,24)
...
3年前 (2022-01-31)
喜欢
<template>
<div class="avatar">
<u--image width="64rpx" height="64rpx" :src="configs.f...
3年前 (2022-01-31)
喜欢