| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- collect_parameter = {};
- function collect_init() {
- $('#content').html('');
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"><a href="#" id="get">get</a> <a href="#" id="update">update</a> <a href="#" id="connect">connect</a> <a href="#" id="nameExist">nameExist</a> <a href="#" id="code">code</a> <a href="#" id="regist">regist</a> <a href="#" id="controllerMobile">controllerMobile</a> <a href="#" id="resetPassword">resetPassword</a></td></tr>';
- str += '<tr><td colspan="2"><a href="#" id="validate">validate</a> <a href="#" id="validateDirect">validateDirect</a> <a href="#" id="validateCodeAnswer">validateCodeAnswer</a> <a href="#" id="validatePassword">validatePassword</a></td></tr>';
- str += '<tr><td>enable:</td><td><select id="enable"><option value="true">true</option><option value="false">false</option></select></td></tr>';
- str += '<tr><td>name:</td><td><input id="name" style="width:95%"/></td></tr>';
- str += '<tr><td>password:</td><td><input id="password" type="password" style="width:95%"/></td></tr>';
- str += '<tr><td>mobile:</td><td><input id="mobile" style="width:95%"/></td></tr>';
- str += '<tr><td>codeAnswer:</td><td><input id="codeAnswer" style="width:95%"/></td></tr>';
- str += '</tbody>';
- str += '</table>';
- $('#content').html(str);
- $('#get').click(function() {
- collect_get();
- });
- $('#update').click(function() {
- collect_update();
- });
- $('#connect').click(function() {
- collect_connect();
- });
- $('#validate').click(function() {
- collect_validate();
- });
- $('#validateDirect').click(function() {
- collect_validateDirect();
- });
- $('#validateCodeAnswer').click(function() {
- collect_validateCodeAnswer();
- });
- $('#validatePassword').click(function() {
- collect_validatePassword();
- });
- $('#nameExist').click(function() {
- collect_name_exist($('#name').val());
- });
- $('#code').click(function() {
- collect_code($('#mobile').val());
- });
- $('#regist').click(function() {
- collect_regist();
- });
- $('#controllerMobile').click(function() {
- collect_controller_mobile($('#name').val(), $('#mobile').val());
- });
- $('#resetPassword').click(function() {
- collect_reset_password();
- });
- }
- function collect_get() {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- }).done(function(json) {
- $('#enable').val(json.data.enable + '');
- $('#name').val(json.data.name);
- $('#password').val(json.data.password);
- });
- }
- function collect_update() {
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/collect',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify({
- enable : $('#enable').val(),
- name : $('#name').val(),
- password : $('#password').val()
- }),
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_connect() {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect/connect',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_validate() {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect/validate',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_validateDirect() {
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/collect/validate/direct',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify({
- name : $('#name').val(),
- password : $('#password').val()
- }),
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_validatePassword() {
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/collect/validate/password',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify({
- password : $('#password').val()
- }),
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_validateCodeAnswer() {
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/collect/validate/codeanswer',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify({
- mobile : $('#mobile').val(),
- codeAnswer : $('#codeAnswer').val()
- }),
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_code(mobile) {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect/code/mobile/' + mobile,
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_name_exist(name) {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect/name/' + name + '/exist',
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_regist() {
- $.ajax({
- type : 'post',
- dataType : 'json',
- url : '../jaxrs/collect',
- contentType : 'application/json; charset=utf-8',
- data : JSON.stringify({
- name : $('#name').val(),
- password : $('#password').val(),
- mobile : $('#mobile').val(),
- codeAnswer : $('#codeAnswer').val()
- }),
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_reset_password() {
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/collect/resetpassword',
- contentType : 'application/json; charset=utf-8',
- data : JSON.stringify({
- name : $('#name').val(),
- password : $('#password').val(),
- mobile : $('#mobile').val(),
- codeAnswer : $('#codeAnswer').val()
- }),
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function collect_controller_mobile(name, mobile) {
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/collect/controllermobile/name/' + name + '/mobile/' + mobile,
- contentType : 'application/json; charset=utf-8',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).always(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
|