Commit f69e0260 authored by 范雪寒's avatar 范雪寒

feat: 培生趣鼠的两个假接口

parent 801c7a3d
......@@ -286,8 +286,6 @@ cc.Class({
if (data.userName == 'admin' && data.password == '123456') {
this.showLog('登陆成功!');
callback('登陆成功!');
// this.goNextPage();
// this.goPrePage();
} else {
this.showLog('密码错误!');
callback('密码错误!');
......@@ -323,6 +321,22 @@ cc.Class({
this.showLog('选择游戏: ' + data.gameId);
callback('选择游戏: ' + data.gameId);
break;
case 'PSQS_get_pass_code':
this.showLog('获取验证码: ' + data.phone);
if (Math.random() > 0.5) {
callback({ success: true });
} else {
callback({ success: false, msg: '请输入正确的手机号码。' });
}
break;
case 'PSQS_login':
this.showLog(`登陆/注册: ${data.phone} ${data.code}`);
if (Math.random() > 0.5) {
callback({ success: true });
} else {
callback({ success: false, msg: '验证码错误。' });
}
break;
default:
this.showLog('未定义接口: ' + apiName);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment