您好,我正在制作一个Web API应用程序,我想在注册时使用OTP验证,并且我想将此值存储在会话中,然后再与用户输入的otp代码进行匹配,那么我该如何实现这个。
我的控制器代码如下所示
library(stringr)
replacePunctuation <- function(x){
# if there are multiple punctuations replace them
str_replace(x, pattern = "[[:punct:]]{2,}", " ")
}
sample_data <- c("2 or more punctuations - Are you still.....there?",
"only one punctuation - Are you still, here?")
replacePunctuation(sample_data)
#> [1] "2 or more punctuations - Are you still there?"
#> [2] "only one punctuation - Are you still, here?"
我想将其存储在会话中,并与用户otp在jquery ajax中与enter匹配,请帮助我