我有一个 React 应用程序调用 node.js/Express 中的 API。
前端部署在 Netlify (https),后端部署在 Heroku (https)。
我的问题:
说话很便宜,给我看代码....
应用程序.js
require('./configs/passport');
// ...
const app = express();
// trust proxy (https://stackoverflow.com/questions/64958647/express-not-sending-cross-domain-cookies)
app.set("trust proxy", 1);
app.use(
session({
secret: process.env.SESSION_SECRET,
cookie: {
sameSite: process.env.NODE_ENV === "production" ? 'none' : 'lax',
maxAge: 60000000,
secure: process.env.NODE_ENV === "production",
},
resave: true,
saveUninitialized: false,
ttl: 60 * 60 * 24 * 30 …Run Code Online (Sandbox Code Playgroud) 我试图在JS中对innerWidthand 进行求和constant numbers,但是浏览器一直仅附加这些数字,而不进行计算。
奇怪的是给负值工作正常。仅当我尝试将数字加到时,浏览器才会计算innerWidth。
有什么办法可以解决这个问题?
Slider.prototype.sizeReseting = function(event) {
this.frame.style.height = (window.innerWidth - '300') + 'px';
this.frame.style.width = (window.innerWidth - '300') + 'px';
this.film.style.height = (window.innerWidth - '400') + 'px';
this.film.style.width = (window.innerWidth + '100') + 'px';
}
Run Code Online (Sandbox Code Playgroud)