要实现登录有两个重要组成,一个是共享组件的应用程序项,另一个是共享组件的验证方案,先创建应用程序项:
创建成功
我设置的是启用
确定生成的用于导航到应用程序中其他页的 URL 是否应更易于理解。如果设置为启用,则将使用基于应用程序、页别名和标准 Web 参数语法的目录结构。如果设置为禁用,则将使用 f?p=
旧语法。
注:友好 URL 将在 URL 中包括工作区路径前缀。要修改路径前缀,请转到“工作区管理”>“管理服务”>“设置工作区首选项”。
如果友好 URL 设置为启用,您将能够访问渐进式 Web 应用程序选项。
想要添加的项
APPID
USERID
ROLEID
DEPTID
跟着apex教程
--角色表
CREATE TABLE "SYS_ROLE"
( "P_ID" NUMBER(17,0) NOT NULL ENABLE,
"ROLE_NAME" VARCHAR2(17) NOT NULL ENABLE,
"S_NOTE" VARCHAR2(52),
CONSTRAINT "SYS_ROLE_PK" PRIMARY KEY ("P_ID")
USING INDEX ENABLE,
CONSTRAINT "SYS_ROLE_NAME" UNIQUE ("ROLE_NAME")
USING INDEX ENABLE
)
--角色页面表
CREATE TABLE "SYS_ROLE_PAGE"
( "P_ID" NUMBER(17,0) NOT NULL ENABLE,
"ROLE_NAME" VARCHAR2(17) NOT NULL ENABLE,
"PAGE_ID" NUMBER(17,0) NOT NULL ENABLE,
"S_NOTE" VARCHAR2(52),
CONSTRAINT "SYS_ROLE_PAGE_PK" PRIMARY KEY ("P_ID")
USING INDEX ENABLE,
CONSTRAINT "SYS_ROLE_PAGE_UK1" UNIQUE ("ROLE_NAME", "PAGE_ID")
USING INDEX ENABLE
)
--用户表
CREATE TABLE "SYS_USER"
( "P_ID" NUMBER(13,0) NOT NULL ENABLE,
"USER_NAME" VARCHAR2(17) NOT NULL ENABLE,
"PASS_WORD" VARCHAR2(17) NOT NULL ENABLE,
"S_MOBILE" VARCHAR2(17),
"S_EMAIL" NVARCHAR2(52),
"NICK_NAME" VARCHAR2(17),
CONSTRAINT "SYS_USER_PK" PRIMARY KEY ("P_ID")
USING INDEX ENABLE,
CONSTRAINT "SYS_USER_UK1_USER_NAME" UNIQUE ("USER_NAME")
USING INDEX ENABLE,
CONSTRAINT "SYS_USER_UK2_S_MOBILE" UNIQUE ("S_MOBILE")
USING INDEX ENABLE,
CONSTRAINT "SYS_USER_UK3_S_EMAIL" UNIQUE ("S_EMAIL")
USING INDEX ENABLE
)
--用户角色表
CREATE TABLE "SYS_USER_ROLE"
( "P_ID" NUMBER(17,0) NOT NULL ENABLE,
"USER_NAME" VARCHAR2(17) NOT NULL ENABLE,
"ROLE_NAME" VARCHAR2(17) NOT NULL ENABLE,
"S_NOTE" VARCHAR2(52),
CONSTRAINT "SYS_USER_ROLE_PK" PRIMARY KEY ("P_ID")
USING INDEX ENABLE,
CONSTRAINT "SYS_USER_ROLE_UK1" UNIQUE ("USER_NAME", "ROLE_NAME")
USING INDEX ENABLE
)
根据教程试着自己设计
先创建中间表,使用户、部门、角色、权限四个主表之间建立联系
其他同理
创建值列表:从头开始 → 自定义名称 → 类型:动态Dynamic → 本地数据库 → sql查询 → 编辑sql查询语句 → 验证通过 → 返回列 显示列
sQL查询语句
select name from role_test_wxx2
名称
USER_GROUP_ASSO_NAME
sql查询
select value, key from apex_user_group_code where link is not null
名称
EVENT_CATEGORY_LOV
sql查询
select name,code from tenant_event_category WHERE TENANT_ID = :USERTENANT
名称
FAB_NAME
sql查询
select name, fab_id from fnd_fab WHERE TENANT_ID = :USERTENANT
名称
MAP_AREA_NAME
sql查询
select name, area_id from fnd_areas
名称
USERNAME_LOV
sql查询
select name,ext_user_id from MPF_SHARE_USER_V WHERE TENANT_ID = :USERTENANT
名称
USERNAME_LOV1
sql查询
select name,ext_user_id from MPF_SHARE_USER_V
名称
USER_GROUP_ASSO_NAME
sql查询
select value, key from apex_user_group_code where link is not null
交互式网格p2+表单p12
p2
--在表单中进行sql查询
select USER_ID,
NAME,
GENDER,
MOBILE,
JOB_NUMBER,
rpad('*',length(PASSWORD),'*')as PASSWORD,
EMAIL,
DEVELOPER_ID,
IS_LEAVE,
REMARK,
UPDATE_DATE
from USER_TEST_WXX2
交互式网格加编辑p8
select name from user_test_wxx2
用户和角色值列表配置到用户和角色。
改写之前
改写之后
因为当初选择方案的时候选择已有方案,所以改写失败了
执行之后直接报错,干脆删了
示例视图
将项一股脑全加进去(bushi)
CREATE OR REPLACE FORCE EDITIONABLE VIEW "MPF_SHARE_USER_V" ("EXT_USER_ID", "TENANT_ID", "SYNC_USER_ID", "UNION_ID", "TITLE", "NAME", "AVATAR", "STATE_CODE", "MOBILE", "JOB_NUMBER", "EMAIL", "IS_LEAVE", "HIRED_DATE", "LEADER_SYNC_USER_ID", "LEADER_EXT_USER_ID") AS
select USER_ID AS EXT_USER_ID,
TENANT_ID,
EXTRA_USER_ID AS SYNC_USER_ID,
UNION_ID,
TITLE,
NAME,
AVATAR,
STATE_CODE,
MOBILE,
JOB_NUMBER,
EMAIL,
IS_LEAVE,
HIRED_DATE,
LEADER_EXTRA_USER_ID AS LEADER_SYNC_USER_ID,
LEADER_USER_ID as LEADER_EXT_USER_ID
from MPF.SHARE_BASIC_USER_V
/
-- 用户部门角色权限视图
create view test_wxxa_v as
select u.USER_ID,
u.NAME,
u.GENDER,
u.REMARK,
u.MOBILE,
u.JOB_NUMBER,
u.PASSWORD,
u.EMAIL,
u.DEVELOPER_ID,
u.IS_LEAVE,
du.DEPT_ID,
ru.ROLE_ID,
rp.PERM_ID
FROM USER_TEST_WXX2 u
LEFT JOIN DEPT_USER_TEST_WXX du ON u.USER_ID = du.USER_ID
LEFT JOIN ROLE_USER_TEST_WXX ru ON u.USER_ID = ru.USER_ID
LEFT JOIN ROLE_PERM_TEST_WXX rp ON ru.ROLE_ID = rp.ROLE_ID;
试着仿照验证后过程写一个登录后的过程 TEST_WXXA
create view test_user_wxx_v as
select u.USER_ID,
u.NAME AS USER_NAME,
u.GENDER,
u.REMARK,
u.MOBILE,
u.JOB_NUMBER,
u.PASSWORD,
u.EMAIL,
u.DEVELOPER_ID,
u.IS_LEAVE,
d.DEPT_ID ,
d.NAME AS DEPT_NAME,
d.PARENT_ID AS DEPT_PARENT_ID,
r.ROLE_ID,
r.NAME AS ROLE_NAME,
r.IS_ENABLE AS ROLE_IS_ENABLE,
p.PERM_ID,
p.NAME AS PERM_NAME,
p.PARENT_ID AS PERM_PARENT_ID,
p.URL,
p.APP_ID,
p.PAGE_ID,
p.PAGE_PARENT_ID,
p.IS_ENABLE AS PERM_IS_ENABLE
FROM USER_TEST_WXX2 u
LEFT JOIN DEPT_USER_TEST_WXX du ON u.USER_ID = du.USER_ID
LEFT JOIN DEPT_TEST_WXX3 d on d.DEPT_ID = du.DEPT_ID
LEFT JOIN ROLE_USER_TEST_WXX ru ON u.USER_ID = ru.USER_ID
LEFT JOIN ROLE_TEST_WXX2 r on r.ROLE_ID = ru.ROLE_ID
LEFT JOIN ROLE_PERM_TEST_WXX rp on r.ROLE_ID =rp.ROLE_ID
LEFT JOIN PERM_TEST_WXX2 p on p.PARENT_ID = rp.PERM_ID ;
-- 查询用户表
-- 查询部门表
-- 查询角色表
-- 查询权限表
--改了以后会报错[42000][923] ORA-00923: 未找到要求的 FROM 关键字 Position: 410
create view test_user_wxx_v as
select distinct u.USER_ID,
u.NAME AS USER_NAME,
u.GENDER,
u.REMARK,
u.MOBILE,
u.JOB_NUMBER,
u.PASSWORD,
u.EMAIL,
u.DEVELOPER_ID,
u.IS_LEAVE,
d.DEPT_ID ,
d.NAME AS DEPT_NAME,
d.PARENT_ID AS DEPT_PARENT_ID,
r.ROLE_ID,
r.NAME AS ROLE_NAME,
r.IS_ENABLE AS ROLE_IS_ENABLE default 1 not null,
p.PERM_ID,
p.NAME AS PERM_NAME,
p.PARENT_ID AS PERM_PARENT_ID,
p.URL,
p.APP_ID,
p.PAGE_ID,
p.PAGE_PARENT_ID,
p.IS_ENABLE AS PERM_IS_ENABLE default 1 not null
FROM USER_TEST_WXX2 u
LEFT JOIN DEPT_USER_TEST_WXX du ON u.USER_ID = du.USER_ID and du.IS_ENABLE = 1
LEFT JOIN DEPT_TEST_WXX3 d on d.DEPT_ID = du.DEPT_ID
LEFT JOIN ROLE_USER_TEST_WXX ru ON u.USER_ID = ru.USER_ID
LEFT JOIN ROLE_TEST_WXX2 r on r.ROLE_ID = ru.ROLE_ID
LEFT JOIN ROLE_PERM_TEST_WXX rp on r.ROLE_ID =rp.ROLE_ID
LEFT JOIN PERM_TEST_WXX2 p on p.PARENT_ID = rp.PERM_ID ;
验证方案测试
错误消息 | 用户 | 页 | 日期 |
---|---|---|---|
APEX - 插件处理期间引发的 PLSQL 代码中出错。 - 请与您的应用程序管理员联系。 ORA-06512: 在 "APEX_220200.WWV_FLOW_ERROR", line 1472 ORA-06512: 在 "APEX_220200.WWV_FLOW_ERROR", line 1507 |
只能停止使用验证后过程,去过程中看错在哪里
编译失败, 行 30 (13:58:03)
PL/SQL: ORA-00947: 没有足够的值编译失败, 行 18 (13:58:03)
PL/SQL: SQL Statement ignored
解决方案:是因为源数据表的字段比目标表字段少,不能直接全部插入,将要插入的字段依次写出插入,就不会报错了。
create PROCEDURE TEST_USER_WXX_NOW AS
T_USERID NUMBER(20);
T_DEPTID VARCHAR2(200);
T_ROLEID VARCHAR2(200);
T_PERMID VARCHAR2(200);
-- T_TENANTID VARCHAR2(10);
T_NAME VARCHAR2(48);
T_JOBNUMBER VARCHAR2(10);
-- T_AUTH VARCHAR2(10); --授权
T_MOBILE VARCHAR2(15);
T_EMAIL VARCHAR2(50);
T_COUNT NUMBER(10);
T_ID NUMBER(10);
T_DEPTNAME VARCHAR2(50);
begin
-- 获取用户基础信息
SELECT DEPT_ID,
ROLE_ID,
PERM_ID,
USER_ID,
USER_NAME,
JOB_NUMBER,
MOBILE,
EMAIL,
DEPT_ID
--TENANT_ID
-- --,ATU.BFIRST
INTO T_DEPTID, T_ROLEID,T_PERMID,T_USERID, T_NAME, T_JOBNUMBER, T_MOBILE, T_EMAIL --T_TENANTID --,t_first
FROM TEST_USER_WXX_V
where JOB_NUMBER = upper(V('P9999_USERNAME'));
-- and ROWNUM = 1;
-- 获取用户权限等级
select count(*)
into t_count
from ROLE_USER_TEST_WXX ru
join ROLE_TEST_WXX2 r
on r.ROLE_ID = ru.ROLE_ID
where USER_ID = t_userid;
if t_count > 0 then
select r.ROLE_ID
into T_ROLEID
from ROLE_USER_TEST_WXX ru
join ROLE_TEST_WXX2 r
on r.ROLE_ID = ru.ROLE_ID
where USER_ID = t_userid and rownum=1;
else
select ROLE_ID
into t_id
from ROLE_TEST_WXX2
where IS_ENABLE = 1 and rownum = 1;
insert into ROLE_USER_TEST_WXX(USER_ID, ROLE_ID)
values (t_userid, t_id);
commit;
end if;
-- 设置APP_USER
apex_custom_auth.set_user(t_userid);
-- 将用户登入录信息注入session state
apex_util.set_session_state('ROLEID', t_roleid);
apex_util.set_session_state('DEPT_NAME', t_deptname);
apex_util.set_session_state('USERDEPT', t_deptid);
-- apex_util.set_session_state('USERTENANT', t_tenantid);
apex_util.set_session_state('USERNAME', t_name);
apex_util.set_session_state('USERJOBNUMBER', t_jobnumber);
-- apex_util.set_session_state('USERAUTH', t_auth);
apex_util.set_session_state('USERMOBILE', t_mobile);
end;
修正版本
create or replace PROCEDURE TEST_USER_WXX_NOW AS
T_USERID NUMBER(20);
T_DEPTID VARCHAR2(200);
T_ROLEID VARCHAR2(200);
T_PERMID VARCHAR2(200);
-- T_TENANTID VARCHAR2(10);
T_NAME VARCHAR2(48);
T_JOBNUMBER VARCHAR2(10);
-- T_AUTH VARCHAR2(10); --授权
T_MOBILE VARCHAR2(15);
T_EMAIL VARCHAR2(50);
T_COUNT NUMBER(10);
T_ID NUMBER(10);
T_DEPTNAME VARCHAR2(50);
begin
-- 获取用户基础信息
SELECT DEPT_ID,
ROLE_ID,
PERM_ID,
USER_ID,
USER_NAME,
JOB_NUMBER,
MOBILE,
EMAIL
--TENANT_ID
-- --,ATU.BFIRST
INTO T_DEPTID, T_ROLEID,T_PERMID,T_USERID, T_NAME, T_JOBNUMBER, T_MOBILE, T_EMAIL --T_TENANTID --,t_first
FROM TEST_USER_WXX_V
where JOB_NUMBER = upper(V('P9999_USERNAME'));
-- and ROWNUM = 1;
-- 获取用户权限等级
select count(*)
into t_count
from ROLE_USER_TEST_WXX ru
join ROLE_TEST_WXX2 r
on r.ROLE_ID = ru.ROLE_ID
where USER_ID = t_userid;
if t_count > 0 then
select r.ROLE_ID
into T_ROLEID
from ROLE_USER_TEST_WXX ru
join ROLE_TEST_WXX2 r
on r.ROLE_ID = ru.ROLE_ID
where USER_ID = t_userid and rownum=1;
else
select ROLE_ID
into t_id
from ROLE_TEST_WXX2
where IS_ENABLE = 1 and rownum = 1;
insert into ROLE_USER_TEST_WXX(USER_ID, ROLE_ID)
values (t_userid, t_id);
commit;
end if;
-- 设置APP_USER
apex_custom_auth.set_user(t_userid);
-- 将用户登入录信息注入session state
apex_util.set_session_state('ROLEID', t_roleid);
apex_util.set_session_state('DEPT_NAME', t_deptname);
apex_util.set_session_state('USERDEPT', t_deptid);
-- apex_util.set_session_state('USERTENANT', t_tenantid);
apex_util.set_session_state('USERNAME', t_name);
apex_util.set_session_state('USERJOBNUMBER', t_jobnumber);
-- apex_util.set_session_state('USERAUTH', t_auth);
apex_util.set_session_state('USERMOBILE', t_mobile);
end;
还是有问题
APEX - 插件处理期间引发的 PLSQL 代码中出错。 - 请与您的应用程序管理员联系ORA-06512: 在 "APEX_220200.WWV_FLOW_ERROR", line 1472 ORA-06512: 在 "APEX_220200.WWV_FLOW_ERROR", line 1507
删除权限
刷新
返回布尔
DECLARE
L_AUTH NUMBER(2);
BEGIN
SELECT nvl(max(A.BDELETE),0) INTO L_AUTH FROM AUTH_ROLE_MENU_ASSO A
LEFT JOIN AUTH_MENU B ON A.MENU_ID = B.MENU_ID
WHERE A.ROLE_ID= :ROLEID AND B.PAGE_ID = :APP_PAGE_ID ;
RETURN L_AUTH=1;
END;
您没有删除权限
始终
插入权限
返回布尔
返回布尔
DECLARE
L_AUTH NUMBER(2);
BEGIN
SELECT nvl(max(A.BINSERT),0) INTO L_AUTH FROM AUTH_ROLE_MENU_ASSO A
LEFT JOIN AUTH_MENU B ON A.MENU_ID = B.MENU_ID
WHERE A.ROLE_ID= :ROLEID AND B.PAGE_ID = :APP_PAGE_ID ;
RETURN L_AUTH=1;
END;
您没有插入权限
始终
更新权限
DECLARE
L_AUTH NUMBER(2);
BEGIN
SELECT nvl(max(A.BUPDATE),0) INTO L_AUTH FROM AUTH_ROLE_MENU_ASSO A
LEFT JOIN AUTH_MENU B ON A.MENU_ID = B.MENU_ID
WHERE A.ROLE_ID= :ROLEID AND B.PAGE_ID = :APP_PAGE_ID ;
RETURN L_AUTH=1;
END;
系统管理员
DECLARE
L_AUTH NUMBER(2);
BEGIN
RETURN :USERAUTH<=1;
END;
不是系统管理员
每个会话一次
初级管理员
DECLARE
L_AUTH NUMBER(2);
BEGIN
RETURN :USERAUTH=0;
END;
部门主管
DECLARE
L_AUTH NUMBER(2);
BEGIN
RETURN :USERAUTH<=3;
END;
不是部门主管
部门经理
DECLARE
L_AUTH NUMBER(2);
BEGIN
RETURN :USERAUTH<=2;
END;
参考
create or replace function apex_app_auth_authentication_3(
p_username in varchar2,
p_password in varchar2)
return boolean
as
v_err_msg varchar2(2000);
t_jobnumber varchar2(20);
t_password varchar2(120);
t_count number(10);
T_TENANT NUMBER;
begin
T_TENANT := apex_util.get_session_state('P9999_USER_TENANT');
select count(1)
into t_count
from MPF_SHARE_USER_V
where upper(MOBILE) = upper(p_username)
and IS_LEAVE = 0
AND TENANT_ID = T_TENANT;
if t_count > 0 then
select count(1)
into t_count
from APEX_TENANT_USERS
where MOBILE = upper(p_username)
AND TENANT_ID = T_TENANT
AND DEL_FLAG = 0;
if t_count > 0 then
select MOBILE, PASSWORD
into t_jobnumber,t_password
from APEX_TENANT_USERS
where MOBILE = upper(p_username)
AND TENANT_ID = T_TENANT
AND DEL_FLAG = 0;
else
insert into apex_tenant_users(ext_user_id, del_flag, tenant_id, sync_user_id, unionid, title, name, avatar,
state_code, mobile, job_number, email, is_leave, leader_ext_user_id,
hired_date, Is_Ext_User, LAST_SYNC_DATE)
select EXT_USER_ID,
0,
TENANT_ID,
SYNC_USER_ID,
UNION_ID,
TITLE,
NAME,
AVATAR,
STATE_CODE,
MOBILE,
JOB_NUMBER,
EMAIL,
IS_LEAVE,
LEADER_EXT_USER_ID,
HIRED_DATE,
0,
SYSDATE
FROM MPF_SHARE_USER_V
WHERE MOBILE = upper(p_username)
AND TENANT_ID = T_TENANT;
COMMIT;
update APEX_TENANT_USERS
set PASSWORD = ENCRYPT_ENC('123456')
where MOBILE = upper(p_username)
AND TENANT_ID = T_TENANT
AND DEL_FLAG = 0;
commit;
select MOBILE, PASSWORD
into t_jobnumber,t_password
from APEX_TENANT_USERS
where MOBILE = upper(p_username)
AND TENANT_ID = T_TENANT
AND DEL_FLAG = 0;
end if;
else
apex_util.set_custom_auth_status(p_status => '手机号不存在');
return false;
end if;
if (t_jobnumber is null or t_password is null) then
apex_util.set_custom_auth_status(p_status => '手机号和密码不能为空');
return false;
else
if ENCRYPT_ENC(p_password) <> t_password then
apex_util.set_custom_auth_status(p_status => '手机号或密码错误');
return false;
else
return true;
end if;
end if;
exception
when others then
v_err_msg := sqlerrm || chr(13) || dbms_utility.format_error_backtrace;
WRITE_LOG(GET_FN_NAME(), 'error', 'p_username:' || p_username || chr(13) || v_err_msg, -1, -1);
rollback;
return false;
end ;
验证后过程名 APEX_APP_AUTH_POST_AUTHENTICATION_NOW
create PROCEDURE APEX_APP_AUTH_POST_AUTHENTICATION_NOW AS
T_USERID NUMBER(20);
T_DEPID VARCHAR2(200);
T_TENANTID VARCHAR2(10);
T_NAME VARCHAR2(48);
T_JOBNUMBER VARCHAR2(10);
T_AUTH VARCHAR2(10);
T_MOBILE VARCHAR2(15);
T_EMAIL VARCHAR2(50);
T_COUNT NUMBER(10);
T_ID NUMBER(10);
T_FIRST NUMBER(2);
T_APPKEY VARCHAR2(128);
T_APPSECRET VARCHAR2(128);
BEGIN
SELECT EXT_ORG_ID, EXT_USER_ID, NAME, JOB_NUMBER, MOBILE, EMAIL, TENANT_ID --,ATU.BFIRST
INTO T_DEPID, T_USERID, T_NAME, T_JOBNUMBER, T_MOBILE, T_EMAIL, T_TENANTID --,t_first
FROM -- APEX_TENANT_USERS ATU
MPF_USER_DEPT_MAIN_ASSO_V
WHERE MOBILE = UPPER(V('P9999_USERNAME'))
AND TENANT_ID = V('P9999_USER_TENANT')
AND ROWNUM <2;
-- SELECT APP_KEY,APP_SECRET INTO T_APPKEY,T_APPSECRET FROM TENANT_APP WHERE TENANT_ID = 1 AND NAME = 'APEX-UPGRADE' AND ROWNUM = 1;
--select count(*) into t_count from APEX_P_AUTH_ROLE_USER_ASSO where USER_ID = t_userid AND APP_ID=V('APP_ID');
SELECT COUNT(*)
INTO T_COUNT
FROM AUTH_USER_ROLE_ASSO A
LEFT JOIN AUTH_ROLE B
ON A.ROLE_ID = B.ROLE_ID
WHERE A.USER_ID = T_USERID
AND B.APP_CODE = V('APP_CODE')
AND TENANT_ID = T_TENANTID;
-- select max(AUTH_NUM) into t_auth from APEX_P_AUTH_ROLE where DEL_FLAG = 0 and TENANT_ID = t_tenantid and APP_ID = V('APP_ID');
SELECT nvl(max(ROLE_ID),0),nvl(max(AUTH_LEVEL),0)
INTO T_ID, T_AUTH
FROM AUTH_ROLE
WHERE APP_CODE = V('APP_CODE')
AND IS_DEFAULT = 1
AND TENANT_ID = T_TENANTID;
IF T_COUNT > 0 THEN
/* select AUTH_NUM into t_auth from APEX_P_AUTH_ROLE_USER_ASSO rua
join APEX_P_AUTH_ROLE r
on r.ROLE_ID = rua.ROLE_ID
where USER_ID = t_userid AND rua.app_id = V('APP_ID') AND ROWNUM = 1;*/
SELECT A.ROLE_ID, B.AUTH_LEVEL
INTO T_ID, T_AUTH
FROM AUTH_USER_ROLE_ASSO A
LEFT JOIN AUTH_ROLE B
ON A.ROLE_ID = B.ROLE_ID
WHERE A.USER_ID = T_USERID
AND B.APP_CODE = V('APP_CODE')
AND B.TENANT_ID = T_TENANTID
AND ROWNUM = 1;
ELSE
-- ������������������������������������������
/* select ROLE_ID into t_id from APEX_P_AUTH_ROLE
where AUTH_NUM = t_auth AND APP_ID = V('APP_ID');
insert into APEX_P_AUTH_ROLE_USER_ASSO(USER_ID,ROLE_ID,APP_ID)
values (t_userid,t_id,V('APP_ID'));
commit;*/
INSERT INTO AUTH_USER_ROLE_ASSO (USER_ID, ROLE_ID) VALUES (T_USERID, T_ID);
COMMIT;
END IF;
-- ����APP_USER
APEX_CUSTOM_AUTH.SET_USER(T_USERID);
-- ��������������������session state
APEX_UTIL.SET_SESSION_STATE('MPF_API_URL', 'http://gateway_dev.ywjasolar.com.cn:19999/');
-- APEX_UTIL.SET_SESSION_STATE('JINGBAO_URL', 'http://172.30.64.30:31000/');
APEX_UTIL.SET_SESSION_STATE('JINGBAO_URL', 'http://172.30.64.30:31000/');
APEX_UTIL.SET_SESSION_STATE('JINGBAO_API_URL', 'http://dev_server_jingbao.ywjasolar.com.cn:19999/');
-- APEX_UTIL.SET_SESSION_STATE('MPF_API_URL', 'http://gateway_test.ywjasolar.com/');
APEX_UTIL.SET_SESSION_STATE('ROLEID', T_ID);
APEX_UTIL.SET_SESSION_STATE('USERTENANT', T_TENANTID);
APEX_UTIL.SET_SESSION_STATE('USERDEPT', T_DEPID);
APEX_UTIL.SET_SESSION_STATE('USERNAME', T_NAME);
APEX_UTIL.SET_SESSION_STATE('USERJOBNUMBER', T_JOBNUMBER);
APEX_UTIL.SET_SESSION_STATE('USERAUTH', T_AUTH);
APEX_UTIL.SET_SESSION_STATE('USERMOBILE', T_MOBILE);
APEX_UTIL.SET_SESSION_STATE('USEREMAIL', T_EMAIL);
APEX_UTIL.SET_SESSION_STATE('USER_ID', T_USERID);
APEX_UTIL.SET_SESSION_STATE('USERID', T_USERID);
APEX_UTIL.SET_SESSION_STATE('APPKEY', GETAPPKEY(T_TENANTID));
APEX_UTIL.SET_SESSION_STATE('APPSECRET', GETAPPSECRET(T_TENANTID));
--apex_util.set_session_state('USERFIRST',t_first);
END;
/
应用162
验证函数名 apex_app_auth_authentication_3
验证后过程名 APEX_APP_AUTH_POST_AUTHENTICATION_162