preface
At present, the company has two platforms, one is for ordinary users to use the h5 client and provide enterprises with services of PCWeb side, the two platforms are sharing a set of login system and user system, over time, in order to distinguish between different business scenarios result in the field of the user system there is a large amount of redundancy, this time is about to start refactoring, the original user separation, but still use the same set of login system. In the process of reconstruction, because of the wrong judgment of the Cookie caused some problems, went a lot of detours, so I decided to record these problems, as a warning.
Cookie is a string of strings written by the server to the client browser, mainly including keys, values, expiration time, path and domain, here mainly says the use of domain.
1. Domain domain don’t fill in
The default is only valid under the current domain
2. The domain specified domain
The cookie is valid for the specified domain and for all subdomains under the domain. This means that the browser automatically puts the cookie in the request header when accessing a resource under a valid domain name
3. Implementation of SSO Single Sign-On
Suppose the login domain name is login.olang.cn, and the login sites need to be verified are a.olange.cn and b.olange.cn. When I access a.olange.cn, because I have not logged in at this time, I will jump to the login page on login.olange.cn. After submitting the login name and password, the verification is successful, and then I will start writing the token into the Cookie. Set the cookies’ domain to their parent domain olange. CN, so that browsers will carry the token when accessing a.olange. CN and b.olange. CN
4. Can the domain be set freely
Yes, but the browser won’t accept it. For security reasons, the browser will only store cookies from the current domain and its parent domain; the rest will be discarded.
Author Archives: Robins
Tailwind installation
I was really served, the installation of a day of various problems reported wrong, the installation of official website documents is completely not good, I search the tutorial on the net pull a lot of useless code.
Find out how it works and record it here.
1. Install tailwindcss
npm i tailwindcss
2. Install postcss
npm i postcss
3. Install postcss-loader (pay attention not to install too high version may cause compatibility problems)
npm i [email protected]
4. Add tailwindcss to postcss.config.js without creating a new tailwindcss
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
5. New CSS is added and introduced
@tailwind base;
@tailwind components;
@tailwind utilities;
6. At this point you can use the official website style class name to test, if there is no problem with the other configuration of the official website.
Reset local git account and generate secret key
:
. GIT config –global user.name “XXX”
“> “=” XXX”
2. Git config –global user.email “[email protected]”
s>eygen-t rsa-c “[email protected]”
In Enter, you can see the path to the generated SSH folder and find the two files below it, which are the secret keys of GitLab and GitHub respectively
the original: https://blog.csdn.net/laoxi_liu/article/details/82872717
Clear the user name and password stored in GIT
Clear the username and password stored in Git
Issue: When vscode is not connected to the remote and the new key is still not working, it may be because you set the SSH key on Gitlab with another account. Even if you generate a new id_rsa.pub on this computer and set its value to Gitlab, this setting will not take effect. When you pull the code, you will find that Git will still log in with your old account.
: To try to clear the username and password stored in git, type the following command.
git config --global credential.helper wincred
Git clear saved accounts
Git will automatically save the user name and password you have entered.
Git’s configuration file is ~ /.gitconfig. GitConfig can be opened with Vim ~/. GitConfig from the command line of Git Bash and Mac under Windows.

Windows
git config --system --unset credential.helper
Mac
sudo git config --system --unset credential.helper
Reproduced in: https://www.cnblogs.com/sea-breeze/p/9174557.html
In Linux shell script, about the commonly used flag [- EQ, GT..] in test and if judgment
-e Whether the “Document” exists (commonly used)
-f whether the “Document” exists and is a file (commonly used)
-d whether this “document” exists and is a directory (commonly used)
-b Whether the Document exists and is a Block Device
-c Whether this Document exists and is a Character Device
-s whether this “document” exists and is a Socket file
-p Whether the “Document” exists and is a FIFO (PIPE) file
-l Whether the Document exists and is a link file
p>
-r checks if the document exists and has “readable” permissions
-w checks if the document exists and has the permission to be writable
-x checks if the document exists and has “executable” permissions
-u checks if the document name exists and has the property “SUID”
-g checks if the document name exists and has the attribute “SGID”
-k checks if the document name exists and has a “Sticky bit” property
-s checks if the document exists and is a “non-blank file”
>
>
>
>
>
>
>
>
-nt (newer than) determines whether file1 is newer than file2
-ot (older than) determines whether file1 is older than file2
-ef determines whether file1 and file2 are the same file, which can be used to determine the hard link. The key is to determine if both files point to the same inode
4. About the comparison between two integers, for example test n1 -eq n2
-Eq equals two values.
-Ne is not equal.
-gt n1 is greater than n2 (greater than)
-lt n1 is less than n2 (less than)
-e e n1 is greater than or equal to n2 (greater than or equal)
-le n1 is less than or equal to n2.
5
The test-z string determines if the string is empty and returns true for empty
Test-n string determines that the string is not null and returns false for null
= test -r filename -a-x filename
= test -r filename -a-x filename
– A (and) is both true! Test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file = test-r file-a-x file
-O (OR) Either is true! Test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file = test-r file-o-x file
! Inverse state, such as test! -x file. Returns true if file does not have x
Shell script – EQ – Ne – GT – LT – ge – le
Shell script: eq-ne-gt-lt-gee-le
| operator th> | meaning th> tr> |
|---|---|
| – eq td> | = = td> tr> |
| – ne td> | ! = |
| -gt | > |
| -lt | < |
| -ge | > = |
| -le | < = |
Batch modification of file names on MAC Linux rename command line
[rename] [rename] [rename] [rename] [rename] [rename]
zsh: command not found: rename
So use Homebrew to install it first:
➜ ~ brew install rename
After that, you can directly use a simple one-line command to change the name of multiple files. The general format is as follows:
➜ ~ rename 's/old/new/' *.files
Ex. :
Change the prefix of batch PNG files from ‘ic_’ to ‘ic_setting_’ :
(ic_launcher.png -> ic_setting_launcher.png)
➜ ~ rename 's/ic_/ic_setting_/' *.png
Modify part names of batch files:
(ic_setting_launcher.png -> ic_launcher.png)
➜ ~ rename 's/_setting//' *.png
Supplement:
You can also use :
to change the first five letters to XXXXX (note ^… It’s five.
for i in `ls`; do mv -f $i `echo $i | sed 's/^...../xxxxx/'`; done
Usage is almost the same, the rest is up to us to flexibly use.
Adding prefixes to file names in batch by shell under mac
With the rename command
Install rename using the following command if not installed
brew install rename
rename ‘s/^/logo_/’ *.png
Reproduced in: https://www.cnblogs.com/yibinpan/p/9602170.html
Batch rename files on MAC (add prefix and suffix)
r I in *.PNG
for I in *.PNG; do mv "$i" "pre_${i%.PNG}.PNG" ; Done
code> f> in *.png; do mv "$i" "${i%.PNG}_tail.PNG" ; Done br> <>e>for I i>. do mv “$i” “${i%_Mon.jpg}_Sun.jpg” ; done
Bash modifies the file names in the specified folder through MAC terminal (batch modification)
The original address: http://blog.sina.com.cn/s/blog_9d25acc60102w6n1.html
Take the PNG file for example
1. Open the terminal
cd to the specified folder
3> The input
for i in *.png;do mv "$i" "${i%.png}@2x.png" ;done
You can do what you want
Get the default value of the field
Get all default values:
Select * from syscolumns c inner join systypes t on c.xusertype=t.xusertype left syscolumns c inner join syscolumns t on c.xusertype=t.xusertype left Join sysproperties p on c.id=p.id and c.colid = p.mallid left join syscomments m on c.default =m.id
Get the default value of a single field:
Select * from syscolumns c inner join systypes t on c.xusertype=t.xusertype left syscolumns c inner join syscolumns t on c.xusertype=t.xusertype left Join sysproperties p on c.id=p.id and c.colid = p.mallid left join syscomments m on c.default =m.id where objectProperty (c.id,’IsUserTable’)=1 and object_name(c.id) = ‘T_good’ and objectProperty (c.id) = ‘T_good’ and C.name = ‘field name’