Comments (3)
var accountName = accountNameInput.value;
var pwd = accountPwdInput.value;
var argstr = 'v_code=' +vcodeinput.value;
sumeru.auth.tpa.login(accountName, pwd, argstr, function(response){
if (response.success) {
//good
}
else {
var authData = sumeru.auth.getModel().getData();
if(authData.info && authData.info.v_url){
//need vcode
var img = rootBlock.querySelector('#vcodeimg');
img.src = 'http://vcode.im.baidu.com/cgi-bin/genimg/?' + authData.info.v_url;
img.onload = function(){
rootBlock.querySelector('#vcodeLabel').style.display = "block";
};
enable_vcode = true;
}
}
}
view template sample:
<div id="loginButtonCenter">
<input type="submit" value="登录" id="loginButton" class="button primary" />
</div>
</form>
from cloudajs.
Thank you for you reply my question . I will have a try.
from cloudajs.
We've removed auth.baidu.login for some internal security reasons in recent versions, but not yet from the API docs.
If you can't get it working right know, you may wait for an update from us with Baidu OAuth, or go to grab an baidu sdk and do it yourself.
from cloudajs.
Related Issues (20)
- touchjs 如果用事件代理 event对象拿不到触发事件的dom
- 怎么开启debug模式 HOT 1
- 点击链接时跳转太快 HOT 2
- 请问clouda在windows平台可以使用吗? HOT 2
- 关于clouda的一些问题(急)!!! HOT 1
- sumeru.collection.create的API说明真当没问题么? HOT 1
- html缓存问题 HOT 1
- sumeru start .... NON BAE MODE
- 求救,关于clouda的文件上传疑问 HOT 1
- 0.10.4 用户登陆,在刷新页面之后不能持久化 HOT 1
- 在controller怎么为session绑定自定义数据?
- 是否考虑支持不同数据源
- view 层最好支持自定义模板,比如支持jade,ejs等等
- expand Validation in Model HOT 1
- 有一个问题感觉很奇怪 HOT 4
- 如何加载font-awesome等第三方图标库
- Android 的QQ浏览器支持问题
- 403 -Forbidden 安卓手机运行轻应用调试时总是出现这个问题 HOT 2
- touch.js的swipe在锤子手机原生浏览器上不能使用 HOT 2
- touchjs的touch.config的使用问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudajs.