关于vue告警:Strings must use singlequote

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dreamstone_xiaoqw/article/details/90453261

vscode环境开发vue-cli脚手架工程,eslint规范检查工具告警笔记

告警

告警内容:

✘  http://eslint.org/docs/rules/quotes          Strings must use singlequote
src\components\question.vue:126:18
    var body = "result=" + JSON.stringify(g_answer);
               ^

这行警告的关键信息:

Strings must use singlequote

百度翻译如下:

字符串必须使用单引号

用代码来说明,即:将

    var body = "result=" + JSON.stringify(g_answer);
               ^

修改为

    var body = 'result=' + JSON.stringify(g_answer);
               ^

即可。

官网指南

按照eslint官网的说法

Javascript 允许你用三种方式定义字符串:双引号,单引号和反勾号(在 ECMAScript 6 中)。例如:

/*eslint-env es6*/
var double = "double";
var single = 'single';
var backtick = `backtick`;    // ES6 only

只需要配置规则即可指定定义字符串的方法。

然而,小编不记得自己配置过,也没有在配置文件中找到相关配置。

暂作猜想:默认其实是使用单引号?

End

附eslint官网关于此问题的链接: https://cn.eslint.org/docs/rules/quotes

展开阅读全文

530 Non-anonymous session must use encryption 问题如何解决

08-31

大家好,小弟最近在做FTP服务器的时候出现问题,当我在服务器端登录#127.0.0.1的时候出现 530 Non-anonymous sessions must use encryption.rn Login failed.rn此类问题,请问这些问题该怎么解决?我用的是vsftpd+fedora7,vsftpd.conf配置文件内容如下:rn# Example config file /etc/vsftpd/vsftpd.confrn#rn# The default compiled in settings are fairly paranoid. This sample filern# loosens things up a bit, to make the ftp daemon more usable.rn# Please see vsftpd.conf.5 for all compiled in defaults.rn#rn# READ THIS: This example file is NOT an exhaustive list of vsftpd options.rn# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd'srn# capabilities.rn#rn# Allow anonymous FTP? (Beware - allowed by default if you comment this out).rnanonymous_enable=NOrn#rn# Uncomment this to allow local users to log in.rnlocal_enable=YESrn#rn# Uncomment this to enable any form of FTP write command.rnwrite_enable=YESrn#rn# Default umask for local users is 077. You may wish to change this to 022,rn# if your users expect that (022 is used by most other ftpd's)rnlocal_umask=022rn#rn# Uncomment this to allow the anonymous FTP user to upload files. This onlyrn# has an effect if the above global write enable is activated. Also, you willrn# obviously need to create a directory writable by the FTP user.rn#anon_upload_enable=YESrn#rn# Uncomment this if you want the anonymous FTP user to be able to creatern# new directories.rn#anon_mkdir_write_enable=YESrn#rn# Activate directory messages - messages given to remote users when theyrn# go into a certain directory.rndirmessage_enable=YESrn#rn# Activate logging of uploads/downloads.rnxferlog_enable=YESrn#rn# Make sure PORT transfer connections originate from port 20 (ftp-data).rnconnect_from_port_20=NOrn#rn# If you want, you can arrange for uploaded anonymous files to be owned byrn# a different user. Note! Using "root" for uploaded files is notrn# recommended!rn#chown_uploads=YESrn#chown_username=whoeverrn#rn# You may override where the log file goes if you like. The default is shownrn# below.rn#xferlog_file=/var/log/vsftpd.logrn#rn# If you want, you can have your log file in standard ftpd xferlog formatrnxferlog_std_format=YESrn#rn# You may change the default value for timing out an idle session.rn#idle_session_timeout=600rn#rn# You may change the default value for timing out a data connection.rn#data_connection_timeout=120rn#rn# It is recommended that you define on your system a unique user which thern# ftp server can use as a totally isolated and unprivileged user.rn#nopriv_user=ftpsecurern#rn# Enable this and the server will recognise asynchronous ABOR requests. Notrn# recommended for security (the code is non-trivial). Not enabling it,rn# however, may confuse older FTP clients.rn#async_abor_enable=YESrn#rn# By default the server will pretend to allow ASCII mode but in fact ignorern# the request. Turn on the below options to have the server actually do ASCIIrn# mangling on files when in ASCII mode.rn# Beware that on some FTP servers, ASCII support allows a denial of servicern# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpdrn# predicted this attack and has always been safe, reporting the size of thern# raw file.rn# ASCII mangling is a horrible feature of the protocol.rn#ascii_upload_enable=YESrn#ascii_download_enable=YESrn#rn# You may fully customise the login banner string:rn#ftpd_banner=Welcome to blah FTP service.rn#rn# You may specify a file of disallowed anonymous e-mail addresses. Apparentlyrn# useful for combatting certain DoS attacks.rn#deny_email_enable=YESrn# (default follows)rn#banned_email_file=/etc/vsftpd/banned_emailsrn#rn# You may specify an explicit list of local users to chroot() to their homern# directory. If chroot_local_user is YES, then this list becomes a list ofrn# users to NOT chroot().rnchroot_list_enable=YESrn# (default follows)rnchroot_list_file=/etc/vsftpd/chroot_listrn#rn# You may activate the "-R" option to the builtin ls. This is disabled byrn# default to avoid remote users being able to cause excessive I/O on largern# sites. However, some broken FTP clients such as "ncftp" and "mirror" assumern# the presence of the "-R" option, so there is a strong case for enabling it.rn#ls_recurse_enable=YESrn#rn# When "listen" directive is enabled, vsftpd runs in standalone mode and rn# listens on IPv4 sockets. This directive cannot be used in conjunction rn# with the listen_ipv6 directive.rnlisten=YESrn#rn# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6rn# sockets, you must run two copies of vsftpd whith two configuration files.rn# Make sure, that one of the listen options is commented !!rn#listen_ipv6=YESrnrnchroot_local_user=YESrnpam_service_name=vsftpdrnuser_config_dir=/etc/vsftpd/ vsftpd_loginrnmax_clients=300rnmax_per_ip=10rnport_enable=NOrnpasv_enable=YESrnpasv_min_port=65341rnpasv_max_port=65351rnuserlist_enable=YESrnuserlist_deny=NOrnuserlist_file=/etc/vsftpd/user_listrntcp_wrappers=YESfile:///usr/share/doc/HTML/index-zh_CN.htmlrnssl_enable=YESrnallow_anon_ssl=NOrnforce_local_data_ssl=YESrnforce_local_logins_ssl=YESrnssl_tlsv1=YESrnssl_sslv2=NOrnssl_sslv3=NOrnrsa_cert_file=/etc/vsftpd/vsftpd.pemrn 论坛

新手上路:报错:Operation must use an updateable query. (100)

05-04

用的是vb.net,源代码如下:只是向access数据库里插入一条记录,rn Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Loadrn Dim conn As New OleDbConnectionrn Dim SqlStr As Stringrn Dim cmd1 As New OleDb.OleDbCommandrn conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\HN\app_data\LD\test.mdb;Persist Security Info=True; User ID=Admin; Jet OLEDB:Database Password="rn cmd1.Connection = connrn conn.Open()rn SqlStr = "INSERT INTO test(tes1) VALUES ('c')"rnrn cmd1.CommandText = SqlStrrn cmd1.ExecuteNonQuery()rn rn cmd1.Dispose()rnrn conn.Close()rn End Subrnrn报错如下:rnOperation must use an updateable query. rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.rnrnSource Error: rnrnrnLine 37: ' SqlStr = "Select * from test"rnLine 38: cmd1.CommandText = SqlStrrnLine 39: cmd1.ExecuteNonQuery()rnLine 40: cmd1.Dispose()rnLine 41: rn rnrnSource File: D:\HN\ld\credit\uploadcrm.aspx.vb Line: 39 rnrnStack Trace: rnrnrn[OleDbException (0x80004005): Operation must use an updateable query.]rn System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267rn System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192rn System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48rn System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106rn System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108rn LD_credit_uploadcrm.Page_Load(Object sender, EventArgs e) in D:\HN\ld\credit\uploadcrm.aspx.vb:39rn System.Web.UI.Control.OnLoad(EventArgs e) +99rn System.Web.UI.Control.LoadRecursive() +47rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061rnrn rnrnrn--------------------------------------------------------------------------------rnVersion Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 rn使用查询语句没问题,哪位高人指点一下,参与有份。 论坛

怎么改才能不是输出:Must use 1 argument

01-11

代码如下rn//TStask.hrn#ifndef TSTACK_Hrn#define TSTACK_Hrnrntemplaternclass Stack rn struct Linkrn T* data;rn Link* next;rn Link(T* dat,Link* nxt):rn data(dat),next(nxt) rn * head;rnpublic:rn Stack() : head(0) rn ~Stack() rn while(head)rn delete pop();rn rn void push(T* dat) rn head = new Link(dat,head);rn rn T* peek() const rn return head ? head->data : 0 ;rn rn T* pop()rn if(head==0) return 0;rn T* result = head->data;rn Link* oldHead = head;rn head = head->next;rn delete oldHead;rn return result;rn rn ;rn#endifrnrn//require.hrn// (c) Bruce Eckel 2000rn// Copyright notice in Copyright.txtrn// Test for error conditions in programsrn// Local "using namespace std" for old compilersrn#ifndef REQUIRE_Hrn#define REQUIRE_Hrn#include rn#include rn#include rn#include rnrninline void require(bool requirement, rn const std::string& msg = "Requirement failed")rn using namespace std;rn if (!requirement) rn fputs(msg.c_str(), stderr);rn fputs("\n", stderr);rn exit(1);rn rnrnrninline void requireArgs(int argc, int args, rn const std::string& msg = rn "Must use %d arguments") rn using namespace std;rn if (argc != args + 1) rn fprintf(stderr, msg.c_str(), args);rn fputs("\n", stderr);rn exit(1);rn rnrnrninline void requireMinArgs(int argc, int minArgs,rn const std::string& msg =rn "Must use at least %d arguments") rn using namespace std;rn if(argc < minArgs + 1) rn fprintf(stderr, msg.c_str(), minArgs);rn fputs("\n", stderr);rn exit(1);rn rnrn rninline void assure(std::ifstream& in, rn const std::string& filename = "") rn using namespace std;rn if(!in) rn fprintf(stderr, "Could not open file %s\n",rn filename.c_str());rn exit(1);rn rnrnrninline void assure(std::ofstream& out, rn const std::string& filename = "") rn using namespace std;rn if(!out) rn fprintf(stderr, "Could not open file %s\n", rn filename.c_str());rn exit(1);rn rnrn#endif // REQUIRE_H ///:~rnrn//主函数rn#include "TStack.h"rn#include "require.h"rn#include rn#include rn#include rnusing namespace std;rnrnclass X rnpublic:rn virtual ~X() cout << "~X" << endl; rn rn;rnrnint main (int argc, char* argv[]) rn requireArgs(argc,1);rn ifstream in(argv[1]);rn assure(in, argv[1]);rn Stack textlines;rn string line;rn while(getlinke(in,line))rn textlines.push(new string(line));rn string* s;rn for(int i = 0;i < 10; i++) rn if((s=(string*)textlines.pop())==0) break;rn cout << *s < xx;rnfor(int j=0; j<10; j++)rn xx.push(new X);rnrn怎么改才能不是输出:Must use 1 argument rn 论坛

Pasting Strings

07-22

DescriptionnnYou are part of a team implementing an HTML editor and have been tasked with the problem of implementing the cut/copy/paste functions. One of your goals is to preserve the formatting of selected text, even though that formatting may be determined by HTML tags outside the range of the actual selected text. nnYou will be provided with a block of formatted text, a starting position B, and an ending position E. Your program should output the text of the substring of that text from B (inclusive) to E (exclusive), prepending and appending formatting tags as necessary so that the output is well formed and has the same format as it had in its original position. nnFor the purposes of this problem, format tags consist of an opening tag (such as ``< b> "), followed by some text, followed by a closing tag (such as ``< / b> "). Opening and closing tags are paired (``< /whatever> " closes ``< whatever> ") and are considered opened between the opening tag and the closing tag. A tag may not be closed unless it is the most recent unclosed tag (e.g., ``< i> abc< b> def< / i> ghi< / b> " is illegal). A tag may not be opened if it is already open (e.g., ``< b> < b> recursive b< / b> < / b> " is illegal).nInputnnInput data will consist of multiple test cases. Each test case will consist of one line of input of the form nnnB E TEXT nnnwhere B is an integer giving the (inclusive) beginning location of the substring, E is an integer giving the (exclusive) ending location of the substring, and TEXT contains the text from which to extract the substring. The TEXT begins after a single blank character immediately following E , and continues to the end of the line. B and E will be specified so that 0 <= B <= E <= length(TEXT) . nnEnd of input will be signaled by the line ``-1 -1 " with a single space following the second -1. nnNo input line will be longer than 200 characters. nnThe TEXT will be composed of characters with an ASCII value >= 32 (the ASCII space) and <= 126 (the ASCII ' '). Opening tags will be of the form ``< X > " where X contains at least 1 character and is composed entirely of the characters `a' to `z', `A' to `Z', `0' to `9', and `-'. Closing tags will be of the form ``< /X > ". The character `< ' will only occur in the input as the first character of an opening or closing tag. nnThe input text will be well formed - all opening tags will be matched with a closing tag, all closing tags will match an opening tag, each closing tag will close the most recent unclosed tag, and tags will not be recursive (each tag must be closed prior to reopening). nn0 <= B <= E <= length(TEXT) . Neither B nor E will reference a character that is part of an opening or closing tag except for the character `< '.nOutputnnFor each test case your program should print a single line containing the substring of TEXT from B (inclusive) to E (exclusive), prepending the substring with opening tags and appending the substring with closing tags as necessary so that the output line is well formed and has the same set of open tags as when it was included in the original TEXT .nSample Inputnn0 15 Testing! n18 23 100, 1000, 10000 n4 4 123 n0 16 :-/ :-> :-) :-<-> n-1 -1nSample OutputnnTesting! n1000, n n :-/ :-> :-) :- 问答

没有更多推荐了,返回首页