add productKey

V0.5.x
荭琪枫 2023-06-28 21:33:03 +08:00
parent 1b193268ce
commit f34ad369d5
5 changed files with 8 additions and 8 deletions

View File

@ -109,7 +109,7 @@ function auth(head, type, payload) {
var dn = arr[1];
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + payload.clientid);
var pwd = md5(product.getProductSecret() + payload.clientid);
if (pwd.toLocaleLowerCase() != payload.password.toLocaleLowerCase()) {
throw new Error("incorrect password");
@ -160,7 +160,7 @@ function register(head, type, payload) {
var dn = arr[1];
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + auth.clientid);
var pwd = md5(product.getProductSecret() + auth.clientid);
if (pwd.toLocaleLowerCase() != auth.password.toLocaleLowerCase()) {
throw new Error("incorrect password");

View File

@ -123,7 +123,7 @@ function register(payload) {
var dn = arr[1];
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + auth.clientid);
var pwd = md5(product.getProductSecret() + auth.clientid);
if (pwd.toLocaleLowerCase() != auth.password.toLocaleLowerCase()) {
throw new Error("incorrect password");

View File

@ -110,7 +110,7 @@ function auth(head, type, payload) {
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + payload.clientid);
var pwd = md5(product.getProductSecret() + payload.clientid);
if (pwd.toLocaleLowerCase() != payload.password.toLocaleLowerCase()) {
throw new Error("incorrect password");
@ -161,7 +161,7 @@ function register(head, type, payload) {
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + auth.clientid);
var pwd = md5(product.getProductSecret() + auth.clientid);
if (pwd.toLocaleLowerCase() != auth.password.toLocaleLowerCase()) {
throw new Error("incorrect password");

View File

@ -127,7 +127,7 @@ function register(payload) {
var device = getPkDn(auth.clientid);
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + auth.clientid);
var pwd = md5(product.getProductSecret() + auth.clientid);
/*if (pwd.toLocaleLowerCase() != auth.password.toLocaleLowerCase()) {
throw new Error("incorrect password");

View File

@ -124,10 +124,10 @@ function register(payload) {
var model = arr[2];
var product = deviceBehaviour.getProductKey(pk)
var pwd = md5(product.productSecret + auth.clientid);
var pwd = md5(product.getProductSecret() + auth.clientid);
if (pwd.toLocaleLowerCase() != auth.password.toLocaleLowerCase()) {
throw new Error("incorrect password");
throw new Error("incorrect password" + "pwd->" + pwd + " productSecret->" + product.productSecret);
}
return {
type: "register",