Quellcode durchsuchen

'添加后端代码'

master
刘冬煜 vor 3 Jahren
Ursprung
Commit
d1c93ce2a2
9 geänderte Dateien mit 28 neuen und 0 gelöschten Zeilen
  1. BIN
      style-transform-master/.vs/style-transform-master/v16/.suo
  2. BIN
      style-transform-master/.vs/style-transform-master/v16/Browse.VC.db
  3. BIN
      style-transform-master/style-transform-master/bin/Microsoft.NodejsTools.WebRole.dll
  4. +1
    -0
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.CoreCompileInputs.cache
  5. +3
    -0
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.FileListAbsolute.txt
  6. BIN
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache
  7. +12
    -0
      style-transform-master/style-transform-master/public/js/getImage.js
  8. BIN
      style-transform-master/style-transform-master/public/tmp/16.jpg
  9. +12
    -0
      style-transform-master/style-transform-master/server.js

BIN
style-transform-master/.vs/style-transform-master/v16/.suo Datei anzeigen


BIN
style-transform-master/.vs/style-transform-master/v16/Browse.VC.db Datei anzeigen


BIN
style-transform-master/style-transform-master/bin/Microsoft.NodejsTools.WebRole.dll Datei anzeigen


+ 1
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.CoreCompileInputs.cache Datei anzeigen

@ -0,0 +1 @@
a006da68cee2e5948f791e89043c9fd33dcfa03a

+ 3
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.FileListAbsolute.txt Datei anzeigen

@ -0,0 +1,3 @@
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\obj\Debug\style-transform-master.njsprojAssemblyReference.cache
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\obj\Debug\style-transform-master.njsproj.CoreCompileInputs.cache
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\bin\Microsoft.NodejsTools.WebRole.dll

BIN
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache Datei anzeigen


+ 12
- 0
style-transform-master/style-transform-master/public/js/getImage.js Datei anzeigen

@ -0,0 +1,12 @@
var xmlhttp = new XMLHttpRequest();
function detectImage(taskID) {
xmlhttp.open("GET","tmp\\"+taskID+".jpg",false);
xmlhttp.send();
if(xmlhttp.readyState == 4) {
if(xmlhttp.status == 200) {
location.replace("./success?taskID=" + taskID);
}
}
}

BIN
style-transform-master/style-transform-master/public/tmp/16.jpg Datei anzeigen

Vorher Nachher
Breite: 512  |  Höhe: 512  |  Größe: 8.1 KiB

+ 12
- 0
style-transform-master/style-transform-master/server.js Datei anzeigen

@ -14,7 +14,19 @@ server.use(cookieParser());
const port = process.env.PORT || 1337;
server.get('/', function (req, res) {
});
server.post('/generate', function (req, res) {
let taskID = Date.now.toString(16);
res.cookie("taskID", taskID, {maxAge: 900000, httpOnly: true});
res.end('<script src="./js/getImage.js"></script><script>setInterval(function() {detectImage("16");}, 5000);</script>');
});
server.get('/success', function (req, res) {
let taskID = req.query.taskID;
res.end();
});
server.listen(port);

Laden…
Abbrechen
Speichern