一个简单的OA系统post登录例子

Viewer8122 2023-8-4 1046

老论坛搜索到的,但是年份久远不能用了。这里改进一下!

感谢各位开源前辈~!

import console;
import web.rest.client;
import process

var http = web.rest.client();
http.get("https://oa.tongda2000.com")
var yzmimg = http.get("https://oa.tongda2000.com/module/captcha/captcha_output.php?random=0.3797159275569404")
string.save("r:\yzm.jpg", yzmimg)

process.execute("r:\yzm.jpg")

var yzm = console.getText( "请输入验证码:" )


var html = http.api("https://oa.tongda2000.com/logincheck.php").post(
     UNAME="lijia";
     CAPTCHA=yzm;
     encode_type=1;
);

console.log(html)
console.pause()

console.pause(true);



登录提示:正在进入OA系统,即是成功~!


最新回复 (7)
  • 光庆 2023-8-7
    1 2
    import console;
    import web.rest.client;
    import process
    var http = web.rest.client();
    import godking.ddddOCR
    
    do {
    	console.dump("正在尝试登录……")
    	var yzmimg = http.get("https://oa.tongda2000.com/module/captcha/captcha_output.php?random=0.3797159275569404")
    	var yzm = godking.ddddOCR.ocr(yzmimg);
    	html = http.api("https://oa.tongda2000.com/logincheck.php").post(
         	UNAME="lijia";
         	CAPTCHA=yzm;
         	encode_type=1;
    	);
    } while(!..string.find(html,"@正在进入OA系统"))
    
    console.log("登录成功")
    
    console.pause();

    自动识别验证码 

  • Viewer8122 2023-8-7
    0 3
    光庆 import console; import web.rest.client; import process var ht ...
    谢谢大佬,又学到了。
  • Viewer8122 2023-8-7
    0 4

    刚刚测试了下,识别OCR报错。

  • 光庆 2023-8-7
    0 5
    我这里测了好几遍,都没问题啊 ···
  • 光庆 2023-8-9
    0 6
    import console;
    import godking.ddddOCR
    import godking.http
    do {
        console.dump("正在尝试登录……")
        var yzmimg = godking.http("https://oa.tongda2000.com/module/captcha/captcha_output.php?random=0.3797159275569404")
        var yzm = godking.ddddOCR.ocr(yzmimg);
        html = godking.http("https://oa.tongda2000.com/logincheck.php","post",
            {
             	UNAME="lijia";
             	CAPTCHA=yzm;
             	encode_type=1;
            }
        );
    } while(!..string.find(html,"@正在进入OA系统"))
    console.log("登录成功")
    console.pause();


  • Viewer8122 2023-8-10
    0 7
    光庆 import console; import godking.ddddOCR import godking.http do&nbsp ...
    用了这段代码,还是出错,第七行,出错是 OCR 错。 dddOCR库是在你的库管理下载的 2022-6-20的版本,是不是旧了?
  • 光庆 2023-8-10
    0 8
    Viewer8122 用了这段代码,还是出错,第七行,出错是 OCR 错。 dddOCR库是在你的库管理下载的 2022-6-20的版本,是不是旧了?
    明天整理一下,把例子和库都统一到最新版
返回
发新帖