RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-341777

inject CR's questions

Martin Hope
inject CR
Asked: 2022-08-02 22:16:11 +0000 UTC

如何将所有 API 请求记录到控制台?[关闭]

  • 0
关闭。这个问题需要澄清或补充细节。目前不接受回复。

想改进这个问题?通过编辑此帖子添加更多详细信息并澄清问题。

3 个月前关闭。

改进问题

main.ts

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule,
    {
      logger: console,
    }
  );
  await app.listen(4000);
}
bootstrap();
api rest
  • 1 个回答
  • 27 Views
Martin Hope
inject CR
Asked: 2022-08-27 15:34:55 +0000 UTC

我如何像 api 一样显示 json 而不是布局

  • 0
import { GetServerSideProps } from "next"
import { FC } from "react"

const App: FC = (props: any) => {
 
  return (props)
}

export default App


export const getServerSideProps: GetServerSideProps = async (context) => {
  const props = await {
    test: 'Test'
  }
  return await {props}
}

是否可以输出而不是HTML jason 对象Content-Type application/json?是否可以自定义组件的渲染?

javascript
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2022-07-20 23:19:34 +0000 UTC

如何制作单词过滤器,但同时使字母不和谐

  • 0

如何制作一个单词过滤器,但同时让字母不和谐地工作,也就是说,这个单词中的所有字母都是真实的

'testWordForSearch'.match('ts')

这已经是错误的

'testWordForSearch'.match('tsu')

也欢迎 使用 nodejs模块

比赛我只用过

javascript
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2021-12-28 01:07:12 +0000 UTC

如何使用 js 对象优化数组?

  • 0

您需要组合两个相同的属性,例如来自这样的数组

allow = [
 { path2: ['TEST1'] },
 { path2: ['TEST2' ] },
 { path1: ['TEST3' ] }
]

得到一个

allow = [
 { path2: ['TEST1','TEST2'] },
 { path1: ['TEST3'] }
]

即删除重复的键并合并它们的属性

javascript
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2021-10-28 05:35:39 +0000 UTC

如何通过第二级嵌套过滤第一个对象?

  • 0

引用

const data = [
    {
      name: 'dir1',
      dir: [
        {
          name: 'dir1_inner',
          dir: []
        }
      ]
    },
    {
      name: 'dir2',
      dir: [
        {
          name: 'dir1_inner',
          dir: []
        },
        {
          name: 'dir3_inner',
          dir: []
        },
        {
          name: 'dir4_inner',
          dir: []
        },
      ]
    },
    {
      name: 'dir3',
      dir: [
        {
          name: 'dir1_inner',
          dir: []
        },
        {
          name: 'dir3_inner',
          dir: []
        }
      ]
    },
]


const allowed        = ['dir1', 'dir2', 'dir3']
const allowedInner   = ['dir3_inner']
const accesses       = []

allowed.map( allow => {

  accesses.push(...data.filter(data => !data.name.search(allow) ))

})

console.log(accesses)

accesses数组应该包含子对象相等的对象{name: 'dir3_inner'}

孩子们自己应该保持作为一个完整的对象{name: 'dir3_inner'}

data = [
    {
      name: 'dir2',
      dir: [
        {
          name: 'dir3_inner',
          dir: []
        }
      ]
    },
    {
      name: 'dir3',
      dir: [
        {
          name: 'dir3_inner',
          dir: []
        }
      ]
    }
]
javascript
  • 2 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2021-10-25 03:31:35 +0000 UTC

如何组合一个对象但同时它们的数组值

  • 1
const service  = {var1: 'string',var2: ['1','4','3']}
const mango    = {var1: 'string',var2: ['1','2']}

如果我这样做

const data = Object.assign({}, service, mango)

那么 var2 将是['1','2'] ,如果是这样

const data = Object.assign({}, mango, service)

那么 var2 将是['1','4','3']

但你需要得到['1','4','3','2']

Object.assign可以吗?

javascript
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2021-10-22 22:37:14 +0000 UTC

如何在服务器上以 JSON 格式显示文件夹结构

  • 0

此代码输出一个数组,其中包含dir文件夹中的目录

header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');



$data = scandir('../dir/');
echo json_encode($data);

服务器上的文件夹树是这样的

dir/one/oneChild
dir/two/twoChild
dir/three/threeChild

我想得到这样的JSON格式的东西,即dir文件夹中的整个文件夹结构

[
  {
    "one": {
      "oneChild": {}
    }
  },
  {
    "two": {
      "twoChild": {}
    }
  },
  {
    "three": {
      "threeChild": {}
    }
  }
 ]
php
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-08-16 01:45:16 +0000 UTC

将 ssh 传递给 sed 时如何正确转义

  • 2
ssh ${connect}  "sed -i 's/<!--replacing_base-->/<base href="<?="\/folder\/" . basename(__DIR__) . "\/"?>">/g' ${PATH}"

basename( DIR ) 没有转义如何正确执行?

строки
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-05-18 22:36:05 +0000 UTC

如何知道这个脚本标签?

  • 1
<script>
  console.log(this.remove())
<script>

如果它没有 id 和 classes,我该如何删除这个脚本?

javascript
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-07-25 17:57:11 +0000 UTC

php dirname 离开最后一个文件夹

  • 0
dirname(__FILE__, 1)

dirname函数给了我这一行

/home/admin/web/site.com/public_html/pages/my_folder

我怎样才能得到公正

pages/my_folder

或者

my_folder
php
  • 4 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-07-04 16:39:24 +0000 UTC

如何使用 curl bash 上传 wordpress 帖子

  • 0

有一个标准功能 wp_insert_post() ,如何通过使用此功能插入帖子bash

~$: curl ????

以及在哪里指定WP的登录名和密码

php
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-07-02 17:13:37 +0000 UTC

如何在bash中获得不重复的随机数

  • 0
myarr=()


for i in {0..25}; do

    myarr+=($(shuf -i 1-$POST_NUM -n 1))

done


for i in ${!myarr[@]}; do

    echo ${myarr[$i]}

done

我使用收集随机数数组$(shuf -i 1-$POST_NUM -n 1)

但在数组中有两个相同的数字,有时是连续的数字,在我的情况下这是不允许的。如何在不重复数字的情况下制作数组?

bash
  • 1 个回答
  • 10 Views
Martin Hope
inject CR
Asked: 2020-06-27 16:27:09 +0000 UTC

语法mysql有什么问题

  • 1

sh 脚本有这个代码

export wp_and_db_user="${VESTACP_USER}_${HOST_PREFIX}"
export wp_and_db_pass=${VESTACP_PASS}

mysql -u${wp_and_db_user} -p${wp_and_db_pass} << EOF
use ${wp_and_db_user}

UPDATE `wp_users` SET
`ID` = '1',
`user_login` = '${wp_and_db_user}',
`user_pass` = md5('${wp_and_db_pass}'),
`user_nicename` = '${wp_and_db_user}',
`user_email` = 'timemail@test.com',
`user_url` = '',
`user_registered` = '2019-05-19 11:28:16',
`user_activation_key` = '',
`user_status` = '0',
`display_name` = '${wp_and_db_user}'
WHERE `ID` = '1';

EOF

这是错误

ERROR 1064 (42000) at line 3: 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 'SET = '1', = 'admin_resour', = md5('ODUyNzJmYmEyMmZhMzNmMj'), = 'admin_resour', ' at line 1

尽管我在 phpmyadmin 中测试过这些命令并且它们可以工作,但为什么我会收到错误消息

mysql
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5